diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rwxr-xr-x | anaconda | 11 | ||||
-rw-r--r-- | users.py | 23 |
3 files changed, 38 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2006-05-17 Jeremy Katz <katzj@redhat.com> + * anaconda (Anaconda.setMethod): Set up our libuser.conf + + * users.py (createLuserConf): Create a libuser.conf that points to + our rootpath so that things work with live CD, etc + * security.py (Security.write): Safe for all !test mode * instdata.py (InstallData.write): Likewise. @@ -601,6 +601,7 @@ if __name__ == "__main__": import warnings import rhpl import vnc + import users from flags import flags from rhpl.translate import _, textdomain, addPoPath @@ -679,8 +680,10 @@ if __name__ == "__main__": if rhpl.getArch() == "s390": opts.isHeadless = True + users.createLuserConf(anaconda.rootPath) + # setup links required for all install types - for i in ( "services", "protocol", "nsswitch.conf", "joe", "selinux", "libuser.conf"): + for i in ( "services", "protocol", "nsswitch.conf", "joe", "selinux"): try: if os.path.exists("/mnt/runtime/etc/" + i): os.symlink ("../mnt/runtime/etc/" + i, "/etc/" + i) @@ -945,6 +948,12 @@ if __name__ == "__main__": except: handleException(anaconda, sys.exc_info()) + # remove our libuser.conf + try: + os.unlink(os.environ["LIBUSER_CONF"]) + except: + pass + if anaconda.isKickstart and instClass.ksdata.reboot["eject"]: isys.flushDriveDict() for drive in isys.cdromList(): @@ -16,6 +16,29 @@ import libuser import string import crypt import random +import tempfile +import os + +def createLuserConf(instPath): + """Writes a libuser.conf for instPath.""" + (fd, fn) = tempfile.mkstemp(prefix="libuser.") + buf = """ +[defaults] +skeleton = %(instPath)s/etc/skel +mailspooldir = %(instPath)s/var/mail +crypt_style = md5 +modules = files shadow +create_modules = files shadow +[files] +directory = %(instPath)s/etc +[shadow] +directory = %(instPath)s/etc +""" % {"instPath": instPath} + os.write(fd, buf) + os.close(fd) + + os.environ["LIBUSER_CONF"] = fn + def cryptPassword(password, useMD5): if useMD5: |