summaryrefslogtreecommitdiff
path: root/modules/pam_unix/pam_unix_sess.c
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2000-12-20 05:15:05 +0000
committerSteve Langasek <vorlon@debian.org>2000-12-20 05:15:05 +0000
commit38da6ae394a4b2f18e210369562928dc0e404f54 (patch)
treed5ee266e4c99c2a950ec6ad7fabc016c140a66c0 /modules/pam_unix/pam_unix_sess.c
parente23b51cda072fbd6fc65f5ff43d196eeea28cac5 (diff)
Relevant BUGIDs: 126431, 126423
Purpose of commit: new feature / bugfix Commit summary: --------------- This changes the format of pam_unix log messages, per bug 126423. The change is extensive (every call to _log_err() now has an additional argument) but straightforward. These changes to the logging code incidentally fix the problem reported in bug 126431.
Diffstat (limited to 'modules/pam_unix/pam_unix_sess.c')
-rw-r--r--modules/pam_unix/pam_unix_sess.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/modules/pam_unix/pam_unix_sess.c b/modules/pam_unix/pam_unix_sess.c
index e97bc1f0..faef3e42 100644
--- a/modules/pam_unix/pam_unix_sess.c
+++ b/modules/pam_unix/pam_unix_sess.c
@@ -74,21 +74,23 @@ PAM_EXTERN int pam_sm_open_session(pam_handle_t * pamh, int flags,
D(("called."));
- ctrl = _set_ctrl(flags, NULL, argc, argv);
+ ctrl = _set_ctrl(pamh, flags, NULL, argc, argv);
retval = pam_get_item(pamh, PAM_USER, (void *) &user_name);
if (user_name == NULL || retval != PAM_SUCCESS) {
- _log_err(LOG_CRIT, "open_session - error recovering username");
+ _log_err(LOG_CRIT, pamh,
+ "open_session - error recovering username");
return PAM_SESSION_ERR; /* How did we get authenticated with
no username?! */
}
retval = pam_get_item(pamh, PAM_SERVICE, (void *) &service);
if (service == NULL || retval != PAM_SUCCESS) {
- _log_err(LOG_CRIT, "open_session - error recovering service");
+ _log_err(LOG_CRIT, pamh,
+ "open_session - error recovering service");
return PAM_SESSION_ERR;
}
- _log_err(LOG_INFO, "(%s) session opened for user %s by %s(uid=%d)"
- ,service, user_name
+ _log_err(LOG_INFO, pamh, "session opened for user %s by %s(uid=%d)"
+ ,user_name
,PAM_getlogin() == NULL ? "" : PAM_getlogin(), getuid());
return PAM_SUCCESS;
@@ -103,21 +105,23 @@ PAM_EXTERN int pam_sm_close_session(pam_handle_t * pamh, int flags,
D(("called."));
- ctrl = _set_ctrl(flags, NULL, argc, argv);
+ ctrl = _set_ctrl(pamh, flags, NULL, argc, argv);
retval = pam_get_item(pamh, PAM_USER, (void *) &user_name);
if (user_name == NULL || retval != PAM_SUCCESS) {
- _log_err(LOG_CRIT, "close_session - error recovering username");
+ _log_err(LOG_CRIT, pamh,
+ "close_session - error recovering username");
return PAM_SESSION_ERR; /* How did we get authenticated with
no username?! */
}
retval = pam_get_item(pamh, PAM_SERVICE, (void *) &service);
if (service == NULL || retval != PAM_SUCCESS) {
- _log_err(LOG_CRIT, "close_session - error recovering service");
+ _log_err(LOG_CRIT, pamh,
+ "close_session - error recovering service");
return PAM_SESSION_ERR;
}
- _log_err(LOG_INFO, "(%s) session closed for user %s"
- ,service, user_name);
+ _log_err(LOG_INFO, pamh, "session closed for user %s"
+ ,user_name);
return PAM_SUCCESS;
}