Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (g - h) getpwent(3)
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 and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZSECDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zsecdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ysecdll |
SYNOPSIS
#include <pwd.h>
struct passwdgetpwent(void);
DESCRIPTION
The getpwent( ) function returns information about the next user in the user authentication data-
base. The first call to the getpwent( ) function returns information about the first 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 defined in the pwd.h header
file. The structure has the following fields:
pw_name The user login name.
pw_passwd The user’s 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 fields are provided for compatibility
with some versions of UNIX, but these fields always contain null strings.
Database Structure and Access
Traditional UNIX implementations access user and group information by sequentially reading
unstructured files. In contrast, an HP NonStop server node stores user and group information in
structured, key-sequenced, Enscribe files. User information is accessed using a primary or alter-
nate key. A username or user ID can be specified 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 satisfies 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.
527187-017 Hewlett-Packard Company 3117