/*
- * Copyright (c) 1999-2005, 2007, 2010-2011
+ * Copyright (c) 1999-2005, 2007, 2010-2013
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
#include <config.h>
#include <sys/types.h>
-#include <sys/param.h>
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
sudo_collect(int timeout, int rendition, uchar_t *title, int nprompts,
prompt_t *prompts)
{
+ debug_decl(sudo_collect, SUDO_DEBUG_AUTH)
+
switch (rendition) {
case SIAFORM:
case SIAONELINER:
break;
}
- return sia_collect_trm(timeout, rendition, title, nprompts, prompts);
+ debug_return_int(sia_collect_trm(timeout, rendition, title, nprompts, prompts));
}
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;
int i;
extern int NewArgc;
extern char **NewArgv;
+ debug_decl(sudo_sia_setup, SUDO_DEBUG_AUTH)
/* Rebuild argv for sia_ses_init() */
sudo_argc = NewArgc + 1;
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,
- "unable to initialize SIA session");
- return AUTH_FATAL;
+ log_warning(USE_ERRNO|NO_MAIL,
+ N_("unable to initialize SIA session"));
+ debug_return_int(AUTH_FATAL);
}
auth->data = (void *) siah;
- return AUTH_SUCCESS;
+ debug_return_int(AUTH_SUCCESS);
}
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;
+ debug_decl(sudo_sia_verify, SUDO_DEBUG_AUTH)
def_prompt = prompt; /* for sudo_collect */
/* XXX - need a way to detect user hitting return or EOF at prompt */
if (sia_ses_reauthent(sudo_collect, siah) == SIASUCCESS)
- return AUTH_SUCCESS;
+ debug_return_int(AUTH_SUCCESS);
else
- return AUTH_FAILURE;
+ debug_return_int(AUTH_FAILURE);
}
int
-sia_cleanup(struct passwd *pw, sudo_auth *auth)
+sudo_sia_cleanup(struct passwd *pw, sudo_auth *auth)
{
SIAENTITY *siah = (SIAENTITY *) auth->data;
+ debug_decl(sudo_sia_cleanup, SUDO_DEBUG_AUTH)
(void) sia_ses_release(&siah);
efree(sudo_argv);
- return AUTH_SUCCESS;
+ debug_return_int(AUTH_SUCCESS);
}