FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 02-23-2009, 12:50 PM
Radek Vykydal
 
Default Fix user --groups kickstart option (bug #454418)

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(-)

diff --git a/users.py b/users.py
index adefad8..b1219ff 100644
--- a/users.py
+++ b/users.py
@@ -78,12 +78,10 @@ class Users:
userEnt = self.admin.initUser(name)
groupEnt = self.admin.initGroup(name)

- gidLst = map(lambda grp: grp.get(libuser.GIDNUMBER)[0],
- filter(lambda grp: grp,
- map(lambda name: self.admin.lookupGroupByName(name), groups)))
- gidLst.extend(groupEnt.get(libuser.GIDNUMBER))
-
- userEnt.set(libuser.GIDNUMBER, gidLst)
+ grpLst = filter(lambda grp: grp,
+ map(lambda name: self.admin.lookupGroupByName(name), groups))
+ userEnt.set(libuser.GIDNUMBER, [groupEnt.get(libuser.GIDNUMBER)[0]] +
+ map(lambda grp: grp.get(libuser.GIDNUMBER)[0], grpLst))

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

def setRootPassword(self, password, isCrypted, salt=None):
rootUser = self.admin.lookupUserByName("root")
--
1.5.4.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-23-2009, 01:55 PM
Chris Lumens
 
Default 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
 
Old 02-23-2009, 02:51 PM
Radek Vykydal
 
Default 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

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


In rawhide user is not added automatically, I rechecked it,
only user's primary group is set to the created default group.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-24-2009, 02:02 PM
Chris Lumens
 
Default Fix user --groups kickstart option (bug #454418)

> In rawhide user is not added automatically, I rechecked it,
> only user's primary group is set to the created default group.

Then we had better make this update in Rawhide, too.

Original patch looks good, by the way.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 02:26 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org