Mantis - cas_usergroup
Viewing Issue Advanced Details
3861 other feature N/A 2009-08-19 09:23 2011-05-15 15:40
ja  
bonivart  
normal  
closed  
fixed  
none    
none  
0003861: Feature request cswusergroup: Add a user to more than one group
It would be nice, if it was possible, to add a user to multiple groups via the cswusergroup file.

Example: The user "nagios" should be added to the primary group "nagios" and the secondary group "nagioscm".
Issue History
2009-08-19 09:23 ja New Issue
2009-08-19 09:48 bonivart Status new => assigned
2009-08-19 09:48 bonivart Assigned To => bonivart
2009-08-19 09:52 bonivart Note Added: 0006589
2010-11-28 14:08 bwalton Project cswclassutils => cas_usergroup
2011-04-28 03:09 bwalton Note Added: 0009011
2011-04-28 11:18 ja Note Added: 0009012
2011-04-30 03:38 bwalton Note Added: 0009017
2011-05-02 22:20 bwalton Note Added: 0009020
2011-05-07 18:55 ja Note Added: 0009026
2011-05-07 22:39 bwalton Note Added: 0009027
2011-05-08 13:58 ja Note Added: 0009031
2011-05-15 15:40 bwalton Note Added: 0009054
2011-05-15 15:40 bwalton Status assigned => closed
2011-05-15 15:40 bwalton Resolution open => fixed

Notes
(0006589)
bonivart   
2009-08-19 09:52   
Maybe it can be done by allowing multiple groups separated by commas:

user:group1,group2,group3:gcos:dir:shell:create_dir:remove_dir

Group1 in the example would be primary and the rest secondary.
(0009011)
bwalton   
2011-04-28 03:09   
How about extending the field list to:

user:group:gcos:dir:shell:create_dir:remove_dir:pw:aux_grp1,aux_grp2

The aux_grp1,aux_grp2 list could be fed to useradd -G...? (Maybe a second call to usermod -G if [ -n "$9" ]...

Should be a fairly quick addition. Is this still desired?
(0009012)
ja   
2011-04-28 11:18   
Yes, at least I would use it.

Another point: It could be also nice to alter an arbitrary user. For example the already existing user "nobody" has to be added to group "foo". Is this already possible or should a new feature request be opened for this?
(0009017)
bwalton   
2011-04-30 03:38   
I just proposed the following patch on the devel@ mailing list:
http://lists.opencsw.org/pipermail/devel/2011-April/019015.html [^]

This allows supplying a list of auxiliary groups for a user.

Your other request, extending group membership of an existing user is not possible with the current class action script and I'm not sure an extension is sound. This would likely be better served by a separate script.

Thanks
-Ben
(0009020)
bwalton   
2011-05-02 22:20   
I've placed an experimental package in http://buildfarm.opencsw.org/opencsw/experimental/cswusergroup/. [^] Can you test it with your own packages? It works for my testing with the bacula update.

Thanks
-Ben
(0009026)
ja   
2011-05-07 18:55   
Is it possible to add these auxiliary groups, in case they don't exist?

Thank you
Juergen
(0009027)
bwalton   
2011-05-07 22:39   
In the interest of keeping the script simpler, couldn't the package simply deliver any additional groups referenced by this parameter as unique cswusergroup entries (or files)? That's what I envisioned anyway...I guess it wouldn't be too hard to add on-demand though. Thoughts?

Thanks
-Ben
(0009031)
ja   
2011-05-08 13:58   
Oh, I just wasn't aware of this. Of course it's possible to deliver additional groups.

So, the current solution to add a user to more than one group works with the experimental package without a problem. Thank you for your effort.

Juergen
(0009054)
bwalton   
2011-05-15 15:40   
Updated package pushed for release. It'll (hopefully) be available shortly.

-Ben