2007-10-07 17:16:07 +05:30
|
|
|
|
.\" $Id: shadow.3,v 1.5 2005/04/05 18:47:51 kloczek Exp $
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.\" Copyright 1989 - 1993, Julianne Frances Haugh
|
|
|
|
|
.\" All rights reserved.
|
|
|
|
|
.\"
|
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
|
.\" are met:
|
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
|
.\" 3. Neither the name of Julianne F. Haugh nor the names of its contributors
|
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
|
.\"
|
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
|
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
|
.TH SHADOW 3
|
|
|
|
|
.SH NAZWA
|
|
|
|
|
shadow \- procedury zakodowanego pliku hase<73>
|
|
|
|
|
.SH SK<EFBFBD>ADNIA
|
|
|
|
|
.B #include <shadow.h>
|
|
|
|
|
.PP
|
|
|
|
|
.B struct spwd *getspent();
|
|
|
|
|
.PP
|
|
|
|
|
.B struct spwd *getspnam(char
|
|
|
|
|
.IB *name );
|
|
|
|
|
.PP
|
|
|
|
|
.B void setspent();
|
|
|
|
|
.PP
|
|
|
|
|
.B void endspent();
|
|
|
|
|
.PP
|
|
|
|
|
.B struct spwd *fgetspent(FILE
|
|
|
|
|
.IB *fp );
|
|
|
|
|
.PP
|
|
|
|
|
.B struct spwd *sgetspent(char
|
|
|
|
|
.IB *cp );
|
|
|
|
|
.PP
|
|
|
|
|
.B int putspent(struct spwd
|
|
|
|
|
.I *p,
|
|
|
|
|
.B FILE
|
|
|
|
|
.IB *fp );
|
|
|
|
|
.PP
|
|
|
|
|
.B int lckpwdf();
|
|
|
|
|
.PP
|
|
|
|
|
.B int ulckpwdf();
|
|
|
|
|
.SH OPIS
|
|
|
|
|
.I shadow
|
|
|
|
|
operuje na zawarto<74>ci dodatkowego pliku hase<73> (shadow) \fI/etc/shadow\fR.
|
|
|
|
|
Plik \fI#include\fR opisuje struktur<75>
|
|
|
|
|
.sp
|
|
|
|
|
struct spwd {
|
|
|
|
|
.in +.4i
|
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
char *sp_namp; /* nazwa u<>ytkownika (login) */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
char *sp_pwdp; /* zakodowane has<61>o */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
long int sp_lstchg; /* ostatnia zmiana has<61>a */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
long int sp_min; /* dni do dozwolonej zmiany */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
long int sp_max; /* dni przed wymagan<61> zmian<61> */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
long int sp_warn; /* dni ostrze<7A>enia o wyga<67>ni<6E>ciu */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
long int sp_inact; /* dni przed wy<77><79>czeniem konta */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
long int sp_expire; /* data wa<77>no<6E>ci konta */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:15:23 +05:30
|
|
|
|
unsigned long int sp_flag; /* zarezerwowane do przysz<73>ego u<>ytku */
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.br
|
2007-10-07 17:16:07 +05:30
|
|
|
|
.in \-.5i
|
2007-10-07 17:14:44 +05:30
|
|
|
|
}
|
|
|
|
|
.PP
|
|
|
|
|
Znaczenie poszczeg<65>lnych p<>l:
|
|
|
|
|
.sp
|
|
|
|
|
sp_namp \- wska<6B>nik do zako<6B>czonej przez nul nazwy u<>ytkownika.
|
|
|
|
|
.br
|
|
|
|
|
sp_pwdp \- wska<6B>nik do zako<6B>czonego nul has<61>a.
|
|
|
|
|
.br
|
|
|
|
|
sp_lstchg \- dni od 1 stycznia 1970; data ostatniej zmiany has<61>a.
|
|
|
|
|
.br
|
|
|
|
|
sp_min \- dni, przed up<75>ywem kt<6B>rych has<61>o nie mo<6D>e by<62> zmienione.
|
|
|
|
|
.br
|
|
|
|
|
sp_max \- dni, po kt<6B>rych has<61>o musi by<62> zmienione.
|
|
|
|
|
.br
|
|
|
|
|
sp_warn \- dni przed dat<61> up<75>ywu wa<77>no<6E>ci has<61>a, od kt<6B>rych
|
|
|
|
|
u<EFBFBD>ytkownik jest ostrzegany od nadchodz<64>cym terminie wa<77>no<6E>ci.
|
|
|
|
|
.br
|
|
|
|
|
sp_inact \- dni po up<75>yni<6E>ciu wa<77>no<6E>ci konta, po kt<6B>rych konto jest
|
|
|
|
|
uwa<EFBFBD>ane za nieaktywne i wy<77><79>czane.
|
|
|
|
|
.br
|
|
|
|
|
sp_expire \- dni od 1 stycznia 1970, data gdy konto zostanie
|
|
|
|
|
wy<EFBFBD><EFBFBD>czone.
|
|
|
|
|
.br
|
|
|
|
|
sp_flag \- zarezerwowane do przysz<73>ego u<>ytku.
|
|
|
|
|
.SH OPIS
|
|
|
|
|
\fBgetspent\fR, \fBgetspname\fR, \fBfgetspent\fR i \fBsgetspent\fR
|
|
|
|
|
zwracaj<EFBFBD> wska<6B>nik do \fBstruct spwd\fR.
|
|
|
|
|
\fBgetspent\fR zwraca nast<73>pn<70> pozycj<63> w pliku, za<7A> \fBfgetspent\fR
|
|
|
|
|
nast<EFBFBD>pn<EFBFBD> pozycj<63> z podanego strumienia. Zak<61>ada si<73>, <20>e strumie<69>
|
|
|
|
|
ten jest plikiem o poprawnym formacie.
|
|
|
|
|
\fBsgetspent\fR zwraca wska<6B>nik do \fBstruct spwd\fR u<>ywaj<61>c jako
|
|
|
|
|
wej<EFBFBD>cia dostarczonego <20>a<EFBFBD>cucha.
|
|
|
|
|
\fBgetspnam\fR wyszukuje od bie<69><65>cej pozycji w pliku pozycji pasuj<75>cej
|
|
|
|
|
do \fBname\fR.
|
|
|
|
|
.PP
|
|
|
|
|
\fBsetspent\fR i \fBendspent\fR mog<6F> zosta<74> u<>yte do odpowiednio,
|
|
|
|
|
rozpocz<EFBFBD>cia i zako<6B>czenia dost<73>pu do chronionego pliku hase<73> (shadow).
|
|
|
|
|
.PP
|
|
|
|
|
Do zapewnienia wy<77><79>cznego dost<73>pu do pliku \fI/etc/shadow\fR powinny
|
|
|
|
|
by<EFBFBD> u<>ywane procedury \fBlckpwdf\fR i \fBulckpwdf\fR.
|
|
|
|
|
\fBlckpwdf\fR przez 15 sekund usi<73>uje uzyska<6B> blokad<61> przy pomocy
|
|
|
|
|
\fBpw_lock\fR.
|
|
|
|
|
Kontynuuje pr<70>b<EFBFBD> uzyskania drugiej blokady przy pomocy \fBspw_lock\fR
|
|
|
|
|
przez czas pozosta<74>y z pocz<63>tkowych 15 sekund.
|
|
|
|
|
Je<EFBFBD>eli po up<75>ywie 15 sekund kt<6B>rakolwiek z tych pr<70>b zawiedzie,
|
2007-10-07 17:16:07 +05:30
|
|
|
|
to \fBlckpwdf\fR zwraca \-1.
|
2007-10-07 17:14:44 +05:30
|
|
|
|
Je<EFBFBD>eli uzyskano obie blokady, to zwracane jest 0.
|
|
|
|
|
.SH DIAGNOSTYKA
|
|
|
|
|
Je<EFBFBD>eli nie ma dalszych pozycji lub podczas przetwarzania pojawi si<73> b<><62>d,
|
|
|
|
|
to procedury zwracaj<61> NULL.
|
|
|
|
|
Procedury zwracaj<61>ce warto<74><6F> typu \fBint\fR zwracaj<61> 0 w przypadku powodzenia
|
2007-10-07 17:16:07 +05:30
|
|
|
|
a \-1 dla pora<72>ki.
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.SH PRZESTROGI
|
|
|
|
|
Procedury te mog<6F> by<62> u<>ywane wy<77><79>cznie przez superu<72>ytkownika, gdy<64> dost<73>p
|
|
|
|
|
do dodatkowego, chronionego pliku hase<73> jest ograniczony.
|
|
|
|
|
.SH PLIKI
|
2007-10-07 17:16:07 +05:30
|
|
|
|
.IR /etc/shadow " \- zakodowane has<61>a u<>ytkownik<69>w"
|
2007-10-07 17:14:44 +05:30
|
|
|
|
.SH ZOBACZ TAK<EFBFBD>E
|
|
|
|
|
.BR getpwent (3),
|
|
|
|
|
.BR shadow (5)
|
|
|
|
|
.SH AUTOR
|
|
|
|
|
Julianne Frances Haugh (jockgrrl@ix.netcom.com)
|