summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2006-07-28 20:21:52 +0000
committerJeremy Katz <katzj@redhat.com>2006-07-28 20:21:52 +0000
commitfa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1 (patch)
tree40713f912ee15ac5d073ea017acc9eb11bce4a70
parent07fd45cf256752fcebd7719c4c1b9939c675931f (diff)
downloadanaconda-fa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1.tar.gz
anaconda-fa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1.tar.xz
anaconda-fa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1.zip
2006-07-28 Jeremy Katz <katzj@redhat.com>
* users.py (Users.createUser): Create users under the rootpath (Clark Williams) * instdata.py (InstallData.write): Use the rootpath
-rw-r--r--ChangeLog4
-rw-r--r--instdata.py2
-rw-r--r--users.py5
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 81788a85b..23187409b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2006-07-28 Jeremy Katz <katzj@redhat.com>
+ * users.py (Users.createUser): Create users under the rootpath
+ (Clark Williams)
+ * instdata.py (InstallData.write): Use the rootpath
+
* packages.py (setFileCons): Normalize path so we don't hit a bug
in matchpathcon
diff --git a/instdata.py b/instdata.py
index 24747ba24..1f3852832 100644
--- a/instdata.py
+++ b/instdata.py
@@ -175,7 +175,7 @@ class InstallData:
for ud in self.ksdata.userList:
if self.users.createUser(ud.name, ud.password, ud.isCrypted,
ud.groups, ud.homedir, ud.shell,
- ud.uid) == None:
+ ud.uid, root=anaconda.rootPath) == None:
log.error("User %s already exists, not creating." % ud.name)
diff --git a/users.py b/users.py
index 588400c2d..3b44127e3 100644
--- a/users.py
+++ b/users.py
@@ -18,6 +18,7 @@ import crypt
import random
import tempfile
import os
+import os.path
def createLuserConf(instPath):
"""Writes a libuser.conf for instPath."""
@@ -59,7 +60,7 @@ class Users:
self.admin = libuser.admin()
def createUser (self, name, password=None, isCrypted=False, groups=[],
- homedir=None, shell=None, uid=None):
+ homedir=None, shell=None, uid=None, root="/mnt/sysimage"):
if self.admin.lookupUserByName(name):
return None
@@ -77,7 +78,7 @@ class Users:
homedir = "/home/" + name
# Do this to make the user's home dir under the install root.
- userEnt.set(libuser.HOMEDIRECTORY, "/mnt/sysimage/" + homedir)
+ userEnt.set(libuser.HOMEDIRECTORY, os.path.join(root, homedir))
if shell:
userEnt.set(libuser.LOGINSHELL, shell)