After some thinking implement alternative way:if it is impossible

to confirm password, don't tell that s/key required, but
ask for password in anycase. It looks like non-s/key system
from outside.
This commit is contained in:
Andrey A. Chernov 1996-10-18 16:52:33 +00:00
parent d0ec898db5
commit 9fe1a5aaab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19017

View File

@ -11,19 +11,15 @@ int pwok;
{
static char buf[128];
struct skey skey;
char *pass = "";
char *username = pwd ? pwd->pw_name : ":";
char *pass;
int sflag;
/* Attempt an s/key challenge. */
sflag = skeyinfo(&skey, username, buf);
if (!sflag)
sflag = (pwd == NULL || skeyinfo(&skey, pwd->pw_name, buf));
if (!sflag) {
printf("%s\n", buf);
if (!pwok) {
printf("(s/key required)\n");
if (sflag)
return (pass);
if (!pwok)
printf("(s/key required)\n");
}
pass = getpass(prompt);