]> granicus.if.org Git - sudo/commitdiff
Add support for skeyaccess(3) if it is present in libskey.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Dec 2001 06:15:08 +0000 (06:15 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Dec 2001 06:15:08 +0000 (06:15 +0000)
auth/passwd.c
auth/sudo_auth.c
auth/sudo_auth.h

index 0bb5b3c0459f292cd7c19a370a08d80931609d69..ccd3482f329fb4827abb9fae3db4d9d2114dedc9 100644 (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;
index f6b6f59fa4ee15aed4d2477767dfd7f2221547e1..005c7b43fd8d6df361a0faf0dcf0f66710f0eb6b 100644 (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)
index e964ff05cdf13047ce1aef5719725ee653c57379..25dd7fc865681232d1eb8ec26a20e5c85cec42e2 100644 (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));