summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter de Jong <walter.dejong@surfsara.nl>2014-08-06 16:45:38 +0200
committerWalter de Jong <walter.dejong@surfsara.nl>2014-08-06 16:45:38 +0200
commitd4d97e242d878b03314ef679dd14eeedc6c6ce3c (patch)
tree0f8f72df85ad5f6651e28fb424f27eea5a0290ec
parent662310ddb0a24af4fc7fc240d0664d1d5c42a19a (diff)
downloadlibpam-radius-auth-d4d97e242d878b03314ef679dd14eeedc6c6ce3c.tar.gz
libpam-radius-auth-d4d97e242d878b03314ef679dd14eeedc6c6ce3c.zip
only print debug messages when configured
-rw-r--r--src/pam_radius_auth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pam_radius_auth.c b/src/pam_radius_auth.c
index 853b8a1..27d9b2f 100644
--- a/src/pam_radius_auth.c
+++ b/src/pam_radius_auth.c
@@ -60,11 +60,12 @@
#include "pam_radius_auth.h"
-#define DPRINT if (ctrl & PAM_DEBUG_ARG) _pam_log
+#define DPRINT if (opt_debug & PAM_DEBUG_ARG) _pam_log
/* internal data */
static CONST char *pam_module_name = "pam_radius_auth";
static char conf_file[BUFFER_SIZE]; /* configuration file */
+static int opt_debug = FALSE; /* print debug info */
/* we need to save these from open_session to close_session, since
* when close_session will be called we won't be root anymore and
@@ -145,6 +146,7 @@ static int _pam_parse(int argc, CONST char **argv, radius_conf_t *conf)
} else if (!strcmp(*argv, "debug")) {
ctrl |= PAM_DEBUG_ARG;
conf->debug = 1;
+ opt_debug = TRUE;
} else {
_pam_log(LOG_WARNING, "unrecognized option '%s'", *argv);
@@ -259,7 +261,6 @@ static uint32_t get_ipaddr(char *host) {
static int host2server(radius_server_t *server)
{
char *p;
- int ctrl = 1; /* for DPRINT */
if ((p = strchr(server->hostname, ':')) != NULL) {
*(p++) = '\0'; /* split the port off from the host name */