summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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