]> granicus.if.org Git - fcron/commitdiff
Run each job in a different session by calling setuid() for each one of them.
authorthib <thib>
Mon, 5 Jun 2006 21:19:27 +0000 (21:19 +0000)
committerthib <thib>
Mon, 5 Jun 2006 21:19:27 +0000 (21:19 +0000)
job.c

diff --git a/job.c b/job.c
index 9f7a207de56f1a5aee45a370ade631e1039e5307..6510772c14d5d80f159a34c08736fca7540951b2 100644 (file)
--- 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 */