1130b656e5
This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
29 lines
578 B
C
29 lines
578 B
C
/* Author: Wietse Venema, Eindhoven University of Technology.
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <pwd.h>
|
|
|
|
#include <skey.h>
|
|
|
|
/* skey_challenge - additional password prompt stuff */
|
|
|
|
char *skey_challenge(name, pwd, pwok)
|
|
char *name;
|
|
struct passwd *pwd;
|
|
int pwok;
|
|
{
|
|
static char buf[128];
|
|
struct skey skey;
|
|
|
|
/* Display s/key challenge where appropriate. */
|
|
|
|
if (pwd == NULL || skeychallenge(&skey, pwd->pw_name, buf))
|
|
sprintf(buf, "Password required for %s.", name);
|
|
else if (!pwok)
|
|
strcat(buf, " (s/key required)");
|
|
return (buf);
|
|
}
|