NAME
CfgTie::TieGroup -- an associative array of group names and ids to information
SYNOPSIS
Makes the groups database available as regular hash
tie %group,'CfgTie::TieGroup'
$group{'myfriends'}=['jonj', @{$group{'myfriends'}];
or
tie %group,'CfgTie::TieGroup', 'mygroupfile'
DESCRIPTION
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
Ties
There are two ties available for programmers:
tie %group,'CfgTie::TieGroup'
-
$group{$name}
will return a hash reference of the named group information. tie %group_id,'CfgTie::Group_id'
-
$group_id{$id}
will return a HASH reference for the specified group.
Structure of hash
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.
Additional Routines
(tied %MyHash)-
files()>-
Returns a list of files employed.
&CfgTie::TieGroup'status()
&CfgTie::TieGroup_id'status()
-
Will return
stat
information on the group database.
Miscellaneous
$CfgTie::TieGroup_rec'groupmod
contains the path to the program groupmod. This can be modified as required.
$CfgTie::TieGroup_rec'groupadd
contains the path to the program groupadd. This can be modified as required.
$CfgTie::TieGroup_rec'groupdel
contains the path to the program groupdel. This can be modified as required.
Files
/etc/passwd /etc/group /etc/gshadow /etc/shadow
See Also
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)
Caveats
The current version does cache some group information.
Author
Randall Maas (mailto:randym@acm.org, http://www.hamline.edu/~rcmaas/)