summaryrefslogtreecommitdiff
path: root/man/it/man3/shadow.3
blob: 314742131ec74cf398bb51aa5193c84dd89c3923 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
'\" t
.\"     Title: shadow
.\"    Author: Julianne Frances Haugh
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 09/05/2014
.\"    Manual: Chiamate di libreria
.\"    Source: shadow-utils 4.2
.\"  Language: Italian
.\"
.TH "SHADOW" "3" "09/05/2014" "shadow\-utils 4\&.2" "Chiamate di libreria"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NOME"
shadow, getspnam \- routine per file delle password cifrate
.SH "SINTASSI"
.PP
\fI#include <shadow\&.h>\fR
.PP
\fIstruct spwd *getspent();\fR
.PP
\fIstruct spwd *getspnam(char\fR\fI*nome\fR\fI);\fR
.PP
\fIvoid setspent();\fR
.PP
\fIvoid endspent();\fR
.PP
\fIstruct spwd *fgetspent(FILE\fR\fI*fp\fR\fI);\fR
.PP
\fIstruct spwd *sgetspent(char\fR\fI*cp\fR\fI);\fR
.PP
\fIint putspent(struct spwd\fR\fI*p,\fR\fIFILE\fR\fI*fp\fR\fI);\fR
.PP
\fIint lckpwdf();\fR
.PP
\fIint ulckpwdf();\fR
.SH "DESCRIZIONE"
.PP
\fIshadow\fR
manipola il contenuto del file delle password shadow,
/etc/shadow\&. La struttura nel file
\fI#include\fR
\(`e la seguente:
.sp
.if n \{\
.RS 4
.\}
.nf
struct spwd {
      char		*sp_namp; /* login dell\*(Aqutente */
      char		*sp_pwdp; /* password cifrata */
      long int		sp_lstchg; /* ultimo cambio della password */
      long int		sp_min; /* giorni minimi tra i cambi */
      long int		sp_max; /* giorni massimi tra i cambi */
      long int		sp_warn; /* giorni di preavviso */
      long int		sp_inact; /* giorni di inattivit\(`a */
      long int		sp_expire; /* data di scadenza dell\*(Aqaccount */
      unsigned long int	sp_flag; /* riservato per uso futuro */
}
    
.fi
.if n \{\
.RE
.\}
.PP
Ciascun campo significa:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_namp \- puntatore a una stringa null\-terminated che contiene il nome utente\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_pwdp \- puntatore a una stringa null\-terminated che contiene la password\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_lstchg \- giorni trascorsi dal 1 gennaio 1970 al momento in cui la password \(`e stata cambiata l\*(Aqultima volta\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_min \- giorni prima dei quali la password non pu\(`o essere cambiata\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_max \- giorni dopo i quali la password deve essere cambiata\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_warn \- giorni prima della scadenza della password in cui l\*(Aqutente viene avvertito\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_inact \- giorni dopo la scadenza della password dopo i quali l\*(Aqaccount viene considerato inattivo e disabilitato\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_expire \- giorni a partire dal 1 gennaio 1970 dopo i quali l\*(Aqaccount viene disabilitato\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
sp_flag \- riservato per uso futuro\&.
.RE
.SH "DESCRIZIONE"
.PP
\fIgetspent\fR,
\fIgetspname\fR,
\fIfgetspent\fR
e
\fIsgetspent\fR
restituiscono tutte un puntatore a uno
\fIstruct spwd\fR\&.
\fIgetspent\fR
restituisce la voce successiva nel file,
\fIfgetspent\fR
la voce successiva nello stream specificato, che si suppone sia un file nel formato corretto\&.
\fIsgetspent\fR
restituisce un puntatore a uno
\fIstruct spwd\fR
usando come input la stringa fornita\&.
\fIgetspnam\fR
cerca una voce che corrisponde a
\fIname\fR
partendo dalla posizione corrente nel file\&.
.PP
\fIsetspent\fR
e
\fIendspent\fR
sono usate rispettivamente per iniziare e terminare l\*(Aqaccesso al file delle password shadow\&.
.PP
Le funzioni
\fIlckpwdf\fR
e
\fIulckpwdf\fR
si usano per garantire l\*(Aqaccesso esclusivo al file
/etc/shadow\&.
\fIlckpwdf\fR
prova ad acquisire il lock tramite
\fIpw_lock\fR
per un massimo di 15 secondi, dopodich\('e tenta di ottenere un secondo lock usando
\fIspw_lock\fR
per il tempo che rimane dei 15 secondi iniziali\&. Se anche uno solo dei due tentativi fallisce dopo un totale di 15 secondi,
\fIlckpwdf\fR
restituisce \-1, mentre restituisce 0 se riesce ad acquisire entrambi i lock\&.
.SH "DIAGNOSTICA"
.PP
Le funzioni restituiscono NULL se non ci sono altre voci disponibili o se si verifica un errore durante l\*(Aqelaborazione\&. Le funzioni di tipo
\fIint\fR
restituiscono 0 in caso di successo e \-1 in caso di errore\&.
.SH "AVVISI/CAVEAT"
.PP
Queste funzioni possono essere usate solo dall\*(Aqamministratore, perch\('e l\*(Aqaccesso al file delle password shadow \(`e riservato\&.
.SH "FILE"
.PP
/etc/shadow
.RS 4
Informazioni sicure sugli account utente\&.
.RE
.SH "VEDERE ANCHE"
.PP
\fBgetpwent\fR(3),
\fBshadow\fR(5)\&.