summaryrefslogtreecommitdiff
path: root/modules/pam_tty_audit/pam_tty_audit.c
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2013-09-25 12:40:05 +0200
committerTomas Mraz <tmraz@fedoraproject.org>2013-09-25 12:40:05 +0200
commitc5f829931a22c65feffee16570efdae036524bee (patch)
tree6133480bbb28eee044a32034c5d8ec0f0e61ca5e /modules/pam_tty_audit/pam_tty_audit.c
parent9af03209b998e7aba5a28fdfaa7da4b7e96c5c6f (diff)
Fix pam_tty_audit log_passwd support and regression.
modules/pam_tty_audit/pam_tty_audit.c: Add missing "config.h" include. (pam_sm_open_session): Always copy the old status as initialization of new.
Diffstat (limited to 'modules/pam_tty_audit/pam_tty_audit.c')
-rw-r--r--modules/pam_tty_audit/pam_tty_audit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/pam_tty_audit/pam_tty_audit.c b/modules/pam_tty_audit/pam_tty_audit.c
index 7dc37395..cc862550 100644
--- a/modules/pam_tty_audit/pam_tty_audit.c
+++ b/modules/pam_tty_audit/pam_tty_audit.c
@@ -36,6 +36,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. */
+#include "config.h"
#include <errno.h>
#include <fnmatch.h>
#include <stdlib.h>
@@ -275,6 +276,8 @@ pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char **argv)
return PAM_SESSION_ERR;
}
+ memcpy(&new_status, old_status, sizeof(new_status));
+
new_status.enabled = (command == CMD_ENABLE ? 1 : 0);
#ifdef HAVE_STRUCT_AUDIT_TTY_STATUS_LOG_PASSWD
new_status.log_passwd = log_passwd;