at/at-3.1.8-pam-session-as-root.patch

33 lines
960 B
Diff

Index: at-3.1.8/atd.c
===================================================================
--- at-3.1.8.orig/atd.c 2009-05-14 15:47:05.000000000 +0200
+++ at-3.1.8/atd.c 2009-05-14 15:47:42.000000000 +0200
@@ -587,11 +587,13 @@ run_file(const char *filename, uid_t uid
unlink(filename);
#ifdef WITH_PAM
+ PRIV_START
pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT );
pam_close_session(pamh, PAM_SILENT);
pam_end(pamh, PAM_ABORT);
closelog();
openlog("atd", LOG_PID, LOG_ATD);
+ PRIV_END
#endif
/* The job is now finished. We can delete its input file.
@@ -712,11 +714,13 @@ run_file(const char *filename, uid_t uid
waitpid(mail_pid, (int *) NULL, 0);
}
#ifdef WITH_PAM
+ PRIV_START
pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT );
pam_close_session(pamh, PAM_SILENT);
pam_end(pamh, PAM_ABORT);
closelog();
openlog("atd", LOG_PID, LOG_ATD);
+ PRIV_END
#endif
}
exit(EXIT_SUCCESS);