tizen 2.0
[external/shadow.git] / man / pl / shadow.3
1 '\" t
2 .\"     Title: shadow
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
5 .\"      Date: 07/24/2009
6 .\"    Manual: Library Calls
7 .\"    Source: Library Calls
8 .\"  Language: Polish
9 .\"
10 .TH "SHADOW" "3" "07/24/2009" "Library Calls" "Library Calls"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "NAZWA"
22 shadow, getspnam \- encrypted password file routines
23 .SH "SK\(/LADNIA"
24 .PP
25
26 \fI#include <shadow\&.h>\fR
27 .PP
28
29 \fIstruct spwd *getspent();\fR
30 .PP
31
32 \fIstruct spwd *getspnam(char\fR
33 \fI*name\fR\fI);\fR
34 .PP
35
36 \fIvoid setspent()\fR
37 .PP
38
39 \fIvoid endspent();\fR
40 .PP
41
42 \fIstruct spwd *fgetspent(FILE\fR
43 \fI*fp\fR\fI);\fR
44 .PP
45
46 \fIstruct spwd *sgetspent(char\fR
47 \fI*cp\fR\fI);\fR
48 .PP
49
50 \fIint putspent(struct spwd\fR
51 \fI*p,\fR
52 \fIFILE\fR
53 \fI*fp\fR\fI);\fR
54 .PP
55
56 \fIint lckpwdf();\fR
57 .PP
58
59 \fIint ulckpwdf();\fR
60 .SH "OPIS"
61 .PP
62
63 \fIshadow\fR
64 manipulates the contents of the shadow password file,
65 /etc/shadow\&. The structure in the
66 \fI#include\fR
67 file is:
68 .sp
69 .if n \{\
70 .RS 4
71 .\}
72 .nf
73 struct spwd {
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 */
83 }
84     
85 .fi
86 .if n \{\
87 .RE
88 .\}
89 .PP
90 The meanings of each field are:
91 .sp
92 .RS 4
93 .ie n \{\
94 \h'-04'\(bu\h'+03'\c
95 .\}
96 .el \{\
97 .sp -1
98 .IP \(bu 2.3
99 .\}
100 sp_namp \- pointer to null\-terminated user name
101 .RE
102 .sp
103 .RS 4
104 .ie n \{\
105 \h'-04'\(bu\h'+03'\c
106 .\}
107 .el \{\
108 .sp -1
109 .IP \(bu 2.3
110 .\}
111 sp_pwdp \- pointer to null\-terminated password
112 .RE
113 .sp
114 .RS 4
115 .ie n \{\
116 \h'-04'\(bu\h'+03'\c
117 .\}
118 .el \{\
119 .sp -1
120 .IP \(bu 2.3
121 .\}
122 sp_lstchg \- days since Jan 1, 1970 password was last changed
123 .RE
124 .sp
125 .RS 4
126 .ie n \{\
127 \h'-04'\(bu\h'+03'\c
128 .\}
129 .el \{\
130 .sp -1
131 .IP \(bu 2.3
132 .\}
133 sp_min \- days before which password may not be changed
134 .RE
135 .sp
136 .RS 4
137 .ie n \{\
138 \h'-04'\(bu\h'+03'\c
139 .\}
140 .el \{\
141 .sp -1
142 .IP \(bu 2.3
143 .\}
144 sp_max \- days after which password must be changed
145 .RE
146 .sp
147 .RS 4
148 .ie n \{\
149 \h'-04'\(bu\h'+03'\c
150 .\}
151 .el \{\
152 .sp -1
153 .IP \(bu 2.3
154 .\}
155 sp_warn \- days before password is to expire that user is warned of pending password expiration
156 .RE
157 .sp
158 .RS 4
159 .ie n \{\
160 \h'-04'\(bu\h'+03'\c
161 .\}
162 .el \{\
163 .sp -1
164 .IP \(bu 2.3
165 .\}
166 sp_inact \- days after password expires that account is considered inactive and disabled
167 .RE
168 .sp
169 .RS 4
170 .ie n \{\
171 \h'-04'\(bu\h'+03'\c
172 .\}
173 .el \{\
174 .sp -1
175 .IP \(bu 2.3
176 .\}
177 sp_expire \- days since Jan 1, 1970 when account will be disabled
178 .RE
179 .sp
180 .RS 4
181 .ie n \{\
182 \h'-04'\(bu\h'+03'\c
183 .\}
184 .el \{\
185 .sp -1
186 .IP \(bu 2.3
187 .\}
188 sp_flag \- reserved for future use
189 .RE
190 .SH "OPIS"
191 .PP
192
193 \fIgetspent\fR,
194 \fIgetspname\fR,
195 \fIfgetspent\fR, and
196 \fIsgetspent\fR
197 each return a pointer to a
198 \fIstruct spwd\fR\&.
199 \fIgetspent\fR
200 returns the next entry from the file, and
201 \fIfgetspent\fR
202 returns the next entry from the given stream, which is assumed to be a file of the proper format\&.
203 \fIsgetspent\fR
204 returns a pointer to a
205 \fIstruct spwd\fR
206 using the provided string as input\&.
207 \fIgetspnam\fR
208 searches from the current position in the file for an entry matching
209 \fIname\fR\&.
210 .PP
211
212 \fIsetspent\fR
213 and
214 \fIendspent\fR
215 may be used to begin and end, respectively, access to the shadow password file\&.
216 .PP
217 The
218 \fIlckpwdf\fR
219 and
220 \fIulckpwdf\fR
221 routines should be used to insure exclusive access to the
222 /etc/shadow
223 file\&.
224 \fIlckpwdf\fR
225 attempts to acquire a lock using
226 \fIpw_lock\fR
227 for up to 15 seconds\&. It continues by attempting to acquire a second lock using
228 \fIspw_lock\fR
229 for the remainder of the initial 15 seconds\&. Should either attempt fail after a total of 15 seconds,
230 \fIlckpwdf\fR
231 returns \-1\&. When both locks are acquired 0 is returned\&.
232 .SH "DIAGNOSTYKA"
233 .PP
234 Routines return NULL if no more entries are available or if an error occurs during processing\&. Routines which have
235 \fIint\fR
236 as the return value return 0 for success and \-1 for failure\&.
237 .SH "OSTRZEŻENIA"
238 .PP
239 These routines may only be used by the superuser as access to the shadow password file is restricted\&.
240 .SH "PLIKI"
241 .PP
242 /etc/shadow
243 .RS 4
244 Informacje chronione o użytkownikach\&.
245 .RE
246 .SH "ZOBACZ TAKŻE"
247 .PP
248 \fBgetpwent\fR(3),
249 \fBshadow\fR(5)\&.