group File Format group
Group file format
The group file /etc/group describes the user groups that have
been defined on your COHERENT system. This allows users to con-
trol the access that members of their group have to certain
files. /etc/group contains the information to map any ASCII
group name to the corresponding numerical group identifier, and
vice versa. It also contains, in ASCII, the names of the members
of each group. This information is used by, among others, the
command newgrp.
Each group has an entry in the file /etc/group one line per
entry. Each line consists of four colon-separated ASCII fields,
as follows:
group_name : password : group_number : member[,member...]
Passwords are encrypted with crypt, so the group file is gener-
ally readable.
The COHERENT system has five system calls that manipulate
/etc/group, as follows:
endgrent
Close /etc/group.
getgrent
Return the next entry from /etc/group.
getgrnam
Return the first entry with a given group name.
getgrgid
Return the first entry with a given group identifier.
setgrent
Rewind /etc/group, so that searches can begin again from the
beginning of the file.
The calls getgrent, getgrid, and getgrnam each return a pointer
to structure group, which is defined in the header file grp.h as
follows:
struct group {
char *gr_name; /* Group name */
char *gr_passwd; /* Group password */
int gr_gid; /* Numeric group id */
char **gr_mem; /* Group members */
};
COHERENT Lexicon Page 1
group File Format group
***** Files *****
/etc/group
***** See Also *****
chgrp(), crypt(), endgrent(), file formats, getgrent(),
getgrgid(), getgrnam(), grp.h, newgrp, passwd, setgrend()
***** Notes *****
At present the group password field cannot be set directly (no
command similar to passwd exists for groups). One alternative is
to set the password in the /etc/passwd file for a user with the
passwd command, and then transcribe the password into the group
file manually.
COHERENT Lexicon Page 2