From: Marcela Mašláňová Date: Tue, 27 Nov 2012 09:23:41 +0000 (+0100) Subject: Condtionalize pam functions. X-Git-Tag: cronie1.4.10~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea2b0908b7aff1c40a6f91a6aa18a121e7648fdf;p=cronie Condtionalize pam functions. --- 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 */