DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

passwd(FP)


passwd -- password entry structure

Syntax

#include <pwd.h>

Description

The passwd structure contains the following fields:

Member Description  
char *pw_name; /* login name */
char *pw_passwd; /* password */
uid_t pw_uid; /* user ID */
short __pad1; /* padded space */
gid_t pw_gid; /* group ID */
short __pad2; /* padded space */
char *pw_age; /* age of pw_passwd */
char *pw_comment; /* user information */
char *pw_gecos; /* historical field */
char *pw_dir; /* user's login directory */
char *pw_shell; /* user's login shell */

 +------------------+---------------------------+-----------------+
 |Member            | Description               |                 |
 +------------------+---------------------------+-----------------+
 |char *pw_name;    | /* login name             | */              |
 +------------------+---------------------------+-----------------+
 |char *pw_passwd;  | /* password               | */              |
 +------------------+---------------------------+-----------------+
 |uid_t pw_uid;     | /* user ID                | */              |
 +------------------+---------------------------+-----------------+
 |short __pad1;     | /* padded space           | */              |
 +------------------+---------------------------+-----------------+
 |gid_t pw_gid;     | /* group ID               | */              |
 +------------------+---------------------------+-----------------+
 |short __pad2;     | /* padded space           | */              |
 +------------------+---------------------------+-----------------+
 |char *pw_age;     | /* age of pw_passwd       | */              |
 +------------------+---------------------------+-----------------+
 |char *pw_comment; | /* user information       | */              |
 +------------------+---------------------------+-----------------+
 |char *pw_gecos;   | /* historical field       | */              |
 +------------------+---------------------------+-----------------+
 |char *pw_dir;     | /* user's login directory | */              |
 +------------------+---------------------------+-----------------+
 |char *pw_shell;   | /* user's login shell     | */              |
 +------------------+---------------------------+-----------------+

/etc/passwd entries

The information in the passwd structure is used to create an entry in the /etc/passwd that is parsed with the fgetpwent(S) routine. Each member in the structure in which data is present is placed in the password file entry separated by colons, as shown in this example:
   rufusf:*:203:50:Rufus T. Firefly:/usr/rufusf:/bin/sh
In this case, the members shown are, respectively, pw_name, pw_passwd, pw_uid, pw_gid, pw_comment, pw_dir, and pw_shell. When an asterisk is present in the pw_passwd member, the password is handled by a security scheme. Refer to System Administration Guide for more information on password security.

The full length of an /etc/passwd entry cannot exceed BUFSIZ characters.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003