Blob Blame History Raw
diff -up ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.fixgid ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c
--- ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c.fixgid	2011-07-21 13:35:47.968581526 +0200
+++ ecryptfs-utils-87/src/pam_ecryptfs/pam_ecryptfs.c	2011-07-21 13:37:08.411188936 +0200
@@ -217,7 +217,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_h
 		}
 out_child:
 		free(auth_tok_sig);
-		exit(0);
+		_exit(0);
 	}
 	tmp_pid = waitpid(child_pid, NULL, 0);
 	if (tmp_pid == -1)
@@ -309,7 +309,7 @@ static int private_dir(pam_handle_t *pam
 			    pwd->pw_dir) < 0) || recorded == NULL) {
 				syslog(LOG_ERR,
 				   "Error allocating memory for recorded name");
-				return 1;
+				_exit(255);
 			}
 			if (stat(recorded, &s) != 0 && stat("/usr/share/ecryptfs-utils/ecryptfs-record-passphrase", &s) == 0) {
 				/* User has not recorded their passphrase */
@@ -322,25 +322,27 @@ static int private_dir(pam_handle_t *pam
 				/* User does not want to auto-mount */
 				syslog(LOG_INFO,
 					"Skipping automatic eCryptfs mount");
-				return 0;
+				_exit(0);
 			}
 			/* run mount.ecryptfs_private as the user */
 			setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid);
 			execl("/sbin/mount.ecryptfs_private",
 			      "mount.ecryptfs_private", NULL);
+			syslog(LOG_ERR,"unable to execute mount.ecryptfs_private : %m");
 		} else {
 			if (stat(autofile, &s) != 0) {
 				/* User does not want to auto-unmount */
 				syslog(LOG_INFO,
 					"Skipping automatic eCryptfs unmount");
-				return 0;
+				_exit(0);
 			}
 			/* run umount.ecryptfs_private as the user */
 			setresuid(pwd->pw_uid, pwd->pw_uid, pwd->pw_uid);
 			execl("/sbin/umount.ecryptfs_private",
  			      "umount.ecryptfs_private", NULL);
+			syslog(LOG_ERR,"unable to execute umount.ecryptfs_private : %m");
 		}
-		return 1;
+		_exit(255);
 	} else {
 		waitpid(pid, &rc, 0);
 		goto out;
@@ -482,7 +484,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_hand
 			goto out_child;
 		}
 out_child:
-		exit(0);
+		_exit(0);
 	}
 	if ((tmp_pid = waitpid(child_pid, NULL, 0)) == -1)
 		syslog(LOG_WARNING,