chiark / gitweb /
manager: call generators with umask 0022
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Aug 2011 18:51:18 +0000 (20:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 1 Aug 2011 18:51:18 +0000 (20:51 +0200)
src/manager.c

index 9e4bd51d5c28607ced180019dcb485e15ba52fbf..69dbec434785d9559b24d6d96442b1f5980b100b 100644 (file)
@@ -2985,6 +2985,7 @@ void manager_run_generators(Manager *m) {
         DIR *d = NULL;
         const char *generator_path;
         const char *argv[3];
         DIR *d = NULL;
         const char *generator_path;
         const char *argv[3];
+        mode_t u;
 
         assert(m);
 
 
         assert(m);
 
@@ -3027,7 +3028,9 @@ void manager_run_generators(Manager *m) {
         argv[1] = m->generator_unit_path;
         argv[2] = NULL;
 
         argv[1] = m->generator_unit_path;
         argv[2] = NULL;
 
+        u = umask(0022);
         execute_directory(generator_path, d, (char**) argv);
         execute_directory(generator_path, d, (char**) argv);
+        umask(u);
 
         if (rmdir(m->generator_unit_path) >= 0) {
                 /* Uh? we were able to remove this dir? I guess that
 
         if (rmdir(m->generator_unit_path) >= 0) {
                 /* Uh? we were able to remove this dir? I guess that