-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is an attempt to fix being able to set the root password from
kickstart.
Kind regards,
Jeroen van Meeuwen
- -kanarip
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFGIf5LKN6f2pNCvwgRAv6OAJwJSR12vJFpLjj/N4CSPVPc91NXxACgyRIa
nJEiIvWIjQbukKThHBc6le4=
=1ef2
-----END PGP SIGNATURE-----
--- livecd/creator/livecd-creator.orig 2007-04-10 23:53:59.000000000 +0200
+++ livecd/creator/livecd-creator 2007-04-15 12:21:56.000000000 +0200
@@ -522,9 +522,22 @@
args.append("--selinux=disabled")
subprocess.call(args, preexec_fn=self.run_in_root)
- # FIXME: we should allow the setting of the root pass
- if os.path.exists("%s/usr/bin/passwd" %(instroot,)):
- subprocess.call(["/usr/bin/passwd", "-d", "root"], preexec_fn=self.run_in_root)
+ # Set the root password
+ if not self.ksparser.handler.rootpw.isCrypted:
+ p1 = subprocess.Popen(["/bin/echo", self.ksparser.handler.rootpw.rootpw], stdout=PIPE, preexec_fn=self.run_in_root)
+ p2 = subprocess.Popen(["/usr/bin/passwd", "--stdin", "root"], stdin=p1.stdout, stdout=PIPE, preexec_fn=self.run_in_root)
+ output = p2.communicate()[0]
+ else:
+ if os.path.exists("%s/etc/shadow" %(instroot,), "rw+"):
+ f = open("%s/etc/shadow" % (instroot,))
+ else:
+ f = open("%s/etc/passwd" % (instroot,))
+
+ buf = f.read()
+ buf = buf.replace("root:!!:","root:%s:" % (self.ksparser.handler.rootpw.rootpw,))
+ f.seek(0)
+ f.write(buf)
+ f.close()
# enable/disable services appropriately
if os.path.exists("%s/sbin/chkconfig" %(instroot,)):
--
Fedora-livecd-list mailing list
[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list