Skip to content

Commit

Permalink
Avoid duplicate PAM log message
Browse files Browse the repository at this point in the history
This removes a duplicate call to _log_msg() when a user's access is
denied or "no_sys_info" command line option is NOT set. The duplicate
log message was a result of commit 12ba7f7
on January 29, 2010. Patch from Mark Grondona, LLNL.
  • Loading branch information
jette committed Sep 7, 2011
1 parent 7423c5d commit 9258bcf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contribs/pam/pam_slurm.c
Expand Up @@ -136,13 +136,16 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv)

if ((auth != PAM_SUCCESS) && (!opts.enable_silence))
_send_denial_msg(pamh, &opts, user, uid);

/*
* Generate an entry to the system log if access was
* denied (!PAM_SUCCESS) or disable_sys_info is not set
*/
if ((auth != PAM_SUCCESS) || (!opts.disable_sys_info)) {
_log_msg(LOG_INFO, "access %s for user %s (uid=%d)",
(auth == PAM_SUCCESS) ? "granted" : "denied",
user, uid);
}
_log_msg(LOG_INFO, "access %s for user %s (uid=%d)",
(auth == PAM_SUCCESS) ? "granted" : "denied", user, uid);

return(auth);
}
Expand Down

0 comments on commit 9258bcf

Please sign in to comment.