summaryrefslogtreecommitdiff
path: root/libexec/ftpd/skey-stuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/ftpd/skey-stuff.c')
-rw-r--r--libexec/ftpd/skey-stuff.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libexec/ftpd/skey-stuff.c b/libexec/ftpd/skey-stuff.c
index 8dedc18e6f1c..06a227d7db3a 100644
--- a/libexec/ftpd/skey-stuff.c
+++ b/libexec/ftpd/skey-stuff.c
@@ -1,6 +1,6 @@
/* Author: Wietse Venema, Eindhoven University of Technology.
*
- * $Id$
+ * $Id: skey-stuff.c,v 1.3 1996/09/22 21:53:34 wosch Exp $
*/
#include <stdio.h>
@@ -10,18 +10,20 @@
/* skey_challenge - additional password prompt stuff */
-char *skey_challenge(name, pwd, pwok)
+char *skey_challenge(name, pwd, pwok, sflag)
char *name;
struct passwd *pwd;
int pwok;
+int *sflag;
{
static char buf[128];
struct skey skey;
+ char *username = pwd ? pwd->pw_name : ":";
/* Display s/key challenge where appropriate. */
- if (pwd == 0 || skeychallenge(&skey, pwd->pw_name, buf) != 0)
- sprintf(buf, "%s required for %s.",
- pwok ? "Password" : "S/Key password", name);
+ *sflag = skeychallenge(&skey, username, buf);
+ sprintf(buf, "%s required for %s.",
+ pwok ? "Password" : "S/Key password", name);
return (buf);
}