Skip to content

Commit f49c9d7

Browse files
committed
unix: Don't create world-writable files when safe save is enabled
When the "filesystem/on_save/safe_save_on_backup_then_rename" option is enabled files are created with 0666 permissions (-rw-rw-rw-) which is too loose. Use 0644 (-rw-r--r--) instead which is how the files would normally be created with the setting disabled and the system umask taken into account.
1 parent 05d9854 commit f49c9d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/unix/file_access_unix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Error FileAccessUnix::open_internal(const String &p_path, int p_mode_flags) {
9797
last_error = ERR_FILE_CANT_OPEN;
9898
return last_error;
9999
}
100-
fchmod(fd, 0666);
100+
fchmod(fd, 0644);
101101
path = String::utf8(cs.ptr());
102102

103103
f = fdopen(fd, mode_string);

0 commit comments

Comments
 (0)