From: Thibault Godouet Date: Sat, 12 Mar 2005 12:37:30 +0000 (+0000) Subject: fixed bug : always restore umask, even if fcron run unprivileged X-Git-Tag: ver2_9_6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b386c89fc4ea10218eb49660178899a67747e4b;p=thirdparty%2Ffcron.git fixed bug : always restore umask, even if fcron run unprivileged --- diff --git a/job.c b/job.c index 9419312..74c5aa6 100644 --- a/job.c +++ b/job.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: job.c,v 1.62 2005-02-26 15:09:25 thib Exp $ */ + /* $Id: job.c,v 1.63 2005-03-12 12:37:30 thib Exp $ */ #include "fcron.h" @@ -96,9 +96,6 @@ change_user(struct cl_t *cl) const char * const * env; #endif - /* First, restore umask to default */ - umask (saved_umask); - /* Obtain password entry and change privileges */ if ((pas = getpwnam(cl->cl_runas)) == NULL) @@ -293,6 +290,9 @@ run_job(struct exe_t *exeent) die_e("could not pipe()"); } + /* First, restore umask to default */ + umask (saved_umask); + #ifndef RUN_NON_PRIVILEGED if (change_user(line) < 0) return ;