Blame ecryptfs-utils-87-fixexecgid.patch

be2a3c
diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.fixexecgid ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c
392807
--- ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.fixexecgid	2011-07-25 16:38:48.040555555 +0200
392807
+++ ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c	2011-07-25 16:52:22.751025667 +0200
be2a3c
@@ -33,6 +33,7 @@
be2a3c
 #include <errno.h>
be2a3c
 #include <syslog.h>
be2a3c
 #include <pwd.h>
be2a3c
+#include <grp.h>
be2a3c
 #include <sys/types.h>
be2a3c
 #include <sys/wait.h>
be2a3c
 #include <sys/types.h>
8b5695
@@ -303,6 +304,12 @@ static int private_dir(pam_handle_t *pam
be2a3c
 		return 1;
be2a3c
 	}
be2a3c
 	if (pid == 0) {
8b5695
+		/* set user's groups, we may need ecryptfs group for (u)mount */
8b5695
+		if (initgroups(pwd->pw_name, pwd->pw_gid) != 0) {
8b5695
+			syslog(LOG_ERR, "Unable to set user's groups : %m");
392807
+			_exit(255);
be2a3c
+		}
be2a3c
+
be2a3c
 		if (mount == 1) {
be2a3c
 		        if ((asprintf(&recorded,
be2a3c
 			    "%s/.ecryptfs/.wrapped-passphrase.recorded",