]> granicus.if.org Git - fcron/commitdiff
fixed bug : always restore umask, even if fcron run unprivileged
authorthib <thib>
Sat, 12 Mar 2005 12:37:30 +0000 (12:37 +0000)
committerthib <thib>
Sat, 12 Mar 2005 12:37:30 +0000 (12:37 +0000)
job.c

diff --git a/job.c b/job.c
index 941931216fb7906b4135eaabc2b156511cb50412..74c5aa6a91f9532b50dc4ce5d39d7c580a629510 100644 (file)
--- 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 ;