passwd(FP) 6 January 1993 passwd(FP) Name passwd - password entry structure Syntax #include <pwd.h> Description The passwd structure contains the following fields for SVID: _________________________________________________________________________ Member Description _________________________________________________________________________ char *pw_name; /* login name */ char *__pw_passwd; /* password */ int pw_uid; /* user ID */ int pw_gid; /* group ID */ 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 */ For XPG3 and POSIX the structure definition is as follows: _________________________________________________________________________ Member Description _________________________________________________________________________ char *pw_name; /* login name */ char *pw_passwd; /* password */ uid_t pw_uid; /* user ID */ short __pad1; /* padded space */ int 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 */ When neither XPG3 or POSIX is defined, the comment field can contain the following information defined in the comment structure: _________________________________________________________________________ Member Description _________________________________________________________________________ char *c_dept; /* user's department */ char *c_name; /* user's name */ char *c_acct; /* user's account */ char *c_bin; /* user's output storage bin ID */ The pwgecos member is interpreted in the same way as the pwcomment member. The acronym ``gecos'' stands for General Electric Comprehensive Operating System. The pwgecos member is used only as a comment. Required fields The SVID (Issue 2) passwd(BA_ENV) routine specifies that only the encrypted password, GID, and shell fields can be empty. XPG2 passwd(4) is identical. Both standards specify that the comment field is implemen- tation specific, as does this implementation of the Development System. Neither POSIX nor XPG3 specifies file formats. In summary: _________________________________________________________________________ SVID-2/ SCO SCO SCO Member XPG2 XENIX 2.2 XENIX 2.3 UNIX _________________________________________________________________________ pw_name r e e e pw_passwd e e e e pw_uid r e r r pw_gid e e r r pw_gecos e e e e pw_dir r e e e pw_shell e e e e (rest) i i i i Where: r = required e = may be empty i = ignored (rest) = Any fields after the login shell pathname None of the standards states whether spaces are allowed in front of the UID or GID, but both SCO UNIX and XENIX 2.3 allow spaces. /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, pwname, pwpasswd, pwuid, pwgid, pwcomment, pwdir, and pwshell. When an asterisk is present in the pwpasswd member, the password is handled by a security scheme. Refer to the System Administrator's Guide for more information on password security. The full length of an /etc/passwd entry cannot exceed BUFSIZ characters.