1996-09-22 22:56:57 +01:00
|
|
|
/* Author: Wietse Venema, Eindhoven University of Technology.
|
|
|
|
*
|
1997-01-14 07:20:47 +00:00
|
|
|
* $FreeBSD$
|
1996-09-22 22:56:57 +01:00
|
|
|
*/
|
1994-08-21 20:09:58 +01:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
|
|
|
|
#include <skey.h>
|
|
|
|
|
|
|
|
/* skey_challenge - additional password prompt stuff */
|
|
|
|
|
1996-10-18 18:09:26 +01:00
|
|
|
char *skey_challenge(name, pwd, pwok)
|
1994-08-21 20:09:58 +01:00
|
|
|
char *name;
|
|
|
|
struct passwd *pwd;
|
1996-10-18 18:09:26 +01:00
|
|
|
int pwok;
|
1994-08-21 20:09:58 +01:00
|
|
|
{
|
|
|
|
static char buf[128];
|
|
|
|
struct skey skey;
|
|
|
|
|
|
|
|
/* Display s/key challenge where appropriate. */
|
|
|
|
|
1996-10-18 18:09:26 +01:00
|
|
|
if (pwd == NULL || skeychallenge(&skey, pwd->pw_name, buf))
|
|
|
|
sprintf(buf, "Password required for %s.", name);
|
|
|
|
else if (!pwok)
|
|
|
|
strcat(buf, " (s/key required)");
|
1994-08-21 20:09:58 +01:00
|
|
|
return (buf);
|
|
|
|
}
|