version 1.1.1.1, 2012/02/21 16:23:02
|
version 1.1.1.2, 2012/05/29 12:26:49
|
Line 63 static int
|
Line 63 static int
|
sudo_collect(int timeout, int rendition, uchar_t *title, int nprompts, |
sudo_collect(int timeout, int rendition, uchar_t *title, int nprompts, |
prompt_t *prompts) |
prompt_t *prompts) |
{ |
{ |
|
debug_decl(sudo_collect, SUDO_DEBUG_AUTH) |
|
|
switch (rendition) { |
switch (rendition) { |
case SIAFORM: |
case SIAFORM: |
case SIAONELINER: |
case SIAONELINER: |
Line 81 sudo_collect(int timeout, int rendition, uchar_t *titl
|
Line 83 sudo_collect(int timeout, int rendition, uchar_t *titl
|
break; |
break; |
} |
} |
|
|
return sia_collect_trm(timeout, rendition, title, nprompts, prompts); | debug_return_int(sia_collect_trm(timeout, rendition, title, nprompts, prompts)); |
} |
} |
|
|
int |
int |
sia_setup(struct passwd *pw, char **promptp, sudo_auth *auth) | sudo_sia_setup(struct passwd *pw, char **promptp, sudo_auth *auth) |
{ |
{ |
SIAENTITY *siah = NULL; |
SIAENTITY *siah = NULL; |
int i; |
int i; |
extern int NewArgc; |
extern int NewArgc; |
extern char **NewArgv; |
extern char **NewArgv; |
|
debug_decl(sudo_sia_setup, SUDO_DEBUG_AUTH) |
|
|
/* Rebuild argv for sia_ses_init() */ |
/* Rebuild argv for sia_ses_init() */ |
sudo_argc = NewArgc + 1; |
sudo_argc = NewArgc + 1; |
Line 102 sia_setup(struct passwd *pw, char **promptp, sudo_auth
|
Line 105 sia_setup(struct passwd *pw, char **promptp, sudo_auth
|
|
|
if (sia_ses_init(&siah, sudo_argc, sudo_argv, NULL, pw->pw_name, user_ttypath, 1, NULL) != SIASUCCESS) { |
if (sia_ses_init(&siah, sudo_argc, sudo_argv, NULL, pw->pw_name, user_ttypath, 1, NULL) != SIASUCCESS) { |
|
|
log_error(USE_ERRNO|NO_EXIT|NO_MAIL, | log_error(USE_ERRNO|NO_MAIL, |
_("unable to initialize SIA session")); |
_("unable to initialize SIA session")); |
return AUTH_FATAL; | debug_return_int(AUTH_FATAL); |
} |
} |
|
|
auth->data = (void *) siah; |
auth->data = (void *) siah; |
return AUTH_SUCCESS; | debug_return_int(AUTH_SUCCESS); |
} |
} |
|
|
int |
int |
sia_verify(struct passwd *pw, char *prompt, sudo_auth *auth) | sudo_sia_verify(struct passwd *pw, char *prompt, sudo_auth *auth) |
{ |
{ |
SIAENTITY *siah = (SIAENTITY *) auth->data; |
SIAENTITY *siah = (SIAENTITY *) auth->data; |
|
debug_decl(sudo_sia_verify, SUDO_DEBUG_AUTH) |
|
|
def_prompt = prompt; /* for sudo_collect */ |
def_prompt = prompt; /* for sudo_collect */ |
|
|
/* XXX - need a way to detect user hitting return or EOF at prompt */ |
/* XXX - need a way to detect user hitting return or EOF at prompt */ |
if (sia_ses_reauthent(sudo_collect, siah) == SIASUCCESS) |
if (sia_ses_reauthent(sudo_collect, siah) == SIASUCCESS) |
return AUTH_SUCCESS; | debug_return_int(AUTH_SUCCESS); |
else |
else |
return AUTH_FAILURE; | debug_return_int(AUTH_FAILURE); |
} |
} |
|
|
int |
int |
sia_cleanup(struct passwd *pw, sudo_auth *auth) | sudo_sia_cleanup(struct passwd *pw, sudo_auth *auth) |
{ |
{ |
SIAENTITY *siah = (SIAENTITY *) auth->data; |
SIAENTITY *siah = (SIAENTITY *) auth->data; |
|
debug_decl(sudo_sia_cleanup, SUDO_DEBUG_AUTH) |
|
|
(void) sia_ses_release(&siah); |
(void) sia_ses_release(&siah); |
efree(sudo_argv); |
efree(sudo_argv); |
return AUTH_SUCCESS; | debug_return_int(AUTH_SUCCESS); |
} |
} |