summaryrefslogtreecommitdiff
path: root/modules/pam_unix/pam_unix_sess.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2015-04-23 16:04:32 +0200
committerThorsten Kukuk <kukuk@thkukuk.de>2015-04-23 16:04:32 +0200
commitaa7acd0d8ab1cba8e079ee2b801c944896d2638b (patch)
tree02db6b6793ba07239d0f1549be61d62ebc8ff2c2 /modules/pam_unix/pam_unix_sess.c
parentedcd6ce3a097c9b813909186dcb4accc35e604ef (diff)
Add "quiet" option to pam_unix to suppress informential info
messages from session. * modules/pam_unix/pam_unix.8.xml: Document new option. * modules/pam_unix/support.h: Add quiet option. * modules/pam_unix/pam_unix_sess.c: Don't print LOG_INFO messages if 'quiet' option is set.
Diffstat (limited to 'modules/pam_unix/pam_unix_sess.c')
-rw-r--r--modules/pam_unix/pam_unix_sess.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/pam_unix/pam_unix_sess.c b/modules/pam_unix/pam_unix_sess.c
index d1376732..5d001816 100644
--- a/modules/pam_unix/pam_unix_sess.c
+++ b/modules/pam_unix/pam_unix_sess.c
@@ -96,8 +96,9 @@ pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
if (login_name == NULL) {
login_name = "";
}
- pam_syslog(pamh, LOG_INFO, "session opened for user %s by %s(uid=%lu)",
- user_name, login_name, (unsigned long)getuid());
+ if (off (UNIX_QUIET, ctrl))
+ pam_syslog(pamh, LOG_INFO, "session opened for user %s by %s(uid=%lu)",
+ user_name, login_name, (unsigned long)getuid());
return PAM_SUCCESS;
}
@@ -126,8 +127,9 @@ pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
"close_session - error recovering service");
return PAM_SESSION_ERR;
}
- pam_syslog(pamh, LOG_INFO, "session closed for user %s",
- user_name);
+ if (off (UNIX_QUIET, ctrl))
+ pam_syslog(pamh, LOG_INFO, "session closed for user %s",
+ user_name);
return PAM_SUCCESS;
}