1996-09-22 21:56:57 +00:00
|
|
|
/* Author: Wietse Venema, Eindhoven University of Technology.
|
|
|
|
*
|
1997-02-22 14:22:49 +00:00
|
|
|
* $Id$
|
1996-09-22 21:56:57 +00:00
|
|
|
*/
|
1994-08-21 19:09:58 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
1997-02-20 23:11:22 +00:00
|
|
|
#include <string.h>
|
1994-08-21 19:09:58 +00:00
|
|
|
#include <pwd.h>
|
|
|
|
|
|
|
|
#include <skey.h>
|
|
|
|
|
|
|
|
/* skey_challenge - additional password prompt stuff */
|
|
|
|
|
1996-10-18 17:09:26 +00:00
|
|
|
char *skey_challenge(name, pwd, pwok)
|
1994-08-21 19:09:58 +00:00
|
|
|
char *name;
|
|
|
|
struct passwd *pwd;
|
1996-10-18 17:09:26 +00:00
|
|
|
int pwok;
|
1994-08-21 19:09:58 +00:00
|
|
|
{
|
|
|
|
static char buf[128];
|
|
|
|
struct skey skey;
|
|
|
|
|
|
|
|
/* Display s/key challenge where appropriate. */
|
|
|
|
|
1996-10-18 17:09:26 +00: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 19:09:58 +00:00
|
|
|
return (buf);
|
|
|
|
}
|