Replace mention of /etc/{passwd,group} by refernces to

"passwd/group database", and LDAP and NIS.
As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316117

Miscellaneous wording improvements
Consistent DESCRIPTION and ERRORS wording across these pages.
This commit is contained in:
Michael Kerrisk 2005-07-01 16:50:33 +00:00
parent 95b18bae5c
commit f2738b392c
4 changed files with 131 additions and 71 deletions

View File

@ -40,36 +40,45 @@ getgrent, setgrent, endgrent \- get group file entry
.B void endgrent(void);
.fi
.SH DESCRIPTION
The \fBgetgrent()\fP function returns a pointer to a structure containing
the group information from \fI/etc/group\fP. The first time it is called
The \fBgetgrent()\fP
function returns a pointer to a structure containing
the broken-out fields of a record in the group database
(e.g., the local group file
.IR /etc/group ,
NIS, and LDAP).
The first time it is called
it returns the first entry; thereafter, it returns successive entries.
.PP
The \fBsetgrent()\fP function rewinds the file pointer to the beginning
of the \fI/etc/group\fP file.
The \fBsetgrent()\fP function rewinds to the beginning
of the group database, to allow repeated scans.
.PP
The \fBendgrent()\fP function closes the \fI/etc/group\fP file.
The \fBendgrent()\fP function is used to close the group database
after all processing has been performed.
.PP
The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
.sp
.RS
.RS +0.25i
.nf
.ta 8n 16n 32n
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
};
.ta
.fi
.RE
.SH "RETURN VALUE"
The \fBgetgrent()\fP function returns the group information structure,
The \fBgetgrent()\fP function returns a pointer to a
.I group
structure,
or NULL if there are no more entries or an error occurs.
.LP
Upon error,
.I errno
may be set. If you want to check its value, set it to zero before the call.
may be set.
If one wants to check
.I errno
after the call, it should be set to zero before the call.
.SH ERRORS
.TP
.B EINTR
@ -84,13 +93,16 @@ The calling process already has too many open files.
.B ENFILE
Too many open files in the system.
.TP
.\" not in POSIX
.B ENOMEM
.\" not in POSIX
Insufficient memory to allocate group information structure.
.TP
.B ERANGE
Insufficient buffer space supplied.
.SH FILES
.TP
.I /etc/group
group database file
local group database file
.SH "CONFORMING TO"
SVID 3, BSD 4.3, POSIX 1003.1-2003.
.SH "SEE ALSO"

View File

@ -52,27 +52,32 @@ getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry
The
.B getgrnam()
function returns a pointer to a structure containing
the group information from
.I /etc/group
the broken-out fields of a record in the group database
(e.g., the local group file
.IR /etc/group ,
NIS, and LDAP)
for the entry that matches the group name
.IR name .
.PP
The
.B getgrgid()
function returns a pointer to a structure containing
the group information from
.I /etc/group
for the entry that matches the group gid
the broken-out fields of the record in the group database
for the entry that matches the group ID
.IR gid .
.PP
The
.B getgrnam_r()
and
.B getgrgid_r()
functions find the same information, but store the retrieved group structure
functions obtain the same information, but store the retrieved
.I group
structure
in the space pointed to by
.IR gbuf .
This group structure contains pointers to strings, and these strings
This
.I group
structure contains pointers to strings, and these strings
are stored in the buffer
.I buf
of size
@ -83,13 +88,13 @@ was found or an error occurred) is stored in
.PP
The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
.sp
.RS
.RS +0.25i
.nf
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group id */
char **gr_mem; /* group members */
};
.fi
.RE
@ -100,11 +105,14 @@ can be found using
.BR sysconf (3)
with the _SC_GETGR_R_SIZE_MAX parameter.
.SH "RETURN VALUE"
The \fBgetgrnam()\fP and \fBgetgrgid()\fP functions return a pointer
to the group information structure, or NULL if the matching entry
is not found or an error occurs. If an error occurs,
The \fBgetgrnam()\fP and \fBgetgrgid()\fP functions return a pointer to a
.I group
structure, or NULL if the matching entry
is not found or an error occurs.
If an error occurs,
.I errno
is set appropriately. If one wants to check
is set appropriately.
If one wants to check
.I errno
after the call, it should be set to zero before the call.
.LP
@ -116,7 +124,7 @@ or
.BR getgrnam() .
.LP
The \fBgetgrnam_r()\fP and \fBgetgrgid_r()\fP functions return
zero on success. In case of error, an error value is returned.
zero on success. In case of error, an error number is returned.
.SH ERRORS
.TP
.BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... "
@ -139,7 +147,8 @@ The maximum number (OPEN_MAX) of files was open already in the calling process.
The maximum number of files was open already in the system.
.TP
.B ENOMEM
Insufficient memory.
.\" not in POSIX
Insufficient memory to allocate group structure.
.\" to allocate the group structure, or to allocate buffers
.TP
.B ERANGE
@ -147,7 +156,7 @@ Insufficient buffer space supplied.
.SH FILES
.TP
.I /etc/group
group database file
local group database file
.SH "CONFORMING TO"
SVID 3, BSD 4.3, POSIX 1003.1-2003
.SH NOTES

View File

@ -44,41 +44,72 @@ getpwent, setpwent, endpwent \- get password file entry
.fi
.SH DESCRIPTION
The \fBgetpwent()\fP function returns a pointer to a structure containing
the broken out fields of a line from \fI/etc/passwd\fP. The first time it
the broken-out fields of a record from the password database
(e.g., the local password file
.IR /etc/passwd ,
NIS, and LDAP).
The first time it
is called it returns the first entry; thereafter, it returns successive
entries.
.PP
The \fBsetpwent()\fP function rewinds the file pointer to the beginning
of the \fI/etc/passwd\fP file.
The \fBsetpwent()\fP function rewinds to the beginning
of the password database.
.PP
The \fBendpwent()\fP function closes the \fI/etc/passwd\fP file.
The \fBendpwent()\fP function is used to close the password database
after all processing has been performed.
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.RS
.RS 0.25i
.nf
struct passwd {
char *pw_name; /* user name */
char *pw_passwd; /* user password */
uid_t pw_uid; /* user id */
gid_t pw_gid; /* group id */
char *pw_gecos; /* real name */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
char *pw_name; /* user name */
char *pw_passwd; /* user password */
uid_t pw_uid; /* user id */
gid_t pw_gid; /* group id */
char *pw_gecos; /* real name */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
};
.fi
.RE
.SH "RETURN VALUE"
The \fBgetpwent()\fP function returns the \fIpasswd\fP structure, or NULL if
The \fBgetpwent()\fP function returns a pointer to a
.I passwd
structure, or NULL if
there are no more entries or an error occurs.
If an error occurs,
.I errno
is set appropriately.
If one wants to check
.I errno
after the call, it should be set to zero before the call.
.SH ERRORS
.TP
.TP
.B EINTR
A signal was caught.
.TP
.B EIO
I/O error.
.TP
.B EMFILE
The maximum number (OPEN_MAX) of files was open already in the calling process.
.TP
.B ENFILE
The maximum number of files was open already in the system.
.TP
.B ENOMEM
.\" not in POSIX
Insufficient memory to allocate passwd structure.
.\" to allocate the passwd structure, or to allocate buffers
.TP
.B ERANGE
Insufficient buffer space supplied.
.SH FILES
.TP
.I /etc/passwd
password database file
local password database file
.SH "CONFORMING TO"
SVID 3, BSD 4.3
.SH "SEE ALSO"

View File

@ -53,27 +53,31 @@ getpwnam, getpwnam_r, getpwuid, getpwuid_r \- get password file entry
The
.B getpwnam()
function returns a pointer to a structure containing
the broken out fields of a line from
.I /etc/passwd
the broken-out fields of a record in the password database
(e.g., the local password file
.IR /etc/passwd ,
NIS, and LDAP)
for the entry that matches the user name
.IR name .
.PP
The
.B getpwuid()
function returns a pointer to a structure containing
the broken out fields of a line from
.I /etc/passwd
for the entry that matches the user uid
the broken-out fields of the record in the password database
for the entry that matches the user ID
.IR uid .
.PP
The
.B getpwnam_r()
and
.B getpwuid_r()
functions find the same information, but store the retrieved passwd structure
in the space pointed to by
functions obtain the same information, but store the retrieved
.I passwd
structure in the space pointed to by
.IR pwbuf .
This passwd structure contains pointers to strings, and these strings
This
.I passwd
structure contains pointers to strings, and these strings
are stored in the buffer
.I buf
of size
@ -84,16 +88,16 @@ was found or an error occurred) is stored in
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.RS
.RS 0.25i
.nf
struct passwd {
char *pw_name; /* user name */
char *pw_passwd; /* user password */
uid_t pw_uid; /* user id */
gid_t pw_gid; /* group id */
char *pw_gecos; /* real name */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
char *pw_name; /* user name */
char *pw_passwd; /* user password */
uid_t pw_uid; /* user id */
gid_t pw_gid; /* group id */
char *pw_gecos; /* real name */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
};
.fi
.RE
@ -104,11 +108,14 @@ can be found using
.BR sysconf (3)
with the _SC_GETPW_R_SIZE_MAX parameter.
.SH "RETURN VALUE"
The \fBgetpwnam()\fP and \fBgetpwuid()\fP functions return a pointer to
the passwd structure, or NULL if the matching entry is not found or
an error occurs. If an error occurs,
The \fBgetpwnam()\fP and \fBgetpwuid()\fP functions return a pointer to a
.I passwd
structure, or NULL if the matching entry is not found or
an error occurs.
If an error occurs,
.I errno
is set appropriately. If one wants to check
is set appropriately.
If one wants to check
.I errno
after the call, it should be set to zero before the call.
.LP
@ -120,7 +127,7 @@ or
.BR getpwuid() .
.LP
The \fBgetpwnam_r()\fP and \fBgetpwuid_r()\fP functions return
zero on success. In case of error, an error value is returned.
zero on success. In case of error, an error number is returned.
.SH ERRORS
.TP
.BR 0 " or " ENOENT " or " ESRCH " or " EBADF " or " EPERM " or ... "
@ -143,6 +150,7 @@ The maximum number (OPEN_MAX) of files was open already in the calling process.
The maximum number of files was open already in the system.
.TP
.B ENOMEM
.\" not in POSIX
Insufficient memory to allocate passwd structure.
.\" This structure is static, allocated 0 or 1 times. No memory leak. (libc45)
.TP
@ -151,7 +159,7 @@ Insufficient buffer space supplied.
.SH FILES
.TP
.I /etc/passwd
password database file
local password database file
.fi
.SH "CONFORMING TO"
SVID 3, BSD 4.3, POSIX 1003.1-2003