Blame ecryptfs-utils-96-groupcheck.patch

9471b7
diff -up ecryptfs-utils-108/src/utils/ecryptfs-mount-private.groupcheck ecryptfs-utils-108/src/utils/ecryptfs-mount-private
9471b7
--- ecryptfs-utils-108/src/utils/ecryptfs-mount-private.groupcheck	2015-08-11 14:44:03.505811744 +0200
9471b7
+++ ecryptfs-utils-108/src/utils/ecryptfs-mount-private	2015-08-11 14:44:03.524811694 +0200
16d05b
@@ -69,7 +69,16 @@ if [ -f "$WRAPPED_PASSPHRASE_FILE" -a -f
16d05b
 		echo `gettext "ERROR:"` `gettext "Too many incorrect password attempts, exiting"`
16d05b
 		exit 1
16d05b
 	fi
16d05b
-	/sbin/mount.ecryptfs_private
16d05b
+	if ! /sbin/mount.ecryptfs_private;
16d05b
+	then
16d05b
+		# Check if the ecryptfs group exists, and user is member of ecryptfs group
16d05b
+		if grep -qs "^ecryptfs:" /etc/group; then
16d05b
+		        if ! id "$USER" | grep -qs "\(ecryptfs\)"; then
16d05b
+	                       echo $(gettext 'ERROR: ') $(gettext 'User needs to be a member of ecryptfs group')
16d05b
+                               exit 1
16d05b
+		        fi
16d05b
+		fi
16d05b
+	fi
16d05b
 else
16d05b
 	echo `gettext "ERROR:"` `gettext "Encrypted private directory is not setup properly"`
16d05b
 	exit 1