Blame ecryptfs-utils-99-selinux.patch

538c2f
diff -up ecryptfs-utils-99/src/utils/ecryptfs-migrate-home.selinux ecryptfs-utils-99/src/utils/ecryptfs-migrate-home
538c2f
--- ecryptfs-utils-99/src/utils/ecryptfs-migrate-home.selinux	2012-07-24 14:35:28.428669924 +0200
538c2f
+++ ecryptfs-utils-99/src/utils/ecryptfs-migrate-home	2012-07-24 14:48:22.656139924 +0200
538c2f
@@ -136,6 +136,7 @@ encrypt_dir () {
538c2f
 		error "Cannot proceed."
538c2f
 	fi
538c2f
 	# start encryption
538c2f
+	setsebool -P use_ecryptfs_home_dirs=1 1>/dev/null 2>&1 ||:
538c2f
 	orig=$(mktemp /home/$USER_NAME.XXXXXXXX)
538c2f
 	rm "$orig" && mv "$USER_HOME" "$orig"
538c2f
 	chmod 700 "$orig"
538c2f
@@ -158,6 +159,8 @@ encrypt_dir () {
538c2f
 	fi
538c2f
 	info "Encrypted home has been set up, encrypting files now...this may take a while."
538c2f
 	# Show progress, but on stderr, in case the user wants to filter that out
538c2f
+	semanage fcontext -a -e /home /home/.ecryptfs >/dev/null 2>&1 ||:
8f436f
+	restorecon -R $HOME/.ecryptfs/$USER >/dev/null 2>&1 ||:
538c2f
 	rsync -aP "$orig/" "$USER_HOME/" 1>&2
538c2f
 	umount "$USER_HOME/"
538c2f
 	echo