summaryrefslogtreecommitdiffstats
path: root/lib/libskey/skey_getpass.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-10-17 13:43:58 +0000
committerache <ache@FreeBSD.org>1996-10-17 13:43:58 +0000
commit76fa87e93d6457909de5988f81f282edcfb599d8 (patch)
tree0221c1a5c0f254d960d7d0538ba01d8d66dbead8 /lib/libskey/skey_getpass.c
parentb7ccf90470b74606b5177cea50b780686e114a0f (diff)
downloadFreeBSD-src-76fa87e93d6457909de5988f81f282edcfb599d8.zip
FreeBSD-src-76fa87e93d6457909de5988f81f282edcfb599d8.tar.gz
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
Diffstat (limited to 'lib/libskey/skey_getpass.c')
-rw-r--r--lib/libskey/skey_getpass.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libskey/skey_getpass.c b/lib/libskey/skey_getpass.c
index e8d50d3..cc2fcc3 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);
OpenPOWER on IntegriCloud