From owner-p4-projects Thu Dec 12 8: 7:14 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A051337B404; Thu, 12 Dec 2002 08:07:11 -0800 (PST) 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 37B4237B401 for ; Thu, 12 Dec 2002 08:07:11 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7AB143EA9 for ; Thu, 12 Dec 2002 08:07:10 -0800 (PST) (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 gBCG2EmV099900 for ; Thu, 12 Dec 2002 08:02:14 -0800 (PST) (envelope-from des@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBCG2Do8099897 for perforce@freebsd.org; Thu, 12 Dec 2002 08:02:13 -0800 (PST) Date: Thu, 12 Dec 2002 08:02:13 -0800 (PST) Message-Id: <200212121602.gBCG2Do8099897@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to des@freebsd.org using -f From: Dag-Erling Smorgrav Subject: PERFORCE change 22201 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=22201 Change 22201 by des@des.at.des.thinksec.com on 2002/12/12 08:01:39 Declare _pam_func_name and _pam_err_name. Add a member to the pam_handle structure indicating which primitive is currently executing. Add a ton of debugging macros. Affected files ... .. //depot/projects/openpam/lib/openpam_impl.h#17 edit Differences ... ==== //depot/projects/openpam/lib/openpam_impl.h#17 (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_impl.h#16 $ + * $P4: //depot/projects/openpam/lib/openpam_impl.h#17 $ */ #ifndef _OPENPAM_IMPL_H_INCLUDED @@ -39,7 +39,9 @@ #include +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 @@ /* 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 @@ #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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message