821ffc
diff --git a/passwd.c b/passwd.c
821ffc
index 45acf02..27ad6fe 100644
821ffc
--- a/passwd.c
821ffc
+++ b/passwd.c
821ffc
@@ -63,7 +63,6 @@
821ffc
 #ifdef WITH_AUDIT
821ffc
 #include <libaudit.h>
821ffc
 #else
821ffc
-#define audit_log_user_message(d,ty,m,h,a,t,r) do { ; } while(0) 
821ffc
 #define audit_log_acct_message(d,ty,p,o,n,i,h,a,t,r) do { ; } while(0) 
821ffc
 static int audit_open(void) { errno = EPROTONOSUPPORT; return -1; } 
821ffc
 #endif
821ffc
@@ -274,13 +273,10 @@ parse_args(int argc, const char **argv,
821ffc
 	/* The only flag which unprivileged users get to use is -k. */
821ffc
 	if ((passwd_flags & ~PASSWD_KEEP) && 
821ffc
 	    (getuid() != 0)) {
821ffc
-		if (passwd_flags & PASSWD_STATUS) {
821ffc
+		/* Auditing is not needed for displaying status */
821ffc
+		if (passwd_flags != PASSWD_STATUS) {
821ffc
 			audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-				NULL, "password status display",
821ffc
-				NULL, getuid(), NULL, NULL, NULL, 0);
821ffc
-		} else {
821ffc
-			audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-				NULL, "password attribute change",
821ffc
+				NULL, "attempted-to-change-password-attribute",
821ffc
 				NULL, getuid(), NULL, NULL, NULL, 0);
821ffc
 		}
821ffc
 		fprintf(stderr, _("Only root can do that.\n"));
821ffc
@@ -293,8 +289,8 @@ parse_args(int argc, const char **argv,
821ffc
 		if (getuid() != 0) {
821ffc
 			/* The invoking user was not root. */
821ffc
 			audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-				NULL, "password change", extraArgs[0],
821ffc
-				getuid(), NULL, NULL, NULL, 0);
821ffc
+				NULL, "attempted-to-change-password",
821ffc
+				extraArgs[0], getuid(), NULL, NULL, NULL, 0);
821ffc
 			fprintf(stderr,
821ffc
 				_("%s: Only root can specify a user name.\n"),
821ffc
 				progname);
821ffc
@@ -392,7 +388,7 @@ main(int argc, const char **argv)
821ffc
 		fprintf(stderr, _("%s: SELinux denying access due to security policy.\n"), progname);
821ffc
 		
821ffc
 		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			NULL, "change password", NULL, pwd->pw_uid,
821ffc
+			NULL, "attempted-to-change-password", NULL, pwd->pw_uid,
821ffc
 			NULL, NULL, NULL, 0);
821ffc
 		exit(1);
821ffc
 	}
821ffc
@@ -404,8 +400,8 @@ main(int argc, const char **argv)
821ffc
 		printf("%s: %s\n", progname,
821ffc
 		       retval ==
821ffc
 		       0 ? _("Success") : _("Error (password not set?)"));
821ffc
-		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			NULL, "lock password", NULL, pwd->pw_uid,
821ffc
+		audit_log_acct_message(audit_fd, AUDIT_ACCT_LOCK,
821ffc
+			NULL, "locked-password", NULL, pwd->pw_uid,
821ffc
 			NULL, NULL, NULL, retval == 0);
821ffc
 		return retval;
821ffc
 	}
821ffc
@@ -419,8 +415,8 @@ main(int argc, const char **argv)
821ffc
 		       retval ==
821ffc
 		       -2 ? _("Unsafe operation (use -f to force)") :
821ffc
 		       _("Error (password not set?)"));
821ffc
-		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			NULL, "unlock password", NULL, pwd->pw_uid,
821ffc
+		audit_log_acct_message(audit_fd, AUDIT_ACCT_UNLOCK,
821ffc
+			NULL, "unlocked-password", NULL, pwd->pw_uid,
821ffc
 			NULL, NULL, NULL, retval == 0);
821ffc
 		return retval;
821ffc
 	}
821ffc
@@ -431,8 +427,8 @@ main(int argc, const char **argv)
821ffc
 		printf("%s: %s\n", progname,
821ffc
 		       retval ==
821ffc
 		       0 ? _("Success") : _("Error"));
821ffc
-		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			NULL, "expire password", NULL, pwd->pw_uid,
821ffc
+		audit_log_acct_message(audit_fd, AUDIT_USER_MGMT,
821ffc
+			NULL, "expired-password", NULL, pwd->pw_uid,
821ffc
 			NULL, NULL, NULL, retval == 0);
821ffc
 		return retval;
821ffc
 	}
821ffc
@@ -443,16 +439,14 @@ main(int argc, const char **argv)
821ffc
 		printf("%s: %s\n", progname,
821ffc
 		       (retval == 0) ? _("Success") : _("Error"));
821ffc
 		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			NULL, "delete password", NULL, pwd->pw_uid,
821ffc
+			NULL, "deleted-password", NULL, pwd->pw_uid,
821ffc
 			NULL, NULL, NULL, retval == 0);
821ffc
 		return retval;
821ffc
 	}
821ffc
 	/* Display account status. */
821ffc
 	if (passwd_flags & PASSWD_STATUS) {
821ffc
+		/* Auditing is not needed for displaying status */
821ffc
 		retval = pwdb_display_status(username);
821ffc
-		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			NULL, "password status displayed for user",
821ffc
-			NULL, pwd->pw_uid, NULL, NULL, NULL, retval == 0);
821ffc
 		return retval;
821ffc
 	}
821ffc
 	/* Adjust aging parameters. */
821ffc
@@ -462,12 +456,12 @@ main(int argc, const char **argv)
821ffc
 		retval = pwdb_update_aging(username, min, max, warn, inact, -2);
821ffc
 		printf("%s: %s\n", progname,
821ffc
 		       (retval == 0) ? _("Success") : _("Error"));
821ffc
-		snprintf(aubuf, sizeof(aubuf), "password aging data updated "
821ffc
-				"- acct=%s, uid=%u, min=%li, max=%li,"
821ffc
-				" warn=%li, inact=%li", username, 
821ffc
-				pwd->pw_uid, min, max, warn, inact);
821ffc
-		audit_log_user_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-			aubuf, NULL, NULL, NULL, retval == 0);
821ffc
+		snprintf(aubuf, sizeof(aubuf), "changed-password-aging"
821ffc
+				" min=%li max=%li warn=%li inact=%li",
821ffc
+				min, max, warn, inact);
821ffc
+		audit_log_acct_message(audit_fd,  AUDIT_USER_MGMT,
821ffc
+			NULL, aubuf, NULL, pwd->pw_uid,
821ffc
+			NULL, NULL, NULL, retval == 0);
821ffc
 		return retval;
821ffc
 	}
821ffc
 
821ffc
@@ -548,33 +542,22 @@ main(int argc, const char **argv)
821ffc
 	}
821ffc
 #endif
821ffc
 
821ffc
-	/* Go for it. */
821ffc
+	/* Go for it. Note: pam will send audit event. */
821ffc
 	retval = pam_chauthtok(pamh,
821ffc
 			       (passwd_flags & PASSWD_KEEP) ?
821ffc
 			       PAM_CHANGE_EXPIRED_AUTHTOK : 0);
821ffc
 	if (retval == PAM_SUCCESS) {
821ffc
 		/* We're done.  Tell the invoking user that it worked. */
821ffc
 		retval = pam_end(pamh, PAM_SUCCESS);
821ffc
-		if (passwd_flags & PASSWD_KEEP) {
821ffc
-			audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-				NULL, "change expired password", NULL,
821ffc
-				pwd->pw_uid, NULL, NULL, NULL,
821ffc
-				retval == PAM_SUCCESS);
821ffc
+		if (passwd_flags & PASSWD_KEEP)
821ffc
 			printf(_("%s: expired authentication tokens updated successfully.\n"),
821ffc
 				progname);
821ffc
-		} else {
821ffc
-			audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-				NULL, "change password", NULL, pwd->pw_uid,
821ffc
-				NULL, NULL, NULL, retval == PAM_SUCCESS);
821ffc
+		else
821ffc
 			printf(_("%s: all authentication tokens updated successfully.\n"),
821ffc
 				progname);
821ffc
-		}
821ffc
 		retval = 0;
821ffc
 	} else {
821ffc
 		/* Horrors!  It failed.  Relay the bad news. */
821ffc
-		audit_log_acct_message(audit_fd,  AUDIT_USER_CHAUTHTOK,
821ffc
-				NULL, "change password", NULL, pwd->pw_uid,
821ffc
-				NULL, NULL, NULL, retval == PAM_SUCCESS);
821ffc
 		fprintf(stderr, "%s: %s\n", progname,
821ffc
 			pam_strerror(pamh, retval));
821ffc
 		pam_end(pamh, retval);