124 lines
2.6 KiB
HTML
124 lines
2.6 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>pwdauth(8)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>pwdauth(8)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
pwdauth - password authentication program
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>/usr/lib/pwdauth</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>Pwdauth</STRONG> is a program that is used by the <STRONG><A HREF="../man3/crypt.3.html">crypt(3)</A></STRONG> function to do the hard
|
|
work. It is a setuid root utility so that it is able to read the shadow
|
|
password file.
|
|
|
|
<STRONG>Pwdauth</STRONG> expects on standard input two null terminated strings, the
|
|
password typed by the user, and the salt. That is, the two arguments of
|
|
the <STRONG>crypt</STRONG> function. The input read in a single read call must be 1024
|
|
characters or less including the nulls. <STRONG>Pwdauth</STRONG> takes one of two actions
|
|
depending on the salt.
|
|
|
|
If the salt has the form "<STRONG>##</STRONG><EM>user</EM>" then the <EM>user</EM> is used to index the
|
|
shadow password file to obtain the encrypted password. The input
|
|
password is encrypted with the one-way encryption function contained
|
|
within <STRONG>pwdauth</STRONG> and compared to the encrypted password from the shadow
|
|
password file. If equal then <STRONG>pwdauth</STRONG> returns the string "<STRONG>##</STRONG><EM>user</EM>" with
|
|
exit code 0, otherwise exit code 2 to signal failure. The string
|
|
"<STRONG>##</STRONG><EM>user</EM>" is also returned if both the shadow password and the input
|
|
password are null strings to allow a password-less login.
|
|
|
|
If the salt is not of the form "<STRONG>##</STRONG><EM>user</EM>" then the password is encrypted
|
|
and the result of the encryption is returned. If salt and password are
|
|
null strings then a null string is returned.
|
|
|
|
The return value is written to standard output as a null terminated
|
|
string of 1024 characters or less including the null.
|
|
|
|
The exit code is 1 on any error.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man3/crypt.3.html">crypt(3)</A></STRONG>, <STRONG><A HREF="../man5/passwd.5.html">passwd(5)</A></STRONG>.
|
|
|
|
|
|
</PRE>
|
|
<H2>NOTES</H2><PRE>
|
|
A password must be checked like in this example:
|
|
|
|
pw_ok = (strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd) == 0);
|
|
|
|
The second argument of crypt must be the entire encrypted password and
|
|
not just the two character salt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
<H2>AUTHOR</H2><PRE>
|
|
Kees J. Bot (kjb@cs.vu.nl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|