3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
6 .\" Manual: Library Calls
7 .\" Source: Library Calls
10 .TH "SHADOW" "3" "02/16/2011" "Library Calls" "Library Calls"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 shadow, getspnam \- encrypted password file routines
35 \fI#include <shadow\&.h>\fR
38 \fIstruct spwd *getspent();\fR
41 \fIstruct spwd *getspnam(char\fR
48 \fIvoid endspent();\fR
51 \fIstruct spwd *fgetspent(FILE\fR
55 \fIstruct spwd *sgetspent(char\fR
59 \fIint putspent(struct spwd\fR
73 manipulates the contents of the shadow password file,
74 /etc/shadow\&. The structure in the
83 char *sp_namp; /* user login name */
84 char *sp_pwdp; /* encrypted password */
85 long int sp_lstchg; /* last password change */
86 long int sp_min; /* days until change allowed\&. */
87 long int sp_max; /* days before change required */
88 long int sp_warn; /* days warning for expiration */
89 long int sp_inact; /* days before account inactive */
90 long int sp_expire; /* date when account expires */
91 unsigned long int sp_flag; /* reserved for future use */
99 The meanings of each field are:
109 sp_namp \- pointer to null\-terminated user name
120 sp_pwdp \- pointer to null\-terminated password
131 sp_lstchg \- days since Jan 1, 1970 password was last changed
142 sp_min \- days before which password may not be changed
153 sp_max \- days after which password must be changed
164 sp_warn \- days before password is to expire that user is warned of pending password expiration
175 sp_inact \- days after password expires that account is considered inactive and disabled
186 sp_expire \- days since Jan 1, 1970 when account will be disabled
197 sp_flag \- reserved for future use
206 each return a pointer to a
209 returns the next entry from the file, and
211 returns the next entry from the given stream, which is assumed to be a file of the proper format\&.
213 returns a pointer to a
215 using the provided string as input\&.
217 searches from the current position in the file for an entry matching
224 may be used to begin and end, respectively, access to the shadow password file\&.
230 routines should be used to insure exclusive access to the
234 attempts to acquire a lock using
236 for up to 15 seconds\&. It continues by attempting to acquire a second lock using
238 for the remainder of the initial 15 seconds\&. Should either attempt fail after a total of 15 seconds,
240 returns \-1\&. When both locks are acquired 0 is returned\&.
243 Routines return NULL if no more entries are available or if an error occurs during processing\&. Routines which have
245 as the return value return 0 for success and \-1 for failure\&.
248 These routines may only be used by the superuser as access to the shadow password file is restricted\&.
253 Informacje chronione o użytkownikach\&.