Bug 8468

Summary: anaconda in kickstart mode does not handle --iscrypted well
Product: [Retired] Red Hat Linux Reporter: Karl Burkett <burkett>
Component: installerAssignee: Jay Turner <jturner>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-14 18:13:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Karl Burkett 2000-01-14 14:57:15 UTC
Congradulations on anaconda - in general it works quite well. However there
is a problem when trying to use kickstart with it.  The kickstart.conf
command:

rootpw zgoqj2n9SIvQg --iscrypted DUMMYENTRY

does not work correctly.  The code fails to recognise the --iscrypted flag
with the result that an encrypted string is encrypted again and there is no
hope of getting into the system with a simple password (Though come to
think about it, this is a great security feature to insure that really good
root passwords are used. Afterall, who in their right mind would use
zgoqj2n9SIvQg as a password.). I've managed to locate and fix the problem
and I'll address how in just a moment, but first let me explain the
"DUMMYENTRY" in the command line. It exists to help get past a list problem
in the code.  I did this as a quick work around because of my just starting
to understand python and anaconda.  Basicly it worked and I left it at
that.  The problem line is in the file kickstart.py at line 19, which
reads:

InstallClass.doRootPw(self, extra[0], isCrypted = isCrypted)

The extra[0] is the problem.  Without DUMMYENTRY extra does not get forced
to being a list at which time python complains about index out of range.
I'll leave this for you guy's to solve unless things get real slow here.

Now for how I solved the --iscrypted problem:

in installclass.py on line 152 add:

        self.isCrypted = isCrypted

or stated another way, the doRootPw routine should look like:

    def doRootPw(self, pw, isCrypted = 0):
        self.rootPassword = pw
        self.isCrypted = isCrypted

The next step is to motify the todo.py file at line 1248 to look like:

            todo.rootpassword.set(todo.instClass.rootPassword,
                todo.instClass.isCrypted)

where it used to look like:

            todo.rootpassword.set(todo.instClass.rootPassword)

and thus failed to pass the isCyrypted flag to the set routine/method.

Hope this will help.

Comment 1 jastr 2000-01-15 19:31:59 UTC
This removes the need for a DUMMYENTRY after --iscrypted

--- kickstart.py~       Sat Sep 25 13:01:19 1999
+++ kickstart.py        Thu Jan  6 03:14:22 2000
@@ -8,7 +8,7 @@
 class Kickstart(InstallClass):

     def doRootPw(self, args):
-       (args, extra) = isys.getopt(args, '', [ 'iscrypted=' ])
+       (args, extra) = isys.getopt(args, '', [ 'iscrypted' ])

        isCrypted = 0
        for n in args:

Comment 2 Jay Turner 2000-02-14 18:13:59 UTC
This is fixed in the latest version of the installer (available in beta).