From owner-p4-projects@FreeBSD.ORG Thu May 1 09:20:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3546737B404; Thu, 1 May 2003 09:20:52 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC14637B401 for ; Thu, 1 May 2003 09:20:51 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78BAD43FA3 for ; Thu, 1 May 2003 09:20:51 -0700 (PDT) (envelope-from des@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h41GKp0U069015 for ; Thu, 1 May 2003 09:20:51 -0700 (PDT) (envelope-from des@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h41GKpnv069012 for perforce@freebsd.org; Thu, 1 May 2003 09:20:51 -0700 (PDT) Date: Thu, 1 May 2003 09:20:51 -0700 (PDT) Message-Id: <200305011620.h41GKpnv069012@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to des@freebsd.org using -f From: Dag-Erling Smorgrav To: Perforce Change Reviews Subject: PERFORCE change 30314 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 16:20:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=30314 Change 30314 by des@des.at.des.thinksec.com on 2003/05/01 09:20:03 If compiled with -DDEBUG, enable debugging right before calling a module which has the "debug" option, and disable it upon return. Affected files ... .. //depot/projects/openpam/lib/openpam_dispatch.c#19 edit Differences ... ==== //depot/projects/openpam/lib/openpam_dispatch.c#19 (text+ko) ==== @@ -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_dispatch.c#18 $ + * $P4: //depot/projects/openpam/lib/openpam_dispatch.c#19 $ */ #include @@ -59,6 +59,9 @@ { pam_chain_t *chain; int err, fail, r; +#ifdef DEBUG + int debug; +#endif ENTER(); if (pamh == NULL) @@ -96,8 +99,6 @@ /* execute */ for (err = fail = 0; chain != NULL; chain = chain->next) { - openpam_log(PAM_LOG_DEBUG, "calling %s() in %s", - _pam_sm_func_name[primitive], chain->module->path); if (chain->module->func[primitive] == NULL) { openpam_log(PAM_LOG_ERROR, "%s: no %s()", chain->module->path, _pam_sm_func_name[primitive]); @@ -105,12 +106,23 @@ } else { pamh->primitive = primitive; pamh->current = chain; +#ifdef DEBUG + debug = (openpam_get_option(pamh, "debug") != NULL); + if (debug) + ++_openpam_debug; + openpam_log(PAM_LOG_DEBUG, "calling %s() in %s", + _pam_sm_func_name[primitive], chain->module->path); +#endif r = (chain->module->func[primitive])(pamh, flags, chain->optc, (const char **)chain->optv); pamh->current = NULL; +#ifdef DEBUG openpam_log(PAM_LOG_DEBUG, "%s: %s(): %s", chain->module->path, _pam_sm_func_name[primitive], pam_strerror(pamh, r)); + if (debug) + --_openpam_debug; +#endif } if (r == PAM_IGNORE)