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

getpwnam(3) Guardian Native C Library Calls Reference Manual
NAME
getpwnam - 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 <sys/types.h> /* optional except for POSIX.1 */
#include <pwd.h>
struct passwd getpwnam(
const char name
);
PARAMETERS
name Species the username of the user whose user attributes are to be returned.
DESCRIPTION
The getpwnam() function returns information about a user from the user authentication database
when the pw_name eld in the database entry matches the username specied by the name
parameter.
User Structure
The user passwd structure returned by the getpwnam( ) function is dened in the pwd.h header
le. The structure contains the following elds:
pw_name The user login name.
pw_passwd The current user 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.
332 Hewlett-Packard Company 527192-007