Unix::Groups - Perl to support getgroups and setgroups syscalls
getgroups
setgroups
use Unix::Groups qw/:all/; $ngroups_max=NGROUPS_MAX; @gids=getgroups; $success=setgroups(@gids);
This module implements a very thin layer around the getgroups(2) and setgroups(2) syscalls. See your system manual for more information.
Note, the module is written and tested on Linux. For other UNIX-like systems there are good chances that it will work at least if it compiles properly.
returns the max. number of arguments that setgroups will accept.
returns the list of supplementary group IDs of the current process. It is very similar to the $( variable. But $( is a string and its first element is the current effective GID.
$(
sets the list of supplementary group IDs of the current process. On most systems this is a privileged operation. On Linux CAP_SETGID is required.
CAP_SETGID
None by default.
On demand all functions are exported.
export all functions.
Linux manual.
Torsten Förtsch, <torsten.foertsch@gmx.net>
Copyright (C) 2011 by Torsten Foertsch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.
To install Unix::Groups, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Unix::Groups
CPAN shell
perl -MCPAN -e shell install Unix::Groups
For more information on module installation, please visit the detailed CPAN module installation guide.