Blame ecryptfs-utils-96-groupcheck.patch

16d05b
diff -up ecryptfs-utils-96/src/utils/ecryptfs-mount-private.groupcheck ecryptfs-utils-96/src/utils/ecryptfs-mount-private
16d05b
--- ecryptfs-utils-96/src/utils/ecryptfs-mount-private.groupcheck	2012-04-16 14:42:56.386317997 +0200
16d05b
+++ ecryptfs-utils-96/src/utils/ecryptfs-mount-private	2012-04-16 14:49:13.637431764 +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