.TH getspnam() "" "" "General Function (libc)"
.PC "Get a shadow-password record, by user name"
.B "#include <shadow.h>"
\fBstruct spwd *getspnam(\fIuname\^\fB)\fR
\fBchar *\fIuname\^\fB;\fR
.PP
The \*(CO system has four routines that search the shadow-password file
.BR /etc/shadow ,
which contains the password of every user of your system.
.B getspnam()
returns the first entry for the user with a given login identifier.
.I uname
points to the login identifier of the user whose password you wish to retrieve.
.PP
If an error occurs,
.B getspnam()
returns NULL.
Otherwise, it returns the address of an object with the structure
.BR spwd ,
which is defined in the header file
.BR <shadow.h> .
For a description of this structure, see the Lexicon entry for
.BR shadow.h .
.SH Files
.B /etc/shadow
.br
.B shadow.h
.SH "See Also"
.Xr "getspent()," getspent
.Xr "libc," libc
.Xr "shadow," shadow
.Xr "shadow.h" shadow.h
.br
\*(PX Standard, \(sc9.2.2
.SH Notes
All structures and information returned are
in static areas internal to
.BR getspnam() .
Therefore, information from a previous call is overwritten by each
subsequent call.
