Blame ecryptfs-utils-87-fixexecgid.patch
|
|
0d13c9 |
diff -up ecryptfs-utils-106/src/pam_ecryptfs/pam_ecryptfs.c.fixexecgid ecryptfs-utils-106/src/pam_ecryptfs/pam_ecryptfs.c
|
|
|
0d13c9 |
--- ecryptfs-utils-106/src/pam_ecryptfs/pam_ecryptfs.c.fixexecgid 2015-03-30 11:13:48.419194024 +0200
|
|
|
0d13c9 |
+++ ecryptfs-utils-106/src/pam_ecryptfs/pam_ecryptfs.c 2015-03-30 11:16:44.434863028 +0200
|
|
|
0d13c9 |
@@ -365,8 +365,10 @@ static int private_dir(pam_handle_t *pam
|
|
|
538c2f |
_exit(0);
|
|
|
538c2f |
}
|
|
|
538c2f |
clearenv();
|
|
|
538c2f |
- if (setgroups(1, &pwd->pw_gid) < 0 || setgid(pwd->pw_gid) < 0)
|
|
|
538c2f |
+ if (initgroups(pwd->pw_name, pwd->pw_gid) != 0) {
|
|
|
538c2f |
+ syslog(LOG_ERR, "Unable to set user's groups : %m");
|
|
|
0d13c9 |
_exit(-1);
|
|
|
538c2f |
+ }
|
|
|
538c2f |
/* run mount.ecryptfs_private as the user */
|
|
|
538c2f |
if (setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid) < 0)
|
|
|
0d13c9 |
_exit(-1);
|
|
|
0d13c9 |
@@ -380,8 +382,10 @@ static int private_dir(pam_handle_t *pam
|
|
|
538c2f |
_exit(0);
|
|
|
538c2f |
}
|
|
|
538c2f |
clearenv();
|
|
|
538c2f |
- if (setgroups(1, &pwd->pw_gid) < 0 || setgid(pwd->pw_gid) < 0)
|
|
|
538c2f |
+ if (initgroups(pwd->pw_name, pwd->pw_gid) != 0) {
|
|
|
538c2f |
+ syslog(LOG_ERR, "Unable to set user's groups : %m");
|
|
|
0d13c9 |
_exit(-1);
|
|
|
538c2f |
+ }
|
|
|
538c2f |
/* run umount.ecryptfs_private as the user */
|
|
|
538c2f |
if (setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid) < 0)
|
|
|
0d13c9 |
_exit(-1);
|