[PATCH 1/1] Conform to RFC 3720.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



RFC 3720 states:
      c) iSCSI names are composed only of displayable characters.  iSCSI
         names allow the use of international character sets but are not
         case sensitive.  No whitespace characters are used in iSCSI
         names.
But lio_node effectively nullifies the 'case sensitiveness' by running
'lower()' on the values.

Remove these, to conform to the RFC.

Signed-off-by: Turbo Fredriksson <turbo@xxxxxxxxxx>
---
 lio-py/lio_node.py |   53 ----------------------------------------------------
 1 file changed, 53 deletions(-)

diff --git a/lio-py/lio_node.py b/lio-py/lio_node.py
index 02e661b..6ebe542 100755
--- a/lio-py/lio_node.py
+++ b/lio-py/lio_node.py
@@ -66,7 +66,6 @@ def lio_alua_set_secondary_write_md(iqn, tpgt, lun):
 
 def lio_alua_process_secondary_md(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 
@@ -129,7 +128,6 @@ def lio_alua_process_secondary_md(option, opt_str, value, parser):
 
 def __lio_target_del_iqn(option, opt_str, value, parser, delete_tpg_md):
 	iqn = str(value);
-	iqn = iqn.lower();
 
 # Loop through LIO-Target IQN+TPGT list
 	tpg_root = os.listdir(lio_root + "/" + iqn); 
@@ -158,7 +156,6 @@ def __lio_target_del_iqn(option, opt_str, value, parser, delete_tpg_md):
 
 def lio_target_del_iqn(option, opt_str, value, parser):
 	iqn = str(value);
-	iqn = iqn.lower();
 
 	iqn_dir = lio_root + "/" + iqn
 	if os.path.isdir(iqn_dir) == False:
@@ -174,7 +171,6 @@ def lio_target_del_iqn(option, opt_str, value, parser):
 
 def __lio_target_del_tpg(option, opt_str, value, parser, delete_tpg_md):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	# This will set TPG Status to INACTIVE force all of the iSCSI sessions for this
@@ -220,7 +216,6 @@ def __lio_target_del_tpg(option, opt_str, value, parser, delete_tpg_md):
 
 def lio_target_del_tpg(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	tpgt_file = lio_root + "/" + iqn + "/tpgt_" + tpgt
@@ -235,7 +230,6 @@ def lio_target_del_tpg(option, opt_str, value, parser):
 
 def lio_target_add_np(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	np = str(value[2]);
 
@@ -273,7 +267,6 @@ def lio_target_add_np(option, opt_str, value, parser):
 
 def lio_target_del_np(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	np = str(value[2]);
 
@@ -302,7 +295,6 @@ def lio_target_del_np(option, opt_str, value, parser):
 
 def lio_target_add_port(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 	port_name = str(value[3]);
@@ -335,7 +327,6 @@ def lio_target_add_port(option, opt_str, value, parser):
 
 def lio_target_add_tpg(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	tpg_dir = lio_root + "/" + iqn + "/tpgt_" + tpgt
@@ -354,7 +345,6 @@ def lio_target_add_tpg(option, opt_str, value, parser):
 
 def __lio_target_del_port(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 
@@ -392,7 +382,6 @@ def __lio_target_del_port(option, opt_str, value, parser):
 
 def lio_target_del_port(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 
@@ -409,7 +398,6 @@ def lio_target_del_port(option, opt_str, value, parser):
 
 def lio_target_tpg_disableauth(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	
 	enable_op = "echo 0 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/attrib/authentication"
@@ -423,7 +411,6 @@ def lio_target_tpg_disableauth(option, opt_str, value, parser):
 
 def lio_target_tpg_demomode(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	enable_op = "echo 1 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/attrib/generate_node_acls"
@@ -437,10 +424,8 @@ def lio_target_tpg_demomode(option, opt_str, value, parser):
 
 def lio_target_disable_lunwp(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	mapped_lun = str(value[3]);
 
 	disable_op = "echo 0 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn + "/lun_" + mapped_lun + "/write_protect"
@@ -454,7 +439,6 @@ def lio_target_disable_lunwp(option, opt_str, value, parser):
 
 def lio_target_enable_auth(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	enable_op = "echo 1 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/attrib/authentication"
@@ -467,10 +451,8 @@ def lio_target_enable_auth(option, opt_str, value, parser):
 
 def lio_target_enable_lunwp(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	mapped_lun = str(value[3]);
 
 	enable_op = "echo 1 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn + "/lun_" + mapped_lun + "/write_protect"
@@ -484,7 +466,6 @@ def lio_target_enable_lunwp(option, opt_str, value, parser):
 
 def lio_target_enable_tpg(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	enable_op = "echo 1 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/enable"
@@ -498,7 +479,6 @@ def lio_target_enable_tpg(option, opt_str, value, parser):
 
 def lio_target_disable_tpg(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	disable_op = "echo 0 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/enable"
@@ -512,7 +492,6 @@ def lio_target_disable_tpg(option, opt_str, value, parser):
 
 def lio_target_enableaclmode(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	enable_op = "echo 0 > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/attrib/generate_node_acls"
@@ -526,10 +505,8 @@ def lio_target_enableaclmode(option, opt_str, value, parser):
 
 def lio_target_add_lunacl(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	tpg_lun = str(value[3]);
 	mapped_lun = str(value[4]);
 
@@ -551,10 +528,8 @@ def lio_target_add_lunacl(option, opt_str, value, parser):
 
 def lio_target_del_lunacl(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	mapped_lun = str(value[3]);
 
 	lun_link_dir = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn + "/lun_" + mapped_lun
@@ -582,10 +557,8 @@ def lio_target_del_lunacl(option, opt_str, value, parser):
 
 def lio_target_add_nodeacl(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	
 	addnodeacl_op = "mkdir -p " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn
 	ret = os.system(addnodeacl_op)
@@ -599,10 +572,8 @@ def lio_target_add_nodeacl(option, opt_str, value, parser):
 
 def lio_target_del_nodeacl(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 
 	nacl_dir = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn
 	lun_acl_root = os.listdir(nacl_dir)
@@ -624,10 +595,8 @@ def lio_target_del_nodeacl(option, opt_str, value, parser):
 
 def lio_target_set_chap_auth(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	user = str(value[3]);
 	password = str(value[4]);
 
@@ -652,10 +621,8 @@ def lio_target_set_chap_auth(option, opt_str, value, parser):
 
 def lio_target_set_chap_mutual_auth(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	user_mutual = str(value[3]);
 	password_mutual = str(value[4]);
 
@@ -744,10 +711,8 @@ def lio_target_set_enforce_discovery_auth(option, opt_str, value, parser):
 
 def lio_target_set_node_tcq(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 	depth = str(value[3]);
 
 	setnodetcq_op = "echo " + depth + " > " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn + "/cmdsn_depth"
@@ -761,7 +726,6 @@ def lio_target_set_node_tcq(option, opt_str, value, parser):
 
 def lio_target_alua_set_tgptgp(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 	tg_pt_gp_name = str(value[3])
@@ -781,7 +745,6 @@ def lio_target_alua_set_tgptgp(option, opt_str, value, parser):
 
 def lio_target_alua_set_tgpt_offline(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 
@@ -800,7 +763,6 @@ def lio_target_alua_set_tgpt_offline(option, opt_str, value, parser):
 
 def lio_target_alua_clear_tgpt_offline(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 
@@ -818,10 +780,8 @@ def lio_target_alua_clear_tgpt_offline(option, opt_str, value, parser):
 
 def lio_target_show_chap_auth(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 
 	auth_dir = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn + "/auth/"
 
@@ -852,10 +812,8 @@ def lio_target_show_chap_discovery_auth(option, opt_str, value, parser):
 
 def lio_target_show_node_tcq(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2]);
-	initiator_iqn = initiator_iqn.lower();
 
 	nacl = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/acls/" + initiator_iqn
 	if not os.path.isdir(nacl):
@@ -871,7 +829,6 @@ def lio_target_show_node_tcq(option, opt_str, value, parser):
 
 def lio_target_alua_show_tgptgp(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	lun = str(value[2]);
 
@@ -952,7 +909,6 @@ def lio_target_list_endpoints(option, opt_str, value, parser):
 
 def lio_target_list_lunacls(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	iqn_root = os.listdir(lio_root)
@@ -997,7 +953,6 @@ def lio_target_list_lunacls(option, opt_str, value, parser):
 
 def lio_target_list_nodeacls(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	iqn_root = os.listdir(lio_root)
@@ -1024,7 +979,6 @@ def lio_target_list_nodeacls(option, opt_str, value, parser):
 
 def lio_target_list_nps(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	np_root = os.listdir(lio_root + "/" + iqn + "/tpgt_" + tpgt + "/np")
@@ -1050,7 +1004,6 @@ def lio_target_list_targetnames(option, opt_str, value, parser):
 
 def lio_target_list_node_attr(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2])
 
@@ -1072,7 +1025,6 @@ def lio_target_list_node_attr(option, opt_str, value, parser):
 
 def lio_target_set_node_attr(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2])
 	attr = str(value[3])
@@ -1097,7 +1049,6 @@ def lio_target_set_node_attr(option, opt_str, value, parser):
 
 def lio_target_list_node_param(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	initiator_iqn = str(value[2])
 
@@ -1120,7 +1071,6 @@ def lio_target_list_node_param(option, opt_str, value, parser):
 
 def lio_target_list_tpg_attr(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	attr_dir = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/attrib"
@@ -1141,7 +1091,6 @@ def lio_target_list_tpg_attr(option, opt_str, value, parser):
 
 def lio_target_set_tpg_attr(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	attr = str(value[2]);
 	val = str(value[3]);
@@ -1165,7 +1114,6 @@ def lio_target_set_tpg_attr(option, opt_str, value, parser):
 
 def lio_target_list_tpg_param(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 
 	param_dir = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/param"
@@ -1186,7 +1134,6 @@ def lio_target_list_tpg_param(option, opt_str, value, parser):
 
 def lio_target_set_tpg_param(option, opt_str, value, parser):
 	iqn = str(value[0]);
-	iqn = iqn.lower();
 	tpgt = str(value[1]);
 	param = str(value[2]);
 	val = str(value[3]);

[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux