|
|
7731a0 |
diff -up ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c.fixpamfork ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c
|
|
|
7731a0 |
--- ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c.fixpamfork 2011-10-31 13:44:28.643925611 +0100
|
|
|
7731a0 |
+++ ecryptfs-utils-93/src/pam_ecryptfs/pam_ecryptfs.c 2011-10-31 13:46:48.627152400 +0100
|
|
|
7731a0 |
@@ -207,7 +207,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
out_child:
|
|
|
bbbcbd |
free(auth_tok_sig);
|
|
|
bbbcbd |
- exit(0);
|
|
|
bbbcbd |
+ _exit(0);
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
tmp_pid = waitpid(child_pid, NULL, 0);
|
|
|
bbbcbd |
if (tmp_pid == -1)
|
|
|
7731a0 |
@@ -295,7 +295,7 @@ static int private_dir(pam_handle_t *pam
|
|
|
7731a0 |
"%s/.ecryptfs/.wrapped-passphrase.recorded",
|
|
|
bbbcbd |
pwd->pw_dir) < 0) || recorded == NULL) {
|
|
|
7731a0 |
syslog(LOG_ERR, "pam_ecryptfs: Error allocating memory for recorded name");
|
|
|
bbbcbd |
- return 1;
|
|
|
bbbcbd |
+ _exit(255);
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
if (stat(recorded, &s) != 0 && stat("/usr/share/ecryptfs-utils/ecryptfs-record-passphrase", &s) == 0) {
|
|
|
bbbcbd |
/* User has not recorded their passphrase */
|
|
|
7731a0 |
@@ -307,24 +307,26 @@ static int private_dir(pam_handle_t *pam
|
|
|
7731a0 |
if (stat(autofile, &s) != 0) {
|
|
|
bbbcbd |
/* User does not want to auto-mount */
|
|
|
7731a0 |
syslog(LOG_DEBUG, "pam_ecryptfs: Skipping automatic eCryptfs mount");
|
|
|
bbbcbd |
- return 0;
|
|
|
bbbcbd |
+ _exit(0);
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
/* run mount.ecryptfs_private as the user */
|
|
|
bbbcbd |
setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid);
|
|
|
bbbcbd |
execl("/sbin/mount.ecryptfs_private",
|
|
|
bbbcbd |
"mount.ecryptfs_private", NULL);
|
|
|
be2a3c |
+ syslog(LOG_ERR,"unable to execute mount.ecryptfs_private : %m");
|
|
|
bbbcbd |
} else {
|
|
|
bbbcbd |
if (stat(autofile, &s) != 0) {
|
|
|
bbbcbd |
/* User does not want to auto-unmount */
|
|
|
7731a0 |
syslog(LOG_DEBUG, "pam_ecryptfs: Skipping automatic eCryptfs unmount");
|
|
|
bbbcbd |
- return 0;
|
|
|
bbbcbd |
+ _exit(0);
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
/* run umount.ecryptfs_private as the user */
|
|
|
bbbcbd |
setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid);
|
|
|
bbbcbd |
execl("/sbin/umount.ecryptfs_private",
|
|
|
bbbcbd |
"umount.ecryptfs_private", NULL);
|
|
|
be2a3c |
+ syslog(LOG_ERR,"unable to execute umount.ecryptfs_private : %m");
|
|
|
bbbcbd |
}
|
|
|
be2a3c |
- return 1;
|
|
|
be2a3c |
+ _exit(255);
|
|
|
bbbcbd |
} else {
|
|
|
be2a3c |
waitpid(pid, &rc, 0);
|
|
|
be2a3c |
goto out;
|
|
|
7731a0 |
@@ -455,7 +457,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_hand
|
|
|
bbbcbd |
goto out_child;
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
out_child:
|
|
|
bbbcbd |
- exit(0);
|
|
|
bbbcbd |
+ _exit(0);
|
|
|
bbbcbd |
}
|
|
|
bbbcbd |
if ((tmp_pid = waitpid(child_pid, NULL, 0)) == -1)
|
|
|
7731a0 |
syslog(LOG_WARNING, "pam_ecryptfs: waitpid() returned with error condition\n");
|