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