summaryrefslogtreecommitdiffstats
path: root/contrib/openpam/lib/openpam_dispatch.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-05-02 15:08:06 +0000
committerdes <des@FreeBSD.org>2003-05-02 15:08:06 +0000
commit69e4c91a9aeb151a806e8ba3c53ab38f37f5e8dc (patch)
treeb955e81987ebbd36890b09fa581ab99357d954bc /contrib/openpam/lib/openpam_dispatch.c
parent5a81fa192a3c014aa2d5841433693479b4641619 (diff)
parent1b2b5956a02e1d56168e372dc96807d70b3ca363 (diff)
downloadFreeBSD-src-69e4c91a9aeb151a806e8ba3c53ab38f37f5e8dc.zip
FreeBSD-src-69e4c91a9aeb151a806e8ba3c53ab38f37f5e8dc.tar.gz
This commit was generated by cvs2svn to compensate for changes in r114536,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/openpam/lib/openpam_dispatch.c')
-rw-r--r--contrib/openpam/lib/openpam_dispatch.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/openpam/lib/openpam_dispatch.c b/contrib/openpam/lib/openpam_dispatch.c
index 0ff6865..29f9138 100644
--- a/contrib/openpam/lib/openpam_dispatch.c
+++ b/contrib/openpam/lib/openpam_dispatch.c
@@ -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 <sys/param.h>
@@ -59,6 +59,9 @@ openpam_dispatch(pam_handle_t *pamh,
{
pam_chain_t *chain;
int err, fail, r;
+#ifdef DEBUG
+ int debug;
+#endif
ENTER();
if (pamh == NULL)
@@ -96,8 +99,6 @@ openpam_dispatch(pam_handle_t *pamh,
/* 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 @@ openpam_dispatch(pam_handle_t *pamh,
} 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)
OpenPOWER on IntegriCloud