From 3ab09a4f26f78cbf3ca71e58c4f74791783ddcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sun, 14 Apr 2013 15:44:32 +0000 Subject: [PATCH] OPENPAM_DEBUG (--enable-debug) has a double action: it enables the debugging macros, and sets the initial value of openpam_debug to 1. This effectively gives the user a choice between no debugging at all, or drowning in debugging messages from every part of the system. Assuming that the primary use case for debugging is to allow admins to troubleshoot their policies by adding the debug option to selected pam.conf entries, remove the initialization of openpam_debug to 1. This allows integrators to ship OpenPAM with OPENPAM_DEBUG defined without spamming /var/log. git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@684 185d5e19-27fe-0310-9dcf-9bff6b9f3609 --- autogen.des | 1 + configure.ac | 4 ++-- lib/libpam/openpam_log.c | 4 ---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/autogen.des b/autogen.des index ae1e524..b92f572 100755 --- a/autogen.des +++ b/autogen.des @@ -17,6 +17,7 @@ export CONFIG_SHELL=/bin/sh --with-pamtest \ --with-su \ --with-modules-dir=/usr/lib \ + --enable-debug \ --enable-developer-warnings \ --enable-werror \ "$@" diff --git a/configure.ac b/configure.ac index 029dcce..eea04f2 100644 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,8 @@ AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number]) AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], - [turn debugging on by default]), - AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging on by default])) + [turn debugging macros on]), + AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging macros on])) AC_ARG_ENABLE([unversioned-modules], AC_HELP_STRING([--disable-unversioned-modules], diff --git a/lib/libpam/openpam_log.c b/lib/libpam/openpam_log.c index e0e9ed5..e7d832c 100644 --- a/lib/libpam/openpam_log.c +++ b/lib/libpam/openpam_log.c @@ -50,11 +50,7 @@ #include "openpam_impl.h" #include "openpam_asprintf.h" -#ifdef OPENPAM_DEBUG -int openpam_debug = 1; -#else int openpam_debug = 0; -#endif #if !defined(openpam_log)