CfgTie::TieGroup -- an associative array of group names and ids to information
Makes the groups database available as regular hash
tie %group,'CfgTie::TieGroup' $group{'myfriends'}=['jonj', @{$group{'myfriends'}];
or
tie %group,'CfgTie::TieGroup', 'mygroupfile'
This is a straight forward hash tie that allows us to access the user group database sanely.
It cross ties with the user package and the mail packages
There are two ties available for programmers:
tie %group,'CfgTie::TieGroup'
$group{$name} will return a hash reference of the named group information.
$group{$name}
tie %group_id,'CfgTie::Group_id'
$group_id{$id} will return a HASH reference for the specified group.
$group_id{$id}
Any given group entry has the following information assoicated with it:
name
id
members
A list reference to all of the users that are part of this group.
_members
A list reference to all of the users that are explicitly listed in the /etc/group file.
Plus an (probably) obsolete fields:
Password
This is the encrypted password, but will probably be obsolete.
Each of these entries can be modified (even deleted), and they will be reflected in the overall system. Additionally, the programmer can set any other associated key, but this information will only be available to a running Perl script.
(tied %MyHash)-
Returns a list of files employed.
&CfgTie::TieGroup'status()
&CfgTie::TieGroup_id'status()
Will return stat information on the group database.
stat
$CfgTie::TieGroup_rec'groupmod contains the path to the program groupmod. This can be modified as required.
$CfgTie::TieGroup_rec'groupmod
$CfgTie::TieGroup_rec'groupadd contains the path to the program groupadd. This can be modified as required.
$CfgTie::TieGroup_rec'groupadd
$CfgTie::TieGroup_rec'groupdel contains the path to the program groupdel. This can be modified as required.
$CfgTie::TieGroup_rec'groupdel
/etc/passwd /etc/group /etc/gshadow /etc/shadow
CfgTie::Cfgfile, CfgTie::TieAliases, CfgTie::TieGeneric, CfgTie::TieHost, CfgTie::TieMTab, CfgTie::TieNamed, CfgTie::TieNet, CfgTie::TiePh, CfgTie::TieProto, CfgTie::TieRCService, CfgTie::TieRsrc, CfgTie::TieServ, CfgTie::TieShadow, CfgTie::TieUser
group(5), passwd(5), shadow(5), groupmod(8), groupadd(8), groupdel(8)
The current version does cache some group information.
Randall Maas (mailto:randym@acm.org, http://www.hamline.edu/~rcmaas/)
To install Secure::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Secure::File
CPAN shell
perl -MCPAN -e shell install Secure::File
For more information on module installation, please visit the detailed CPAN module installation guide.