From ea2b0908b7aff1c40a6f91a6aa18a121e7648fdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcela=20Ma=C5=A1l=C3=A1=C5=88ov=C3=A1?= Date: Tue, 27 Nov 2012 10:23:41 +0100 Subject: [PATCH] Condtionalize pam functions. --- src/crontab.c | 2 ++ src/do_command.c | 2 ++ src/funcs.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/crontab.c b/src/crontab.c index 2a9b3da..7eda894 100644 --- a/src/crontab.c +++ b/src/crontab.c @@ -199,7 +199,9 @@ int main(int argc, char *argv[]) { default: abort(); } +#ifdef WITH_PAM cron_close_pam(); +#endif exit(exitstatus); /*NOTREACHED*/} diff --git a/src/do_command.c b/src/do_command.c index 20f6116..cb3d9e9 100644 --- a/src/do_command.c +++ b/src/do_command.c @@ -72,7 +72,9 @@ void do_command(entry * e, user * u) { _exit(ERROR_EXIT); } ev = child_process(e, jobenv); +#ifdef WITH_PAM cron_close_pam(); +#endif env_free(jobenv); Debug(DPROC, ("[%ld] child process done, exiting\n", (long) getpid())); _exit(ev); diff --git a/src/funcs.h b/src/funcs.h index efd58fb..4d95d22 100644 --- a/src/funcs.h +++ b/src/funcs.h @@ -121,7 +121,9 @@ void free_security_context( security_context_t *scontext ); int crontab_security_access(void); /* PAM */ +#ifdef WITH_PAM int cron_start_pam(struct passwd *pw); void cron_close_pam(void); +#endif #endif /* CRONIE_FUNCS_H */ -- 2.50.1