Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 297841 Details for
Bug 437201
iSCSI - missing CHAP support in Anaconda
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Add CHAP support to Anaconda
291993.patch.4 (text/plain), 20.07 KB, created by
IBM Bug Proxy
on 2008-03-12 20:33:42 UTC
(
hide
)
Description:
Add CHAP support to Anaconda
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2008-03-12 20:33:42 UTC
Size:
20.07 KB
patch
obsolete
>diff -Nur -x .depend -x nfs_mountversion.h -x lang-names -x '*.po' -x moduledeps.c -x moduleinfo.c -x '*.gladep' anaconda-11.1.2.93/iscsi.py anaconda-11.1.2.93-iSCSI/iscsi.py >--- anaconda-11.1.2.93/iscsi.py 2008-01-30 16:09:49.000000000 -0600 >+++ anaconda-11.1.2.93-iSCSI/iscsi.py 2008-02-08 14:16:11.000000000 -0600 >@@ -31,6 +31,7 @@ > global ISCSIADM > ISCSIADM = "" > INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi" >+ISCSID_CONF="/etc/iscsi/iscsid.conf" > > def find_iscsi_files(): > global ISCSID >@@ -60,14 +61,17 @@ > return True > > class iscsiTarget: >- def __init__(self, ipaddr, port = None, user = None, pw = None): >+ def __init__(self, ipaddr, port = None, username = None, password = None, >+ username_in = None, password_in = None): > # FIXME: validate ipaddr > self.ipaddr = ipaddr > if not port: # FIXME: hack hack hack > port = 3260 > self.port = str(port) >- self.user = user >- self.password = pw >+ self.username = username >+ self.password = password >+ self.username_in = username_in >+ self.password_in = password_in > self._portal = None > self._nodes = [] > >@@ -112,6 +116,10 @@ > return True > > def startNode(self, node): >+ if self.portal is None: >+ log.debug("startNode: portal is None, returning") >+ return >+ > argv = [ "-m", "node", "-T", node, "-p", self.portal, > "-o", "update", "-n", "node.conn[0].startup", > "-v", "automatic" ] >@@ -137,9 +145,9 @@ > > ret = False > for node in self.nodes: >- if self.LoginToNode(node): >+ if self.loginToNode(node): > ret = True >- self.StartNode(node) >+ self.startNode(node) > > # we return True if there were any successful logins for our portal. > return ret >@@ -211,10 +219,28 @@ > > retval = {} > >+ # Note: The kernel module, iscsi_ibft, must be loaded! > argv = [ "-m", "fw" ] > log.debug("queryFirmware: ISCSIADM is %s" % (ISCSIADM,)) > result = iutil.execWithCapture(ISCSIADM, argv) > result = result.strip() >+ >+ if len(result) == 0 \ >+ or result[0].find ("iscsiadm -") != -1 \ >+ or result[0].find ("iscsiadm: ") != -1: >+ log.debug("queryFirmware: ISCSIADM %s returns bad output: %s" % (argv, result,)) >+ >+ # Try querying thre node records instead >+ argv = [ "-m", "node", "-o", "show", "-S" ] >+ result = iutil.execWithCapture(ISCSIADM, argv) >+ result = result.strip() >+ >+ if len(result) == 0 \ >+ or result[0].find ("iscsiadm -") != -1 \ >+ or result[0].find ("iscsiadm: ") != -1: >+ log.debug("queryFirmware: ISCSIADM %s returns bad output: %s" % (argv, result,)) >+ return retval >+ > for line in result.split("\n"): > SPLIT = " = " > idx = line.find(SPLIT) >@@ -252,6 +278,9 @@ > os.kill(pid, signal.SIGKILL) > > def shutdown(self): >+ if not has_iscsi(): >+ return >+ > if flags.test: > if self.oldInitiatorFile != None: > f = open(INITIATOR_FILE, "w") >@@ -263,12 +292,12 @@ > > def loginToDefaultDrive(self): > # Example: >- # [root@elm3b87 ~]# iscsiadm -m fw -l >+ # [root@elm3b87 ~]# iscsiadm -m discovery -t fw -l > # Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.84183797, portal: 9.47.67.152,3260] > > find_iscsi_files() > >- argv = [ "-m", "fw", "-l" ] >+ argv = [ "-m", "discovery", "-t", "fw", "-l" ] > result = iutil.execWithCapture(ISCSIADM, argv) > > TARGET = "target: " >@@ -279,6 +308,7 @@ > idxEnd = result.find(END) > > if idxTarget == -1 or idxPortal == -1 or idxEnd == -1: >+ log.warn("could not find markers. iscsiadm returned %s" %(result,)) > return None > > target = result[idxTarget + len(TARGET) : idxPortal] >@@ -350,15 +380,85 @@ > if intf: > w.pop() > >- def addTarget(self, ipaddr, port = "3260", user = None, pw = None, >- intf = None): >- if not self.iscsidStarted: >- self.startup(intf) >- if not self.iscsidStarted: >- # can't start for some reason.... just fallback I guess >- return >+ def addTarget(self, ipaddr, port = "3260", username = None, password = None, >+ username_in = None, password_in = None, intf = None): >+ self.startup() >+ >+ commentUsername = '#' >+ commentUsername_in = '#' >+ >+ if username != None or password != None: >+ commentUsername = '' >+ if username == None: >+ raise ValueError, "Username must be filled in!" >+ if password == None: >+ raise ValueError, "Password must be filled in!" >+ >+ if username_in != None or password_in != None: >+ commentUsername_in = '' >+ if username_in == None: >+ raise ValueError, "Username_in must be filled in!" >+ if password_in == None: >+ raise ValueError, "Password_in must be filled in!" >+ >+ if not os.access(ISCSID_CONF, os.R_OK): >+ raise ValueError, "%s cannot be read" % (ISCSID_CONF,) >+ if not os.access(ISCSID_CONF, os.W_OK): >+ raise ValueError, "%s cannot be written" % (ISCSID_CONF,) >+ >+ f = open(ISCSID_CONF, "r") >+ oldIscsidFile = f.readlines() >+ f.close() >+ >+ # If either a username/password pair was specified or a >+ # username_in/password_in was specified, then CHAP is specified. >+ if commentUsername == '' or commentUsername_in == '': >+ commentChap = '' >+ else: >+ commentChap = '#' >+ >+ NSAA = "node.session.auth.authmethod = " >+ NSAU = "node.session.auth.username = " >+ NSAP = "node.session.auth.password = " >+ NSAU_ = "node.session.auth.username_in = " >+ NSAP_ = "node.session.auth.password_in = " >+ DSAA = "discovery.sendtargets.auth.authmethod = " >+ DSAU = "discovery.sendtargets.auth.username = " >+ DSAP = "discovery.sendtargets.auth.password = " >+ DSAU_ = "discovery.sendtargets.auth.username_in = " >+ DSAP_ = "discovery.sendtargets.auth.password_in = " >+ >+ f = open(ISCSID_CONF, "w") >+ for line in oldIscsidFile: >+ s = line.strip() >+ # grab the cr/lf/cr+lf >+ nl = line[line.find(s)+len(s):] >+ if line.find (NSAA) != -1: >+ f.write ("%s%s%s%s" % (commentChap, NSAA, "CHAP", nl,)) >+ elif line.find (NSAU) != -1: >+ f.write ("%s%s%s%s" % (commentUsername, NSAU, username, nl,)) >+ elif line.find (NSAP) != -1: >+ f.write ("%s%s%s%s" % (commentUsername, NSAP, password, nl,)) >+ elif line.find (NSAU_) != -1: >+ f.write ("%s%s%s%s" % (commentUsername_in, NSAU_, username_in, nl,)) >+ elif line.find (NSAP_) != -1: >+ f.write ("%s%s%s%s" % (commentUsername_in, NSAP_, password_in, nl,)) >+ elif line.find (DSAA) != -1: >+ f.write ("%s%s%s%s" % (commentChap, DSAA, "CHAP", nl,)) >+ elif line.find (DSAU) != -1: >+ f.write ("%s%s%s%s" % (commentUsername, DSAU, username, nl,)) >+ elif line.find (DSAP) != -1: >+ f.write ("%s%s%s%s" % (commentUsername, DSAP, password, nl,)) >+ elif line.find (DSAU_) != -1: >+ f.write ("%s%s%s%s" % (commentUsername_in, DSAU_, username_in, nl,)) >+ elif line.find (DSAP_) != -1: >+ f.write ("%s%s%s%s" % (commentUsername_in, DSAP_, password_in, nl,)) >+ else: >+ f.write(line) >+ f.close () >+ >+ t = iscsiTarget(ipaddr, port, username, password, username_in, password_in) > >- t = iscsiTarget(ipaddr, port, user, pw) > if not t.discover(): > return > if not t.login(): >@@ -372,10 +472,11 @@ > f.write("iscsiname %s\n" %(self.initiator,)) > for t in self.targets: > f.write("iscsi --ipaddr %s --port %s" %(t.ipaddr, t.port)) >- if t.user: >- f.write(" --user %s" %(t.user,)) >+ if t.username: >+ f.write(" --user %s" %(t.username,)) > if t.password: > f.write(" --password %s" %(t.password,)) >+ # @TBD - We need kickstart support for username_in and password_in > f.write("\n") > > def write(self, instPath): >diff -Nur -x .depend -x nfs_mountversion.h -x lang-names -x '*.po' -x moduledeps.c -x moduleinfo.c -x '*.gladep' anaconda-11.1.2.93/iw/autopart_type.py anaconda-11.1.2.93-iSCSI/iw/autopart_type.py >--- anaconda-11.1.2.93/iw/autopart_type.py 2008-01-30 16:09:49.000000000 -0600 >+++ anaconda-11.1.2.93-iSCSI/iw/autopart_type.py 2008-02-06 11:19:57.000000000 -0600 >@@ -115,10 +115,6 @@ > map(lambda x: sg.add_widget(dxml.get_widget(x)), > ("iscsiAddrEntry", "iscsiInitiatorEntry")) > >- # we don't currently support username or password... >- map(lambda x: dxml.get_widget(x).hide(), >- ("userLabel", "passLabel", "userEntry", "passEntry")) >- > # get the initiator name if it exists and don't allow changing > # once set > e = dxml.get_widget("iscsiInitiatorEntry") >@@ -142,8 +138,28 @@ > self.anaconda.id.iscsi.initiator = initiator > > target = dxml.get_widget("iscsiAddrEntry").get_text().strip() >- user = dxml.get_widget("userEntry").get_text().strip() >- pw = dxml.get_widget("passEntry").get_text().strip() >+ >+ username = dxml.get_widget("userEntry").get_text().strip() >+ password = dxml.get_widget("passEntry").get_text().strip() >+ username_in = dxml.get_widget("userinEntry").get_text().strip() >+ password_in = dxml.get_widget("passinEntry").get_text().strip() >+ >+ if len(username) == 0: >+ username = None >+ if len(password) == 0: >+ password = None >+ if len(username_in) == 0: >+ username_in = None >+ if len(password_in) == 0: >+ password_in = None >+ >+ if username != None or password != None or username_in != None or password_in != None: >+ if username == None or password == None or username_in == None or password_in == None: >+ self.intf.messageWindow(_("Missing fields"), >+ _("If any username or password field is filled in, " >+ "then they all must be filled in.")) >+ continue >+ > err = None > try: > idx = target.rfind(":") >@@ -159,10 +175,11 @@ > except network.IPError, msg: > err = msg > if err: >- self.intf.messageWindow(_("Error with Data"), "%s" %(msg,)) >+ self.intf.messageWindow(_("Error with Data"), "%s" %(err,)) > continue > >- self.anaconda.id.iscsi.addTarget(ip, port, user, pw, self.intf) >+ self.anaconda.id.iscsi.addTarget(ip, port, username, password, >+ username_in, password_in, self.intf) > break > > dialog.destroy() >diff -Nur -x .depend -x nfs_mountversion.h -x lang-names -x '*.po' -x moduledeps.c -x moduleinfo.c -x '*.gladep' anaconda-11.1.2.93/textw/partition_text.py anaconda-11.1.2.93-iSCSI/textw/partition_text.py >--- anaconda-11.1.2.93/textw/partition_text.py 2008-01-30 16:09:49.000000000 -0600 >+++ anaconda-11.1.2.93-iSCSI/textw/partition_text.py 2008-02-06 14:18:24.000000000 -0600 >@@ -1708,11 +1708,45 @@ > _("Configure iSCSI Parameters"), > _("To use iSCSI disks, you must provide the address of your iSCSI target and the iSCSI initiator name you've configured for your host."), > prompts = [ "Target IP Address", >- "iSCSI Initiator Name" ]) >+ "iSCSI Initiator Name", >+ "CHAP username", >+ "CHAP password", >+ "Reverse CHAP username", >+ "Reverse CHAP password" ]) > > if button == 'cancel': > return INSTALL_BACK > >+ username = entries[2] >+ password = entries[3] >+ username_in = entries[4] >+ password_in = entries[5] >+ >+ if len(username) == 0: >+ username = None >+ if len(password) == 0: >+ password = None >+ if len(username_in) == 0: >+ username_in = None >+ if len(password_in) == 0: >+ password_in = None >+ >+ if username != None or password != None: >+ if username == None or password == None: >+ ButtonChoiceWindow(screen, >+ _("Missing fields"), >+ _("If any username or password field is filled in, " >+ "then they all must be filled in.")) >+ return INSTALL_BACK >+ >+ if username_in != None or password_in != None: >+ if username_in == None or password_in == None: >+ ButtonChoiceWindow(screen, >+ _("Missing fields"), >+ _("If any username or password field is filled in, " >+ "then they all must be filled in.")) >+ return INSTALL_BACK >+ > target = entries[0].strip() > try: > idx = target.rfind(":") >@@ -1731,6 +1765,7 @@ > iname = entries[1].strip() > if not self.anaconda.id.iscsi.initiatorSet: > self.anaconda.id.iscsi.initiator = iname >- self.anaconda.id.iscsi.addTarget(ip, port) >+ self.anaconda.id.iscsi.addTarget(ip, port, username, password, >+ username_in, password_in) > > return INSTALL_OK >diff -Nur -x .depend -x nfs_mountversion.h -x lang-names -x '*.po' -x moduledeps.c -x moduleinfo.c -x '*.gladep' anaconda-11.1.2.93/ui/iscsi-config.glade anaconda-11.1.2.93-iSCSI/ui/iscsi-config.glade >--- anaconda-11.1.2.93/ui/iscsi-config.glade 2008-01-30 16:09:49.000000000 -0600 >+++ anaconda-11.1.2.93-iSCSI/ui/iscsi-config.glade 2008-02-06 14:20:52.000000000 -0600 >@@ -162,7 +162,7 @@ > <widget class="GtkTable" id="iscsiTable"> > <property name="border_width">12</property> > <property name="visible">True</property> >- <property name="n_rows">4</property> >+ <property name="n_rows">6</property> > <property name="n_columns">2</property> > <property name="homogeneous">False</property> > <property name="row_spacing">6</property> >@@ -275,7 +275,7 @@ > <child> > <widget class="GtkLabel" id="userLabel"> > <property name="visible">True</property> >- <property name="label" translatable="yes"><b>_Username:</b></property> >+ <property name="label" translatable="yes"><b>CHAP _Username:</b></property> > <property name="use_underline">True</property> > <property name="use_markup">True</property> > <property name="justify">GTK_JUSTIFY_LEFT</property> >@@ -304,7 +304,7 @@ > <child> > <widget class="GtkLabel" id="passLabel"> > <property name="visible">True</property> >- <property name="label" translatable="yes"><b>_Password:</b></property> >+ <property name="label" translatable="yes"><b>CHAP _Password:</b></property> > <property name="use_underline">True</property> > <property name="use_markup">True</property> > <property name="justify">GTK_JUSTIFY_LEFT</property> >@@ -371,6 +371,106 @@ > <property name="y_options"></property> > </packing> > </child> >+ >+ <child> >+ <widget class="GtkLabel" id="userinLabel"> >+ <property name="visible">True</property> >+ <property name="label" translatable="yes"><b>Reverse CHAP U_sername:</b></property> >+ <property name="use_underline">True</property> >+ <property name="use_markup">True</property> >+ <property name="justify">GTK_JUSTIFY_LEFT</property> >+ <property name="wrap">False</property> >+ <property name="selectable">False</property> >+ <property name="xalign">0</property> >+ <property name="yalign">0.5</property> >+ <property name="xpad">0</property> >+ <property name="ypad">0</property> >+ <property name="mnemonic_widget">userEntry</property> >+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> >+ <property name="width_chars">-1</property> >+ <property name="single_line_mode">False</property> >+ <property name="angle">0</property> >+ </widget> >+ <packing> >+ <property name="left_attach">0</property> >+ <property name="right_attach">1</property> >+ <property name="top_attach">4</property> >+ <property name="bottom_attach">5</property> >+ <property name="x_options">fill</property> >+ <property name="y_options"></property> >+ </packing> >+ </child> >+ >+ <child> >+ <widget class="GtkEntry" id="userinEntry"> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="editable">True</property> >+ <property name="visibility">True</property> >+ <property name="max_length">0</property> >+ <property name="text" translatable="yes"></property> >+ <property name="has_frame">True</property> >+ <property name="invisible_char">â¢</property> >+ <property name="activates_default">False</property> >+ </widget> >+ <packing> >+ <property name="left_attach">1</property> >+ <property name="right_attach">2</property> >+ <property name="top_attach">4</property> >+ <property name="bottom_attach">5</property> >+ <property name="y_options"></property> >+ </packing> >+ </child> >+ >+ <child> >+ <widget class="GtkEntry" id="passinEntry"> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="editable">True</property> >+ <property name="visibility">False</property> >+ <property name="max_length">0</property> >+ <property name="text" translatable="yes"></property> >+ <property name="has_frame">True</property> >+ <property name="invisible_char">â¢</property> >+ <property name="activates_default">False</property> >+ </widget> >+ <packing> >+ <property name="left_attach">1</property> >+ <property name="right_attach">2</property> >+ <property name="top_attach">5</property> >+ <property name="bottom_attach">6</property> >+ <property name="y_options"></property> >+ </packing> >+ </child> >+ >+ <child> >+ <widget class="GtkLabel" id="passinLabel"> >+ <property name="visible">True</property> >+ <property name="label" translatable="yes"><b>Reverse CHAP P_assword:</b></property> >+ <property name="use_underline">True</property> >+ <property name="use_markup">True</property> >+ <property name="justify">GTK_JUSTIFY_LEFT</property> >+ <property name="wrap">False</property> >+ <property name="selectable">False</property> >+ <property name="xalign">0</property> >+ <property name="yalign">0.5</property> >+ <property name="xpad">0</property> >+ <property name="ypad">0</property> >+ <property name="mnemonic_widget">passEntry</property> >+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> >+ <property name="width_chars">-1</property> >+ <property name="single_line_mode">False</property> >+ <property name="angle">0</property> >+ </widget> >+ <packing> >+ <property name="left_attach">0</property> >+ <property name="right_attach">1</property> >+ <property name="top_attach">5</property> >+ <property name="bottom_attach">6</property> >+ <property name="x_options">fill</property> >+ <property name="y_options"></property> >+ </packing> >+ </child> > </widget> > <packing> > <property name="padding">0</property>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 437201
: 297841