9471b77
diff -up ecryptfs-utils-108/src/utils/ecryptfs-migrate-home.selinux ecryptfs-utils-108/src/utils/ecryptfs-migrate-home
9471b77
--- ecryptfs-utils-108/src/utils/ecryptfs-migrate-home.selinux	2015-08-11 14:44:04.362809487 +0200
9471b77
+++ ecryptfs-utils-108/src/utils/ecryptfs-migrate-home	2015-08-11 14:44:04.377809448 +0200
538c2f1
@@ -136,6 +136,7 @@ encrypt_dir () {
538c2f1
 		error "Cannot proceed."
538c2f1
 	fi
538c2f1
 	# start encryption
6c611ca
+	[[ "$(getsebool use_ecryptfs_home_dirs 2>/dev/null)" =~ off$ ]] && setsebool -P use_ecryptfs_home_dirs=1 1>/dev/null 2>&1 ||:
538c2f1
 	orig=$(mktemp /home/$USER_NAME.XXXXXXXX)
538c2f1
 	rm "$orig" && mv "$USER_HOME" "$orig"
538c2f1
 	chmod 700 "$orig"
5d5bca4
@@ -158,8 +159,12 @@ encrypt_dir () {
538c2f1
 	fi
538c2f1
 	info "Encrypted home has been set up, encrypting files now...this may take a while."
538c2f1
 	# Show progress, but on stderr, in case the user wants to filter that out
538c2f1
+	semanage fcontext -a -e /home /home/.ecryptfs >/dev/null 2>&1 ||:
5d5bca4
+	restorecon /home/.ecryptfs/ /home/.ecryptfs/$USER_NAME >/dev/null 2>&1 ||:
538c2f1
 	rsync -aP "$orig/" "$USER_HOME/" 1>&2
5d5bca4
+	restorecon -R /home/.ecryptfs/$USER_NAME >/dev/null 2>&1 ||:
538c2f1
 	umount "$USER_HOME/"
5d5bca4
+	restorecon -R "$USER_HOME" >/dev/null 2>&1 ||:
538c2f1
 	echo
5d5bca4
 	echo "========================================================================"
5d5bca4
 	echo "Some Important Notes!"