OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / getspnam.3
index 10c54bf..eab6d6a 100644 (file)
@@ -1,9 +1,11 @@
 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) and
 .\" Walter Harms (walter.harms@informatik.uni-oldenburg.de)
 .\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
 .\" Distributed under GPL
+.\" %%%LICENSE_END
 .\"
-.TH GETSPNAM 3  2010-02-25 "GNU" "Linux Programmer's Manual"
+.TH GETSPNAM 3  2015-01-22 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getspnam, getspnam_r, getspent, getspent_r, setspent, endspent,
 fgetspent, fgetspent_r, sgetspent, sgetspent_r, putspent,
@@ -22,11 +24,11 @@ lckpwdf, ulckpwdf \- get shadow password file entry
 .sp
 .B void endspent(void);
 .sp
-.BI "struct spwd *fgetspent(FILE *" fp );
+.BI "struct spwd *fgetspent(FILE *" stream );
 .sp
 .BI "struct spwd *sgetspent(const char *" s );
 .sp
-.BI "int putspent(struct spwd *" p ", FILE *" fp );
+.BI "int putspent(const struct spwd *" p ", FILE *" stream );
 .sp
 .B int lckpwdf(void);
 .sp
@@ -44,7 +46,7 @@ lckpwdf, ulckpwdf \- get shadow password file entry
 .br
 .BI "        char *" buf ", size_t " buflen ", struct spwd **" spbufp );
 .sp
-.BI "int fgetspent_r(FILE *" fp ", struct spwd *" spbuf ,
+.BI "int fgetspent_r(FILE *" stream ", struct spwd *" spbuf ,
 .br
 .BI "        char *" buf ", size_t " buflen ", struct spwd **" spbufp );
 .sp
@@ -86,7 +88,7 @@ the traditional password database
 .BR getpwnam (3)
 and
 .BR getpwent (3)).
-.\" FIXME I've commented out the following for the
+.\" FIXME I've commented out the following for the
 .\" moment.  The relationship between PAM and nsswitch.conf needs
 .\" to be clearly documented in one place, which is pointed to by
 .\" the pages for the user, group, and shadow password functions.
@@ -135,8 +137,8 @@ The
 function writes the contents of the supplied struct
 .I spwd
 .I *p
-as a text line in the shadow password file format to the stream
-.IR fp .
+as a text line in the shadow password file format to
+.IR stream .
 String entries with value NULL and numerical entries with value \-1
 are written as an empty string.
 .LP
@@ -159,7 +161,7 @@ These were the functions that formed the original shadow API.
 They are widely available.
 .\" Also in libc5
 .\" SUN doesn't have sgetspent()
-.SS "Reentrant versions"
+.SS Reentrant versions
 Analogous to the reentrant functions for the password database, glibc
 also has reentrant functions for the shadow password database.
 The
@@ -195,25 +197,29 @@ The shadow password structure is defined in \fI<shadow.h>\fP as follows:
 struct spwd {
     char *sp_namp;     /* Login name */
     char *sp_pwdp;     /* Encrypted password */
-    long  sp_lstchg;   /* Date of last change (measured
-                          in days since 1970-01-01 00:00:00 +0000 (UTC)) */
+    long  sp_lstchg;   /* Date of last change
+                          (measured in days since
+                          1970-01-01 00:00:00 +0000 (UTC)) */
     long  sp_min;      /* Min # of days between changes */
     long  sp_max;      /* Max # of days between changes */
     long  sp_warn;     /* # of days before password expires
                           to warn user to change it */
     long  sp_inact;    /* # of days after password expires
                           until account is disabled */
-    long  sp_expire;   /* Date when account expires (measured
-                          in days since 1970-01-01 00:00:00 +0000 (UTC)) */
+    long  sp_expire;   /* Date when account expires
+                          (measured in days since
+                          1970-01-01 00:00:00 +0000 (UTC)) */
     unsigned long sp_flag;  /* Reserved */
 };
 .fi
 .in
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 The functions that return a pointer return NULL if no more entries
 are available or if an error occurs during processing.
 The functions which have \fIint\fP as the return value return 0 for
-success and \-1 for failure.
+success and \-1 for failure, with
+.I errno
+set to indicate the cause of the error.
 .LP
 For the nonreentrant functions, the return value may point to static area,
 and may be overwritten by subsequent calls to these functions.
@@ -222,6 +228,9 @@ The reentrant functions return zero on success.
 In case of error, an error number is returned.
 .SH ERRORS
 .TP
+.B EACCES
+The caller does not have permission to access the shadow password file.
+.TP
 .B ERANGE
 Supplied buffer is too small.
 .SH FILES
@@ -237,12 +246,21 @@ The include file
 defines the constant
 .B _PATH_SHADOW
 to the pathname of the shadow password file.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 The shadow password database and its associated API are
 not specified in POSIX.1-2001.
 However, many other systems provide a similar API.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR getgrnam (3),
 .BR getpwnam (3),
 .BR getpwnam_r (3),
 .BR shadow (5)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.