Skip to content

Commit 030cc69

Browse files
committed
Merge pull request godotengine#96399 from andyprice/fileperms
Unix: Don't create world-writable files when safe save is enabled
2 parents b25c7e3 + 64077ff commit 030cc69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/unix/file_access_unix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Error FileAccessUnix::open_internal(const String &p_path, int p_mode_flags) {
118118
last_error = ERR_FILE_CANT_OPEN;
119119
return last_error;
120120
}
121-
fchmod(fd, 0666);
121+
fchmod(fd, 0644);
122122
path = String::utf8(cs.ptr());
123123

124124
f = fdopen(fd, mode_string);

drivers/unix/file_access_unix_pipe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Error FileAccessUnixPipe::open_internal(const String &p_path, int p_mode_flags)
7070
struct stat st = {};
7171
int err = stat(path.utf8().get_data(), &st);
7272
if (err) {
73-
if (mkfifo(path.utf8().get_data(), 0666) != 0) {
73+
if (mkfifo(path.utf8().get_data(), 0600) != 0) {
7474
last_error = ERR_FILE_CANT_OPEN;
7575
return last_error;
7676
}

0 commit comments

Comments
 (0)