3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
6 .\" Manual: Library Calls
7 .\" Source: Library Calls
10 .TH "SHADOW" "3" "07/24/2009" "Library Calls" "Library Calls"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
16 .\" disable justification (adjust text to left margin only)
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
22 shadow, getspnam \- encrypted password file routines
26 \fI#include <shadow\&.h>\fR
29 \fIstruct spwd *getspent();\fR
32 \fIstruct spwd *getspnam(char\fR
39 \fIvoid endspent();\fR
42 \fIstruct spwd *fgetspent(FILE\fR
46 \fIstruct spwd *sgetspent(char\fR
50 \fIint putspent(struct spwd\fR
64 manipulates the contents of the shadow password file,
65 /etc/shadow\&. The structure in the
74 char *sp_namp; /* user login name */
75 char *sp_pwdp; /* encrypted password */
76 long int sp_lstchg; /* last password change */
77 long int sp_min; /* days until change allowed\&. */
78 long int sp_max; /* days before change required */
79 long int sp_warn; /* days warning for expiration */
80 long int sp_inact; /* days before account inactive */
81 long int sp_expire; /* date when account expires */
82 unsigned long int sp_flag; /* reserved for future use */
90 The meanings of each field are:
100 sp_namp \- pointer to null\-terminated user name
111 sp_pwdp \- pointer to null\-terminated password
122 sp_lstchg \- days since Jan 1, 1970 password was last changed
133 sp_min \- days before which password may not be changed
144 sp_max \- days after which password must be changed
155 sp_warn \- days before password is to expire that user is warned of pending password expiration
166 sp_inact \- days after password expires that account is considered inactive and disabled
177 sp_expire \- days since Jan 1, 1970 when account will be disabled
188 sp_flag \- reserved for future use
197 each return a pointer to a
200 returns the next entry from the file, and
202 returns the next entry from the given stream, which is assumed to be a file of the proper format\&.
204 returns a pointer to a
206 using the provided string as input\&.
208 searches from the current position in the file for an entry matching
215 may be used to begin and end, respectively, access to the shadow password file\&.
221 routines should be used to insure exclusive access to the
225 attempts to acquire a lock using
227 for up to 15 seconds\&. It continues by attempting to acquire a second lock using
229 for the remainder of the initial 15 seconds\&. Should either attempt fail after a total of 15 seconds,
231 returns \-1\&. When both locks are acquired 0 is returned\&.
234 Routines return NULL if no more entries are available or if an error occurs during processing\&. Routines which have
236 as the return value return 0 for success and \-1 for failure\&.
239 These routines may only be used by the superuser as access to the shadow password file is restricted\&.
244 Informacje chronione o użytkownikach\&.