Fix debugging compilation.

This commit is contained in:
christos 2005-01-08 07:58:02 +00:00
parent ca7489bf5c
commit edd9734813
28 changed files with 59 additions and 32 deletions

View File

@ -96,6 +96,7 @@ openpam_borrow_cred(pam_handle_t *pamh,
RETURNC(PAM_SYSTEM_ERR);
}
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -172,6 +172,7 @@ openpam_dispatch(pam_handle_t *pamh,
if (!fail && err != PAM_NEW_AUTHTOK_REQD)
err = PAM_SUCCESS;
RETURNC(err);
/*NOTREACHED*/
}
#if !defined(OPENPAM_RELAX_CHECKS)

View File

@ -61,6 +61,7 @@ openpam_findenv(pam_handle_t *pamh,
pamh->env[i][len] == '=')
RETURNN(i);
RETURNN(-1);
/*NOTREACHED*/
}
/*

View File

@ -71,6 +71,7 @@ openpam_get_option(pam_handle_t *pamh,
}
}
RETURNS(NULL);
/*NOTREACHED*/
}
/**

View File

@ -136,46 +136,45 @@ pam_module_t *openpam_dynamic(const char *);
#ifdef DEBUG
#define ENTER() openpam_log(PAM_LOG_DEBUG, "entering")
#define ENTERI(i) do { \
if ((i) > 0 && (i) < PAM_NUM_ITEMS) \
openpam_log(PAM_LOG_DEBUG, "entering: %s", _pam_item_name[i]); \
#define ENTERI(iv) do { \
if (/*CONSTCOND*/(iv) > 0 && (iv) < PAM_NUM_ITEMS) \
openpam_log(PAM_LOG_DEBUG, "entering: %s", \
_pam_item_name[(iv)]); \
else \
openpam_log(PAM_LOG_DEBUG, "entering: %d", (i)); \
openpam_log(PAM_LOG_DEBUG, "entering: %d", (iv)); \
} while (/*CONSTCOND*/0)
#define ENTERN(n) do { \
openpam_log(PAM_LOG_DEBUG, "entering: %d", (n)); \
} while (0)
#define ENTERS(s) do { \
if ((s) == NULL) \
openpam_log(PAM_LOG_DEBUG, "entering: NULL"); \
else \
openpam_log(PAM_LOG_DEBUG, "entering: '%s'", (s)); \
#define ENTERN(num) do { \
openpam_log(PAM_LOG_DEBUG, "entering: %d", (num)); \
} while (/*CONSTCOND*/0)
#define ENTERS(str) do { \
openpam_log(PAM_LOG_DEBUG, "entering: '%s'", \
/*CONSTCOND*/(str) ? (str) : "(null)"); \
} while (/*CONSTCOND*/0)
#define RETURNV() openpam_log(PAM_LOG_DEBUG, "returning")
#define RETURNC(c) do { \
if ((c) >= 0 && (c) < PAM_NUM_ERRORS) \
openpam_log(PAM_LOG_DEBUG, "returning %s", _pam_err_name[c]); \
#define RETURNC(chr) do { \
if (/*CONSTCOND*/(chr) >= 0 && (chr) < PAM_NUM_ERRORS) \
openpam_log(PAM_LOG_DEBUG, "returning %s", \
_pam_err_name[(chr)]); \
else \
openpam_log(PAM_LOG_DEBUG, "returning %d!", (c)); \
return (c); \
openpam_log(PAM_LOG_DEBUG, "returning %d!", (chr)); \
return (chr); \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
#define RETURNN(n) do { \
openpam_log(PAM_LOG_DEBUG, "returning %d", (n)); \
return (n); \
#define RETURNN(num) do { \
openpam_log(PAM_LOG_DEBUG, "returning %d", (num)); \
return (num); \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
#define RETURNP(p) do { \
if ((p) == NULL) \
openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
else \
openpam_log(PAM_LOG_DEBUG, "returning %p", (p)); \
return (p); \
#define RETURNP(ptr) do { \
openpam_log(PAM_LOG_DEBUG, "returning %p", (ptr)); \
return (ptr); \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
#define RETURNS(s) do { \
if ((s) == NULL) \
openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
else \
openpam_log(PAM_LOG_DEBUG, "returning '%s'", (s)); \
return (s); \
#define RETURNS(str) do { \
openpam_log(PAM_LOG_DEBUG, "returning '%s'", \
/*CONSTCOND*/(str) ? (str) : "(null)"); \
return (str); \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
#else
#define ENTER()

View File

@ -63,6 +63,7 @@ openpam_nullconv(int n,
/*LINTED unused*/
(void)data;
RETURNC(PAM_CONV_ERR);
/*NOTREACHED*/
}
/*

View File

@ -74,6 +74,7 @@ openpam_restore_cred(pam_handle_t *pamh)
}
pam_set_data(pamh, PAM_SAVED_CRED, NULL, NULL);
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -101,6 +101,7 @@ openpam_set_option(pam_handle_t *pamh,
cur->optv[i] = opt;
}
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -220,6 +220,7 @@ openpam_ttyconv(int n,
FREE(aresp);
*resp = NULL;
RETURNC(PAM_CONV_ERR);
/*NOTREACHED*/
}
/*

View File

@ -56,6 +56,7 @@ pam_acct_mgmt(pam_handle_t *pamh,
ENTER();
r = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -59,6 +59,7 @@ pam_authenticate(pam_handle_t *pamh,
r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
pam_set_item(pamh, PAM_AUTHTOK, NULL);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -64,6 +64,7 @@ pam_chauthtok(pam_handle_t *pamh,
pam_set_item(pamh, PAM_OLDAUTHTOK, NULL);
pam_set_item(pamh, PAM_AUTHTOK, NULL);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -58,6 +58,7 @@ pam_close_session(pam_handle_t *pamh,
RETURNC(PAM_SYMBOL_ERR);
r = openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -84,6 +84,7 @@ pam_end(pam_handle_t *pamh,
FREE(pamh);
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -128,6 +128,7 @@ pam_get_authtok(pam_handle_t *pamh,
RETURNC(r);
r = pam_get_item(pamh, item, (const void **)authtok);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -65,6 +65,7 @@ pam_get_data(pam_handle_t *pamh,
}
}
RETURNC(PAM_NO_MODULE_DATA);
/*NOTREACHED*/
}
/*

View File

@ -87,8 +87,10 @@ pam_get_item(pam_handle_t *pamh,
case PAM_REPOSITORY:
*item = pamh->item[item_type];
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
default:
RETURNC(PAM_SYMBOL_ERR);
/*NOTREACHED*/
}
}

View File

@ -83,6 +83,7 @@ pam_get_user(pam_handle_t *pamh,
RETURNC(r);
r = pam_get_item(pamh, PAM_USER, (const void **)user);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -69,6 +69,7 @@ pam_getenv(pam_handle_t *pamh,
}
}
RETURNS(str);
/*NOTREACHED*/
}
/**

View File

@ -77,6 +77,7 @@ pam_getenvlist(pam_handle_t *pamh)
}
envlist[i] = NULL;
RETURNP(envlist);
/*NOTREACHED*/
}
/**

View File

@ -58,6 +58,7 @@ pam_open_session(pam_handle_t *pamh,
RETURNC(PAM_SYMBOL_ERR);
r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -88,6 +88,7 @@ pam_putenv(pam_handle_t *pamh,
RETURNC(PAM_BUF_ERR);
++pamh->env_count;
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -81,6 +81,7 @@ pam_set_data(pam_handle_t *pamh,
dp->next = pamh->module_data;
pamh->module_data = dp;
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -101,6 +101,7 @@ pam_set_item(pam_handle_t *pamh,
}
*slot = tmp;
RETURNC(PAM_SUCCESS);
/*NOTREACHED*/
}
/*

View File

@ -60,6 +60,7 @@ pam_setcred(pam_handle_t *pamh,
/* XXX enforce exclusivity */
r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -76,6 +76,7 @@ pam_setenv(pam_handle_t *pamh,
r = pam_putenv(pamh, env);
FREE(env);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -77,6 +77,7 @@ pam_start(const char *service,
fail:
pam_end(ph, r);
RETURNC(r);
/*NOTREACHED*/
}
/*

View File

@ -81,6 +81,7 @@ pam_vprompt(pam_handle_t *pamh,
*resp = rsp == NULL ? NULL : rsp->resp;
FREE(rsp);
RETURNC(r);
/*NOTREACHED*/
}
/*