Преглед изворни кода

Merge pull request #96399 from andyprice/fileperms

Unix: Don't create world-writable files when safe save is enabled
Thaddeus Crews пре 9 месеци
родитељ
комит
030cc69771
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      drivers/unix/file_access_unix.cpp
  2. 1 1
      drivers/unix/file_access_unix_pipe.cpp

+ 1 - 1
drivers/unix/file_access_unix.cpp

@@ -118,7 +118,7 @@ Error FileAccessUnix::open_internal(const String &p_path, int p_mode_flags) {
 			last_error = ERR_FILE_CANT_OPEN;
 			return last_error;
 		}
-		fchmod(fd, 0666);
+		fchmod(fd, 0644);
 		path = String::utf8(cs.ptr());
 
 		f = fdopen(fd, mode_string);

+ 1 - 1
drivers/unix/file_access_unix_pipe.cpp

@@ -70,7 +70,7 @@ Error FileAccessUnixPipe::open_internal(const String &p_path, int p_mode_flags)
 	struct stat st = {};
 	int err = stat(path.utf8().get_data(), &st);
 	if (err) {
-		if (mkfifo(path.utf8().get_data(), 0666) != 0) {
+		if (mkfifo(path.utf8().get_data(), 0600) != 0) {
 			last_error = ERR_FILE_CANT_OPEN;
 			return last_error;
 		}