Un-screwup the debugging code. Now the "debug" keyword will work even

if OPENPAM_DEBUG is not defined (doing so generates far more debugging
information than you will ever want)


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@414 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2008-02-14 18:06:26 +00:00
parent e42d5a34a3
commit 8865782b1d
2 changed files with 1 additions and 7 deletions

View File

@ -60,9 +60,7 @@ openpam_dispatch(pam_handle_t *pamh,
{
pam_chain_t *chain;
int err, fail, r;
#ifdef DEBUG
int debug;
#endif
ENTER();
if (pamh == NULL)
@ -107,23 +105,19 @@ openpam_dispatch(pam_handle_t *pamh,
} else {
pamh->primitive = primitive;
pamh->current = chain;
#ifdef DEBUG
debug = (openpam_get_option(pamh, "debug") != NULL);
if (debug)
++_openpam_debug;
openpam_log(PAM_LOG_DEBUG, "calling %s() in %s",
_pam_sm_func_name[primitive], chain->module->path);
#endif
r = (chain->module->func[primitive])(pamh, flags,
chain->optc, (const char **)chain->optv);
pamh->current = NULL;
#ifdef DEBUG
openpam_log(PAM_LOG_DEBUG, "%s: %s(): %s",
chain->module->path, _pam_sm_func_name[primitive],
pam_strerror(pamh, r));
if (debug)
--_openpam_debug;
#endif
}
if (r == PAM_IGNORE)

View File

@ -135,7 +135,7 @@ pam_module_t *openpam_dynamic(const char *);
#define FREE(p) do { free((p)); (p) = NULL; } while (0)
#ifdef DEBUG
#ifdef OPENPAM_DEBUG
#define ENTER() openpam_log(PAM_LOG_DEBUG, "entering")
#define ENTERI(i) do { \
int _i = (i); \