Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

getpwent(3) Guardian Native C Library Calls Reference Manual
NAME
getpwent - Gets user attribute information from the user database
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSECSRL
G-series native OSS processes: /G/system/sysnn/zsecsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZSECDLL
H-series OSS processes: /G/system/zdllnnn/zsecdll
SYNOPSIS
#include <pwd.h>
struct passwdgetpwent(void);
DESCRIPTION
The getpwent() function returns information about the next user in the user authentication data-
base. The rst call to the getpwent() function returns information about the rst user in the data-
base. Each subsequent call to getpwent() returns information for the next user entry, unless an
intervening call to the setpwent() function has reset the entry pointer to the beginning of the
database.
User Structure
The user passwd structure returned by the getpwent() function is dened in the pwd.h header
le. The structure has the following elds:
pw_name The user login name.
pw_passwd The users current password (not returned).
pw_uid The user ID of the user.
pw_gid The group ID of the primary group of the user.
pw_age The password aging string (not returned).
pw_comment Comment string (not returned).
pw_gecos Personal information about the user (not returned).
pw_dir The home directory of the user.
pw_shell The initial program for the user.
The pw_passwd, pw_age, pw_comment, and pw_gecos elds are provided for compatibility
with some versions of UNIX, but these elds always contain null strings.
Database Structure and Access
Traditional UNIX implementations access user and group information by sequentially reading
unstructured les. In contrast, an HP NonStop server node stores user and group information in
structured, key-sequenced, Enscribe les. User information is accessed using a primary or alter-
nate key. A username or user ID can be specied as a key.
Sequential access to user information is supported by storing the most recently used key in static
storage. The setpwent() function resets this key. The endpwent( ) function satises references
when linking user applications.
OSS user authentication database functions do not leave the database open between calls.
Authentication records for user aliases follow regular user authentication records in the database.
330 Hewlett-Packard Company 527192-007