Add support for skeyaccess(3) if it is present in libskey.

This commit is contained in:
Todd C. Miller
2001-12-14 06:15:08 +00:00
parent cf92836ecf
commit e299dee342
3 changed files with 16 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 1999, 2001 Todd C. Miller <Todd.Miller@courtesan.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,19 @@ static const char rcsid[] = "$Sudo$";
#define DESLEN 13
#define HAS_AGEINFO(p, l) (l == 18 && p[DESLEN] == ',')
int
passwd_init(pw, promptp, auth)
struct passwd *pw;
char **promptp;
sudo_auth *auth;
{
#ifdef HAVE_SKEYACCESS
if (skeyaccess(pw->pw_name, user_tty, NULL, NULL) == 0)
return(AUTH_FATAL);
#endif
return(AUTH_SUCCESS);
}
int
passwd_verify(pw, pass, auth)
struct passwd *pw;

View File

@@ -67,7 +67,7 @@ sudo_auth auth_switch[] = {
AUTH_STANDALONE
#else
# ifndef WITHOUT_PASSWD
AUTH_ENTRY(0, "passwd", NULL, NULL, passwd_verify, NULL)
AUTH_ENTRY(0, "passwd", passwd_init, NULL, passwd_verify, NULL)
# endif
# if defined(HAVE_GETPRPWNAM) && !defined(WITHOUT_PASSWD)
AUTH_ENTRY(0, "secureware", secureware_init, NULL, secureware_verify, NULL)

View File

@@ -80,6 +80,7 @@ int bsdauth_verify __P((struct passwd *pw, char *prompt, sudo_auth *auth));
int bsdauth_cleanup __P((struct passwd *pw, sudo_auth *auth));
/* Prototypes for normal methods */
int passwd_init __P((struct passwd *pw, char **prompt, sudo_auth *auth));
int passwd_verify __P((struct passwd *pw, char *pass, sudo_auth *auth));
int secureware_init __P((struct passwd *pw, char **prompt, sudo_auth *auth));
int secureware_verify __P((struct passwd *pw, char *pass, sudo_auth *auth));