diff options
author | ume <ume@FreeBSD.org> | 2002-04-16 10:54:30 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2002-04-16 10:54:30 +0000 |
commit | 903c50775a178354bb01ca3e939fc3a8212d981c (patch) | |
tree | 5cf79f3a00c0c071721eb0361340cd03b99a929b /libexec/rexecd | |
parent | 36e818184dc956b728b08afa69445d3710ad0dea (diff) | |
download | FreeBSD-src-903c50775a178354bb01ca3e939fc3a8212d981c.zip FreeBSD-src-903c50775a178354bb01ca3e939fc3a8212d981c.tar.gz |
When opieverify() is fail, fallback to try unix password.
Tested by: kuriyama
Diffstat (limited to 'libexec/rexecd')
-rw-r--r-- | libexec/rexecd/rexecd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index 1d61041..9f6a1ea 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -148,6 +148,7 @@ doit(int f, struct sockaddr *fromp) int pv[2], pid, ready, readfrom, cc; char buf[BUFSIZ], sig; int one = 1; + int authenticated = 0; (void) signal(SIGINT, SIG_DFL); (void) signal(SIGQUIT, SIG_DFL); @@ -211,11 +212,15 @@ doit(int f, struct sockaddr *fromp) if (*pwd->pw_passwd != '\0') { #ifdef OPIE opiechallenge(&opiedata, user, opieprompt); - if (opieverify(&opiedata, pass)) { -#else /* OPIE */ - namep = crypt(pass, pwd->pw_passwd); - if (strcmp(namep, pwd->pw_passwd)) { + if (!opieverify(&opiedata, pass)) + authenticated = 1; #endif /* OPIE */ + if (!authenticated) { + namep = crypt(pass, pwd->pw_passwd); + if (!strcmp(namep, pwd->pw_passwd)) + authenticated = 1; + } + if (!authenticated) { syslog(LOG_ERR, "LOGIN FAILURE from %s, %s", remote, user); error("Login incorrect.\n"); |