|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
9471b77 |
diff -up ecryptfs-utils-108/src/pam_ecryptfs/pam_ecryptfs.c.fixpamfork ecryptfs-utils-108/src/pam_ecryptfs/pam_ecryptfs.c
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
9471b77 |
--- ecryptfs-utils-108/src/pam_ecryptfs/pam_ecryptfs.c.fixpamfork 2015-08-11 14:43:58.438825091 +0200
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
9471b77 |
+++ ecryptfs-utils-108/src/pam_ecryptfs/pam_ecryptfs.c 2015-08-11 14:43:58.439825089 +0200
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
@@ -253,7 +253,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
out_child:
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
free(auth_tok_sig);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
- exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
+ _exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
tmp_pid = waitpid(child_pid, NULL, 0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
if (tmp_pid == -1)
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
@@ -349,7 +349,7 @@ static int private_dir(pam_handle_t *pam
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
7731a01 |
"%s/.ecryptfs/.wrapped-passphrase.recorded",
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
pwd->pw_dir) < 0) || recorded == NULL) {
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
7731a01 |
syslog(LOG_ERR, "pam_ecryptfs: Error allocating memory for recorded name");
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
6154d2a |
- exit(1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
+ _exit(255);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
if (stat(recorded, &s) != 0 && stat("/usr/share/ecryptfs-utils/ecryptfs-record-passphrase", &s) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
/* User has not recorded their passphrase */
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
@@ -362,33 +362,35 @@ static int private_dir(pam_handle_t *pam
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
7731a01 |
if (stat(autofile, &s) != 0) {
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
/* User does not want to auto-mount */
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
7731a01 |
syslog(LOG_DEBUG, "pam_ecryptfs: Skipping automatic eCryptfs mount");
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
6154d2a |
- exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
+ _exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
538c2f1 |
clearenv();
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
538c2f1 |
if (setgroups(1, &pwd->pw_gid) < 0 || setgid(pwd->pw_gid) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
- exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
+ _exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
/* run mount.ecryptfs_private as the user */
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
538c2f1 |
if (setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
- exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
+ _exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
execl("/sbin/mount.ecryptfs_private",
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
"mount.ecryptfs_private", NULL);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
+ syslog(LOG_ERR, "unable to execute mount.ecryptfs_private : %m");
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
} else {
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
if (stat(autofile, &s) != 0) {
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
/* User does not want to auto-unmount */
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
7731a01 |
syslog(LOG_DEBUG, "pam_ecryptfs: Skipping automatic eCryptfs unmount");
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
6154d2a |
- exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
+ _exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
538c2f1 |
clearenv();
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
538c2f1 |
if (setgroups(1, &pwd->pw_gid) < 0 || setgid(pwd->pw_gid) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
- exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
+ _exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
/* run umount.ecryptfs_private as the user */
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
538c2f1 |
if (setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
- exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
+ _exit(-1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
execl("/sbin/umount.ecryptfs_private",
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
9471b77 |
"umount.ecryptfs_private", "-d", NULL);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
6154d2a |
- exit(1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
+ syslog(LOG_ERR, "unable to execute umount.ecryptfs_private : %m");
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
9471b77 |
+ _exit(1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
6154d2a |
- exit(1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
9471b77 |
+ _exit(1);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
} else {
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
be2a3c9 |
waitpid(pid, &rc, 0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
6154d2a |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
0d13c93 |
@@ -536,7 +538,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_hand
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
goto out_child;
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
out_child:
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
- exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
+ _exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
bbbcbd5 |
if ((tmp_pid = waitpid(child_pid, NULL, 0)) == -1)
|
|
![](https://seccdn.libravatar.org/avatar/61a12734645841e91723eabc6bd107c284a53a31f5e482f6ca304be5cbc5209c?s=16&d=retro) |
7731a01 |
syslog(LOG_WARNING, "pam_ecryptfs: waitpid() returned with error condition\n");
|