]> granicus.if.org Git - gc/commitdiff
Fix 'too wide non-owner permissions are set for resource' code defect
authorIvan Maidanski <ivmai@mail.ru>
Mon, 12 Nov 2018 07:52:01 +0000 (10:52 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 12 Nov 2018 17:45:19 +0000 (20:45 +0300)
* misc.c [(UNIX_LIKE && !GC_ANDROID_LOG || CYGWIN32 || SYMBIAN)
&& !SMALL_CONFIG] (GC_init): Pass 0644 permissions mode instead of 0666
to open (create) a log file.
* os_dep.c [MMAP_SUPPORTED && !USE_MMAP_ANON && SYMBIAN]
(GC_unix_mmap_get_mem): Pass 0644 mode instead of 0666 to open "zero"
file.

misc.c
os_dep.c

diff --git a/misc.c b/misc.c
index d45b9b57d3a9c31336db517147ffc1b2f96e029c..2f001d01ce063cc274e30ce68bad0ee63634febc 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1031,7 +1031,7 @@ GC_API void GC_CALL GC_init(void)
             if (0 != file_name)
 #         endif
           {
-            int log_d = open(file_name, O_CREAT|O_WRONLY|O_APPEND, 0666);
+            int log_d = open(file_name, O_CREAT | O_WRONLY | O_APPEND, 0644);
             if (log_d < 0) {
               GC_err_printf("Failed to open %s as log file\n", file_name);
             } else {
index ea08ebad359f90b8059b728d15492c34054f46fa..dd6160039f7bd3884ebc850d44653c6cb831d09e 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -2163,7 +2163,7 @@ void GC_register_data_segments(void)
 #       ifdef SYMBIAN
           char *path = GC_get_private_path_and_zero_file();
           if (path != NULL) {
-            zero_fd = open(path, O_RDWR | O_CREAT, 0666);
+            zero_fd = open(path, O_RDWR | O_CREAT, 0644);
             free(path);
           }
 #       else