diff options
Diffstat (limited to 'contrib/openpam/lib/openpam_impl.h')
-rw-r--r-- | contrib/openpam/lib/openpam_impl.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/contrib/openpam/lib/openpam_impl.h b/contrib/openpam/lib/openpam_impl.h index 23bfc90..9ffcc0a 100644 --- a/contrib/openpam/lib/openpam_impl.h +++ b/contrib/openpam/lib/openpam_impl.h @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/openpam/lib/openpam_impl.h#16 $ + * $P4: //depot/projects/openpam/lib/openpam_impl.h#17 $ */ #ifndef _OPENPAM_IMPL_H_INCLUDED @@ -39,7 +39,9 @@ #include <security/openpam.h> +extern const char *_pam_func_name[PAM_NUM_PRIMITIVES]; extern const char *_pam_sm_func_name[PAM_NUM_PRIMITIVES]; +extern const char *_pam_err_name[PAM_NUM_ERRORS]; /* * Control flags @@ -83,6 +85,7 @@ struct pam_handle { /* chains */ pam_chain_t *chains[PAM_NUM_CHAINS]; pam_chain_t *current; + int primitive; /* items and data */ void *item[PAM_NUM_ITEMS]; @@ -118,4 +121,41 @@ pam_module_t *openpam_static(const char *); #endif pam_module_t *openpam_dynamic(const char *); +#ifdef DEBUG +#define ENTER() openpam_log(PAM_LOG_DEBUG, "entering") +#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]); \ + else \ + openpam_log(PAM_LOG_DEBUG, "returning %d!", (c)); \ + return (c); \ +} while (0) +#define RETURNI(n) do { \ + openpam_log(PAM_LOG_DEBUG, "returning %d", (n)); \ + return (n); \ +} while (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); \ +} while (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); \ +} while (0) +#else +#define ENTER() +#define RETURNV() return +#define RETURNC(c) return (c) +#define RETURNI(n) return (i) +#define RETURNP(p) return (p) +#define RETURNS(s) return (s) +#endif + #endif |