Use `verify_unix_user'

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@561 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-06-05 08:21:49 +00:00
parent 35f4cd6e66
commit c5212baa23

View File

@@ -521,21 +521,6 @@ countdown(XtPointer _t, XtIntervalId *_d)
return; return;
} }
static int
verify_unix(char *user, char *password)
{
struct passwd *pw;
pw = k_getpwnam(user);
if(pw == NULL)
return -1;
if(strlen(pw->pw_passwd) == 0 && strlen(password) == 0)
return 0;
if(strcmp(crypt(password, pw->pw_passwd), pw->pw_passwd) == 0)
return 0;
return -1;
}
static int static int
verify(char *password) verify(char *password)
{ {
@@ -545,7 +530,7 @@ verify(char *password)
* First try with root password, if allowed. * First try with root password, if allowed.
*/ */
if(appres.accept_root && verify_unix("root", password) == 0) if(appres.accept_root && verify_unix_user("root", password) == 0)
return 0; return 0;
/* /*
* Password that log out user * Password that log out user
@@ -582,7 +567,7 @@ verify(char *password)
/* /*
* Try to verify as user. * Try to verify as user.
*/ */
if(verify_unix(name, password) == 0) if(verify_unix_user(name, password) == 0)
return 0; return 0;
return -1; return -1;
} }