Patch ported from fedora, additionally user is added into
created default group, as specified in documentation.
---
users.py | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
if not homedir:
homedir = "/home/" + name
@@ -111,9 +109,16 @@ class Users:
cryptPassword(password, salt=salt),
True)
+ # Add the user to all the groups they should be part of.
+ grpLst.append(self.admin.lookupGroupByName(name))
+ for grp in grpLst:
+ grp.add(libuser.MEMBERNAME, name)
+ self.admin.modifyGroup(grp)
+
# Now set the correct home directory to fix up passwd.
userEnt.set(libuser.HOMEDIRECTORY, homedir)
self.admin.modifyUser(userEnt)
+ return True
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-23-2009, 01:55 PM
Chris Lumens
Fix user --groups kickstart option (bug #454418)
> @@ -111,9 +109,16 @@ class Users:
> cryptPassword(password, salt=salt),
> True)
>
> + # Add the user to all the groups they should be part of.
> + grpLst.append(self.admin.lookupGroupByName(name))
> + for grp in grpLst:
> + grp.add(libuser.MEMBERNAME, name)
> + self.admin.modifyGroup(grp)
> +
> # Now set the correct home directory to fix up passwd.
> userEnt.set(libuser.HOMEDIRECTORY, homedir)
> self.admin.modifyUser(userEnt)
> + return True
>
> def setRootPassword(self, password, isCrypted, salt=None):
> rootUser = self.admin.lookupUserByName("root")
Perhaps libuser has changed since RHEL5. I thought the user was
automatically added to their default group in Rawhide. Is this
incorrect?
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-23-2009, 02:51 PM
Radek Vykydal
Fix user --groups kickstart option (bug #454418)
Chris Lumens wrote:
@@ -111,9 +109,16 @@ class Users:
cryptPassword(password, salt=salt),
True)
+ # Add the user to all the groups they should be part of.
+ grpLst.append(self.admin.lookupGroupByName(name))
+ for grp in grpLst:
+ grp.add(libuser.MEMBERNAME, name)
+ self.admin.modifyGroup(grp)
+
# Now set the correct home directory to fix up passwd.
userEnt.set(libuser.HOMEDIRECTORY, homedir)
self.admin.modifyUser(userEnt)
+ return True