From 590b04e0057fe4615a80a60917911727bd24830f Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Thu, 17 Oct 1996 13:43:58 +0000 Subject: [PATCH] If 1) regular Unix passwords not permitted and 2) skey database for this user not activated, there no correct password exist, so don't bother ask for it and return "" immediately --- lib/libskey/skey_getpass.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libskey/skey_getpass.c b/lib/libskey/skey_getpass.c index e8d50d380ad9..cc2fcc327d74 100644 --- a/lib/libskey/skey_getpass.c +++ b/lib/libskey/skey_getpass.c @@ -11,7 +11,7 @@ int pwok; { static char buf[128]; struct skey skey; - char *pass; + char *pass = ""; char *username = pwd ? pwd->pw_name : "nope"; int sflag; @@ -20,8 +20,11 @@ int pwok; if (!sflag) printf("%s\n", buf); - if (!pwok) + if (!pwok) { printf("(s/key required)\n"); + if (sflag) + return (pass); + } pass = getpass(prompt);