in reply to To get the secondary groups for linux
Update:use POSIX qw(getgroups); # get list of the current groups for this process my @gidlist=getgroups(); # you'd have to translate numeric gid's to # the names here
Here's another shot at getting secondary groups, this one from the id command in the Perl Power Tools project:
while ( my($name,$pw,$gid,$members) = getgrent ) { push(@rgids,$gid) if ( grep($_ eq $user,split(/\s+/,$members)) ); }
|
|---|