summaryrefslogtreecommitdiffstats
path: root/lib/libskey/skey_getpass.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-10-18 16:52:33 +0000
committerache <ache@FreeBSD.org>1996-10-18 16:52:33 +0000
commitbbb4755eb58279613ded5dab75419ab87b148e0a (patch)
tree8a28663b34810fbd22724f757503c9ab8c68ae5b /lib/libskey/skey_getpass.c
parent009be03b7bb0c0761f5714d654f6b86f13da9197 (diff)
downloadFreeBSD-src-bbb4755eb58279613ded5dab75419ab87b148e0a.zip
FreeBSD-src-bbb4755eb58279613ded5dab75419ab87b148e0a.tar.gz
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.
Diffstat (limited to 'lib/libskey/skey_getpass.c')
-rw-r--r--lib/libskey/skey_getpass.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libskey/skey_getpass.c b/lib/libskey/skey_getpass.c
index 51b564b..9878a5e 100644
--- a/lib/libskey/skey_getpass.c
+++ b/lib/libskey/skey_getpass.c
@@ -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);
OpenPOWER on IntegriCloud