]> granicus.if.org Git - sudo/commitdiff
AIX authenticate() support. Could probably be much better
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 11 Jul 1999 10:44:59 +0000 (10:44 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 11 Jul 1999 10:44:59 +0000 (10:44 +0000)
auth/aix_auth.c [new file with mode: 0644]
auth/sudo_auth.h

diff --git a/auth/aix_auth.c b/auth/aix_auth.c
new file mode 100644 (file)
index 0000000..68e0251
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ *  CU sudo version 1.6
+ *  Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 1, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Please send bugs, changes, problems to sudo-bugs@courtesan.com
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif /* STDC_HEADERS */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif /* HAVE_STRINGS_H */
+#include <sys/param.h>
+#include <sys/types.h>
+#include <pwd.h>
+
+#include "sudo.h"
+#include "sudo_auth.h"
+
+#ifndef lint
+static const char rcsid[] = "$Sudo$";
+#endif /* lint */
+
+int
+aixauth_verify(pw, prompt, data)
+    struct passwd *pw;
+    char *prompt;
+    void **data;
+{
+    char *message, *pass;
+    int reenter = 1;
+
+    pass = GETPASS(prompt, PASSWORD_TIMEOUT * 60, 1);
+    if (authenticate(pw->pw_name, pass, &reenter, &message) == 0)
+       return(AUTH_SUCCESS);
+    else
+       return(AUTH_FAILURE);
+}
index 7ceb343889555f18d07d9ba46a7e42873c8a5d4a..e65e124d9d7e7a95b8a1f4c136e99dbe324b0584 100644 (file)
@@ -26,6 +26,7 @@ int pam_cleanup __P((struct passwd *pw, int status, void **data));
 int sia_setup __P((struct passwd *pw, char **prompt, void **data));
 int sia_verify __P((struct passwd *pw, char *prompt, void **data));
 int sia_cleanup __P((struct passwd *pw, int status, void **data));
+int aixauth_verify __P((struct passwd *pw, char *prompt, void **data));
 
 /* Prototypes for normal methods */
 int passwd_verify __P((struct passwd *pw, char *pass, void **data));
@@ -54,6 +55,9 @@ int kerb5_verify __P((struct passwd *pw, char *pass, void **data));
 #elif defined(HAVE_SIA)
 #  define AUTH_STANDALONE \
        AUTH_ENTRY(1, "sia", sia_setup, sia_verify, sia_cleanup)
+#elif defined(HAVE_AUTHENTICATE)
+#  define AUTH_STANDALONE \
+       AUTH_ENTRY(1, "aixauth", NULL, aixauth_verify, NULL)
 #elif defined(HAVE_FWTK)
 #  define AUTH_STANDALONE \
        AUTH_ENTRY(1, "fwtk", fwtk_setup, fwtk_verify, fwtk_cleanup)