Changeset 522 in openpam for trunk


Ignore:
Timestamp:
Jan 11, 2012, 12:13:25 AM (7 years ago)
Author:
Dag-Erling Smørgrav
Message:

Add another log level, PAM_LOG_LIBDEBUG, with a negative priority. It
is currently equivalent to PAM_LOG_DEBUG, and is used only by the
library call tracing macros (ENTER*() and RETURN*()). It should
eventually replace PAM_LOG_DEBUG throughout the library, except
perhaps for a few particularly interesting messages; PAM_LOG_DEBUG
will be reserved for modules.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/security/openpam.h

    r455 r522  
    164164 */
    165165enum {
     166        PAM_LOG_LIBDEBUG = -1,
    166167        PAM_LOG_DEBUG,
    167168        PAM_LOG_VERBOSE,
  • trunk/lib/openpam_debug.h

    r511 r522  
    4040
    4141#ifdef OPENPAM_DEBUG
    42 #define ENTER() openpam_log(PAM_LOG_DEBUG, "entering")
     42#define ENTER() openpam_log(PAM_LOG_LIBDEBUG, "entering")
    4343#define ENTERI(i) do { \
    4444        int i_ = (i); \
    4545        if (i_ > 0 && i_ < PAM_NUM_ITEMS) \
    46                 openpam_log(PAM_LOG_DEBUG, "entering: %s", pam_item_name[i_]); \
     46                openpam_log(PAM_LOG_LIBDEBUG, "entering: %s", pam_item_name[i_]); \
    4747        else \
    48                 openpam_log(PAM_LOG_DEBUG, "entering: %d", i_); \
     48                openpam_log(PAM_LOG_LIBDEBUG, "entering: %d", i_); \
    4949} while (0)
    5050#define ENTERN(n) do { \
    5151        int n_ = (n); \
    52         openpam_log(PAM_LOG_DEBUG, "entering: %d", n_); \
     52        openpam_log(PAM_LOG_LIBDEBUG, "entering: %d", n_); \
    5353} while (0)
    5454#define ENTERS(s) do { \
    5555        const char *s_ = (s); \
    5656        if (s_ == NULL) \
    57                 openpam_log(PAM_LOG_DEBUG, "entering: NULL"); \
     57                openpam_log(PAM_LOG_LIBDEBUG, "entering: NULL"); \
    5858        else \
    59                 openpam_log(PAM_LOG_DEBUG, "entering: '%s'", s_); \
     59                openpam_log(PAM_LOG_LIBDEBUG, "entering: '%s'", s_); \
    6060} while (0)
    61 #define RETURNV() openpam_log(PAM_LOG_DEBUG, "returning")
     61#define RETURNV() openpam_log(PAM_LOG_LIBDEBUG, "returning")
    6262#define RETURNC(c) do { \
    6363        int c_ = (c); \
    6464        if (c_ >= 0 && c_ < PAM_NUM_ERRORS) \
    65                 openpam_log(PAM_LOG_DEBUG, "returning %s", pam_err_name[c_]); \
     65                openpam_log(PAM_LOG_LIBDEBUG, "returning %s", pam_err_name[c_]); \
    6666        else \
    67                 openpam_log(PAM_LOG_DEBUG, "returning %d!", c_); \
     67                openpam_log(PAM_LOG_LIBDEBUG, "returning %d!", c_); \
    6868        return (c_); \
    6969} while (0)
    7070#define RETURNN(n) do { \
    7171        int n_ = (n); \
    72         openpam_log(PAM_LOG_DEBUG, "returning %d", n_); \
     72        openpam_log(PAM_LOG_LIBDEBUG, "returning %d", n_); \
    7373        return (n_); \
    7474} while (0)
     
    7676        void *p_ = (p); \
    7777        if (p_ == NULL) \
    78                 openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
     78                openpam_log(PAM_LOG_LIBDEBUG, "returning NULL"); \
    7979        else \
    80                 openpam_log(PAM_LOG_DEBUG, "returning %p", p_); \
     80                openpam_log(PAM_LOG_LIBDEBUG, "returning %p", p_); \
    8181        return (p_); \
    8282} while (0)
     
    8484        const char *s_ = (s); \
    8585        if (s_ == NULL) \
    86                 openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
     86                openpam_log(PAM_LOG_LIBDEBUG, "returning NULL"); \
    8787        else \
    88                 openpam_log(PAM_LOG_DEBUG, "returning '%s'", s_); \
     88                openpam_log(PAM_LOG_LIBDEBUG, "returning '%s'", s_); \
    8989        return (s_); \
    9090} while (0)
  • trunk/lib/openpam_log.c

    r437 r522  
    7272
    7373        switch (level) {
     74        case PAM_LOG_LIBDEBUG:
    7475        case PAM_LOG_DEBUG:
    7576                if (!openpam_debug)
Note: See TracChangeset for help on using the changeset viewer.