From 5abc6729b8abec8c6c978428b0421ae6d1e03fb0 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 30 Aug 2007 00:11:15 +0000 Subject: Relevant BUGIDs: Debian bug #84428 Purpose of commit: new feature Commit summary: --------------- 2007-08-29 Steve Langasek * modules/pam_listfile/pam_listfile.c, modules/pam_listfile/README, modules/pam_listfile/pam_listfile.8, modules/pam_listfile/pam_listfile.8.xml: add a 'quiet' option to avoid logging errors any time a user is refused service by this module. --- modules/pam_listfile/pam_listfile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/pam_listfile/pam_listfile.c') diff --git a/modules/pam_listfile/pam_listfile.c b/modules/pam_listfile/pam_listfile.c index 1545fe03..f276e5b8 100644 --- a/modules/pam_listfile/pam_listfile.c +++ b/modules/pam_listfile/pam_listfile.c @@ -68,7 +68,7 @@ PAM_EXTERN int pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, int argc, const char **argv) { - int retval, i, citem=0, extitem=0, onerr=PAM_SERVICE_ERR, sense=2; + int retval, i, citem=0, extitem=0, onerr=PAM_SERVICE_ERR, sense=2, quiet=0; const void *void_citemp; const char *citemp; char *ifname=NULL; @@ -155,6 +155,8 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, apply_type=APPLY_TYPE_USER; strncpy(apply_val,myval,sizeof(apply_val)-1); } + } else if (!strcmp(mybuf,"quiet")) { + quiet = 1; } else { free(ifname); pam_syslog(pamh,LOG_ERR, "Unknown option: %s",mybuf); @@ -399,8 +401,9 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, #endif (void) pam_get_item(pamh, PAM_SERVICE, &service); (void) pam_get_user(pamh, &user_name, NULL); - pam_syslog (pamh, LOG_ALERT, "Refused user %s for service %s", - user_name, (const char *)service); + if (!quiet) + pam_syslog (pamh, LOG_ALERT, "Refused user %s for service %s", + user_name, (const char *)service); return PAM_AUTH_ERR; } } -- cgit v1.2.3