Use {krb,unix}_verify_user.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@700 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -150,7 +150,6 @@ char tmpline[10240];
|
|||||||
char hostname[MaxHostNameLen];
|
char hostname[MaxHostNameLen];
|
||||||
char remotehost[MaxHostNameLen];
|
char remotehost[MaxHostNameLen];
|
||||||
static char ttyline[20];
|
static char ttyline[20];
|
||||||
char *tty = ttyline; /* for klogin */
|
|
||||||
|
|
||||||
/* Default level for security, 0 allow any kind of connection, 1 only
|
/* Default level for security, 0 allow any kind of connection, 1 only
|
||||||
authorized and anonymous connections, 2 only authorized */
|
authorized and anonymous connections, 2 only authorized */
|
||||||
@@ -374,7 +373,7 @@ main(int argc, char **argv)
|
|||||||
debug = 0;
|
debug = 0;
|
||||||
|
|
||||||
/* set this here so klogin can use it... */
|
/* set this here so klogin can use it... */
|
||||||
(void)sprintf(ttyline, "ftp%d", getpid());
|
sprintf(ttyline, "ftp%d", getpid());
|
||||||
|
|
||||||
|
|
||||||
/* (void) freopen(_PATH_DEVNULL, "w", stderr); */
|
/* (void) freopen(_PATH_DEVNULL, "w", stderr); */
|
||||||
@@ -752,18 +751,15 @@ pass(char *passwd)
|
|||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
rval = klogin(pw->pw_name, passwd);
|
{
|
||||||
if (rval == 0)
|
char realm[REALM_SZ];
|
||||||
goto skip;
|
if((rval = krb_get_lrealm(realm, 1)) == KSUCCESS)
|
||||||
|
rval = krb_verify_user(pw->pw_name, "", realm,
|
||||||
/* the strcmp does not catch null passwords! */
|
passwd, 1, NULL);
|
||||||
if (pw == NULL || *pw->pw_passwd == 0 ||
|
|
||||||
strcmp((char*)crypt(passwd, pw->pw_passwd), pw->pw_passwd)){
|
|
||||||
rval = 1; /* failure */
|
|
||||||
goto skip;
|
|
||||||
}
|
}
|
||||||
rval = 0;
|
|
||||||
|
|
||||||
|
if (rval != 0)
|
||||||
|
rval = unix_verify_user(pw->pw_name, passwd);
|
||||||
skip:
|
skip:
|
||||||
/*
|
/*
|
||||||
* If rval == 1, the user failed the authentication check
|
* If rval == 1, the user failed the authentication check
|
||||||
|
Reference in New Issue
Block a user