AIX authenticate() support. Could probably be much better
This commit is contained in:
62
auth/aix_auth.c
Normal file
62
auth/aix_auth.c
Normal file
@@ -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);
|
||||
}
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user