From ce2573d997a81051f34471902c44df0b8e5daaf8 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 11 Jul 1999 10:44:59 +0000 Subject: [PATCH] AIX authenticate() support. Could probably be much better --- auth/aix_auth.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ auth/sudo_auth.h | 4 ++++ 2 files changed, 66 insertions(+) create mode 100644 auth/aix_auth.c diff --git a/auth/aix_auth.c b/auth/aix_auth.c new file mode 100644 index 000000000..68e0251f6 --- /dev/null +++ b/auth/aix_auth.c @@ -0,0 +1,62 @@ +/* + * CU sudo version 1.6 + * Copyright (c) 1999 Todd C. Miller + * + * 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 +#ifdef STDC_HEADERS +#include +#endif /* STDC_HEADERS */ +#ifdef HAVE_UNISTD_H +#include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_STRING_H +#include +#endif /* HAVE_STRING_H */ +#ifdef HAVE_STRINGS_H +#include +#endif /* HAVE_STRINGS_H */ +#include +#include +#include + +#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); +} diff --git a/auth/sudo_auth.h b/auth/sudo_auth.h index 7ceb34388..e65e124d9 100644 --- a/auth/sudo_auth.h +++ b/auth/sudo_auth.h @@ -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) -- 2.40.0