Blame SOURCES/shadow-4.1.5.1-audit-owner.patch

9f90df
diff -up shadow-4.1.5.1/src/usermod.c.audit shadow-4.1.5.1/src/usermod.c
9f90df
--- shadow-4.1.5.1/src/usermod.c.audit	2011-11-21 23:02:16.000000000 +0100
9f90df
+++ shadow-4.1.5.1/src/usermod.c	2013-06-14 14:54:20.237026550 +0200
9f90df
@@ -1513,6 +1513,14 @@ static void move_home (void)
9f90df
 			fail_exit (E_HOMEDIR);
9f90df
 		}
9f90df
 
9f90df
+#ifdef WITH_AUDIT
9f90df
+		if (uflg || gflg) {
9f90df
+			audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
9f90df
+				      "changing home directory owner",
9f90df
+				      user_newname, (unsigned int) user_newid, 1);
9f90df
+		}
9f90df
+#endif
9f90df
+
9f90df
 		if (rename (user_home, user_newhome) == 0) {
9f90df
 			/* FIXME: rename above may have broken symlinks
9f90df
 			 *        pointing to the user's home directory
9f90df
@@ -1947,6 +1955,13 @@ int main (int argc, char **argv)
9f90df
 			 * ownership.
9f90df
 			 *
9f90df
 			 */
9f90df
+#ifdef WITH_AUDIT
9f90df
+			if (uflg || gflg) {
9f90df
+				audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
9f90df
+					      "changing home directory owner",
9f90df
+					      user_newname, (unsigned int) user_newid, 1);
9f90df
+			}
9f90df
+#endif
9f90df
 			if (chown_tree (dflg ? user_newhome : user_home,
9f90df
 			                user_id,
9f90df
 			                uflg ? user_newid  : (uid_t)-1,