diff options
Diffstat (limited to 'lib/libc/gen/getpwent.3')
-rw-r--r-- | lib/libc/gen/getpwent.3 | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/lib/libc/gen/getpwent.3 b/lib/libc/gen/getpwent.3 index 1208f53..6badc19 100644 --- a/lib/libc/gen/getpwent.3 +++ b/lib/libc/gen/getpwent.3 @@ -29,9 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)getpwent.3 8.2 (Berkeley) 12/11/93 +.\" From: @(#)getpwent.3 8.2 (Berkeley) 12/11/93 .\" -.Dd December 11, 1993 +.Dd September 20, 1994 .Dt GETPWENT 3 .Os .Sh NAME @@ -72,14 +72,15 @@ file struct passwd { char *pw_name; /* user name */ char *pw_passwd; /* encrypted password */ - uid_t pw_uid; /* user uid */ - gid_t pw_gid; /* user gid */ + int pw_uid; /* user uid */ + int pw_gid; /* user gid */ time_t pw_change; /* password change time */ char *pw_class; /* user access class */ char *pw_gecos; /* Honeywell login info */ char *pw_dir; /* home directory */ char *pw_shell; /* default shell */ time_t pw_expire; /* account expiration */ + int pw_fields; /* internal: fields filled in */ }; .Ed .Pp @@ -133,6 +134,24 @@ If the process which calls them has an effective uid of 0, the encrypted password will be returned, otherwise, the password field of the returned structure will point to the string .Ql * . +.Sh YP/NIS INTERACTION +When the +.Xr yp 4 +password database is enabled, the +.Fn getpwnam +and +.Fn getpwuid +functions use the YP maps +.Dq Li passwd.byname +and +.Dq Li passwd.byuid , +respectively, if the requested password entry is not found in the +local database. The +.Fn getpwent +function will step through the YP map +.Dq Li passwd.byname +if the entire map is enabled as described in +.Xr passwd 5 . .Sh RETURN VALUES The functions .Fn getpwent , @@ -152,9 +171,9 @@ function has no return value. .Sh FILES .Bl -tag -width /etc/master.passwd -compact -.It Pa /var/db/pwd.db +.It Pa /etc/pwd.db The insecure password database file -.It Pa /var/db/spwd.db +.It Pa /etc/spwd.db The secure password database file .It Pa /etc/master.passwd The current password file @@ -162,25 +181,31 @@ The current password file A Version 7 format password file .El .Sh SEE ALSO -.Xr getlogin 3 , +.Xr getlogin 2 , .Xr getgrent 3 , +.Xr yp 4 , .Xr passwd 5 , .Xr pwd_mkdb 8 , .Xr vipw 8 .Sh HISTORY The -.Nm getpwent , -.Nm getpwnam , -.Nm getpwuid , -.Nm setpwent, +.Fn getpwent , +.Fn getpwnam , +.Fn getpwuid , +.Fn setpwent, and -.Nm endpwent +.Fn endpwent functions appeared in .At v7 . The -.Nm setpassent +.Fn setpassent function appeared in .Bx 4.3 Reno . +.Sh COMPATIBILITY +The historic function +.Xr setpwfile 3 , +which allowed the specification of alternate password databases, +has been deprecated and is no longer available. .Sh BUGS The functions .Fn getpwent , @@ -191,17 +216,3 @@ leave their results in an internal static object and return a pointer to that object. Subsequent calls to the same function will modify the same object. -.Pp -The routines -.Fn getpwent , -.Fn endpwent , -.Fn setpassent , -and -.Fn setpwent -are fairly useless in a networked environment and should be -avoided, if possible. -.Sh COMPATIBILITY -The historic function -.Xr setpwfile 3 , -which allowed the specification of alternate password databases, -has been deprecated and is no longer available. |