From 9e7cbeb0f1d2c2921b46fa915391b7f26bf546c5 Mon Sep 17 00:00:00 2001 From: thib Date: Mon, 5 Jun 2006 21:19:27 +0000 Subject: [PATCH] Run each job in a different session by calling setuid() for each one of them. --- job.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/job.c b/job.c index 9f7a207..6510772 100644 --- a/job.c +++ b/job.c @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: job.c,v 1.66 2006-05-20 16:23:42 thib Exp $ */ + /* $Id: job.c,v 1.67 2006-06-05 21:19:27 thib Exp $ */ #include "fcron.h" @@ -510,6 +510,10 @@ run_job(struct exe_t *exeent) if(flask_enabled && setexeccon(line->cl_file->cf_user_context) ) die_e("Can't set execute context \"%s\".", line->cl_file->cf_user_context); +#else + if (setsid() == -1) { + die_e("setsid(): errno %d", errno); + } #endif execl(curshell, curshell, "-c", line->cl_shell, NULL); /* execl returns only on error */ -- 2.50.1