Set umask to create event files not readable by others (SB #53091).
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 21 Mar 2011 19:25:27 +0000 (19:25 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 21 Mar 2011 19:25:27 +0000 (19:25 +0000)
org.glite.lb.harvester/src/harvester.c
org.glite.lb.logger/src/interlogd.c
org.glite.lb.logger/src/logd.c
org.glite.lb.server/src/bkserverd.c

index 7ce879d..f755a72 100644 (file)
@@ -2624,6 +2624,7 @@ int main(int argn, char *argv[]) {
        }
 
        // child continues...
+       umask(S_IRWXG | S_IRWXO);
 
        // threads && Globus
        if (edg_wll_gss_initialize()) {
index cb2f7a9..24a64b4 100644 (file)
@@ -479,6 +479,8 @@ main (int argc, char **argv)
   fprintf(pidf,"%d\n",getpid());
   fclose(pidf);
 
+  umask(S_IRWXG | S_IRWXO);
+
 #ifdef LB_PERF
   /* this must be called after installing signal handlers */
   glite_wll_perftest_init(NULL, /* host */
index 6fc9fef..7ba4d1b 100644 (file)
@@ -18,6 +18,7 @@ limitations under the License.
 
 
 #include <stdio.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -515,6 +516,8 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n
   fprintf(pidf,"%d\n",getpid());
   fclose(pidf);
 
+  umask(S_IRWXG | S_IRWXO);
+
    /*
     * Main loop
     */
index d2be5b9..2240dc9 100644 (file)
@@ -559,6 +559,8 @@ int main(int argc, char *argv[])
        if (fprintf(fpid, "%d", getpid()) <= 0) { perror(pidfile); return 1; }
        if (fclose(fpid) != 0) { perror(pidfile); return 1; }
 
+       umask(S_IRWXG | S_IRWXO);
+
        if (policy_file && parse_server_policy(ctx, policy_file, &authz_policy)) {
                char *et, *ed;