summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-07-03 00:44:20 +0000
committerJeremy Katz <katzj@redhat.com>2001-07-03 00:44:20 +0000
commitead13b3e2196c2e6efdb642f3c1887f19405d6fc (patch)
treeb84b125b84c8e4aa5e9f35b4c8827cbfa906ae41
parent799fd0fc2912b0ce9dc03399c87225cf42c0dad3 (diff)
downloadanaconda-ead13b3e2196c2e6efdb642f3c1887f19405d6fc.tar.gz
anaconda-ead13b3e2196c2e6efdb642f3c1887f19405d6fc.tar.xz
anaconda-ead13b3e2196c2e6efdb642f3c1887f19405d6fc.zip
if the user has requested md5 passwords, write out the root password in the
autogenerated ks.cfg as an md5 crypted password (46294)
-rw-r--r--instdata.py2
-rw-r--r--users.py8
2 files changed, 7 insertions, 3 deletions
diff --git a/instdata.py b/instdata.py
index 2afa83bc1..228dd52d1 100644
--- a/instdata.py
+++ b/instdata.py
@@ -123,7 +123,7 @@ class InstallData:
self.mouse.writeKS(f)
self.xconfig.writeKS(f)
self.network.writeKS(f)
- self.rootPassword.writeKS(f)
+ self.rootPassword.writeKS(f, self.auth)
self.firewall.writeKS(f)
self.auth.writeKS(f)
self.timezone.writeKS(f)
diff --git a/users.py b/users.py
index 613ef3bba..844cb6673 100644
--- a/users.py
+++ b/users.py
@@ -94,8 +94,12 @@ class RootPassword(Password):
setPassword(instPath, "root", self.getCrypted (),
auth.useMD5, alreadyCrypted = 1)
- def writeKS(self, f):
- f.write("rootpw --iscrypted %s\n" % self.getCrypted())
+ def writeKS(self, f, auth):
+ pure = self.getPure()
+ if pure:
+ f.write("rootpw --iscrypted %s\n" %(cryptPassword(pure, auth.useMD5)))
+ else:
+ f.write("rootpw --iscrypted %s\n" %(self.getCrypted()))
def cryptPassword(password, useMD5):
if useMD5: