Blob Blame History Raw
diff -up ecryptfs-utils-103/src/utils/ecryptfs-migrate-home.selinux ecryptfs-utils-103/src/utils/ecryptfs-migrate-home
--- ecryptfs-utils-103/src/utils/ecryptfs-migrate-home.selinux	2013-11-13 13:29:25.676878706 +0100
+++ ecryptfs-utils-103/src/utils/ecryptfs-migrate-home	2013-11-13 13:30:16.557552704 +0100
@@ -136,6 +136,7 @@ encrypt_dir () {
 		error "Cannot proceed."
 	fi
 	# start encryption
+	[[ "$(getsebool use_ecryptfs_home_dirs 2>/dev/null)" =~ off$ ]] && setsebool -P use_ecryptfs_home_dirs=1 1>/dev/null 2>&1 ||:
 	orig=$(mktemp /home/$USER_NAME.XXXXXXXX)
 	rm "$orig" && mv "$USER_HOME" "$orig"
 	chmod 700 "$orig"
@@ -158,8 +159,12 @@ encrypt_dir () {
 	fi
 	info "Encrypted home has been set up, encrypting files now...this may take a while."
 	# Show progress, but on stderr, in case the user wants to filter that out
+	semanage fcontext -a -e /home /home/.ecryptfs >/dev/null 2>&1 ||:
+	restorecon /home/.ecryptfs/ /home/.ecryptfs/$USER_NAME >/dev/null 2>&1 ||:
 	rsync -aP "$orig/" "$USER_HOME/" 1>&2
+	restorecon -R /home/.ecryptfs/$USER_NAME >/dev/null 2>&1 ||:
 	umount "$USER_HOME/"
+	restorecon -R "$USER_HOME" >/dev/null 2>&1 ||:
 	echo
 	echo "========================================================================"
 	echo "Some Important Notes!"