File pwdutils-selinux-useradd.patch of Package pwdutils
--- etc/useradd.local
+++ etc/useradd.local 2008/11/11 09:40:42
@@ -17,6 +17,22 @@
# Update NIS database
# make -C /var/yp
+# If SELinux is enabled, we have to run restorecon to assign
+# appropriate fcontexts to the respective $HOME and files under it
+
+test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled || exit 0
+test -x /sbin/restorecon || exit 2
+
+if [ $# -lt 4 ]; then
+ home_dir=/home/$1
+else
+ home_dir=$4
+fi
+
+if [ -d $home_dir ]; then
+ /sbin/restorecon -R $home_dir
+fi
+
# All done.
exit 0