You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #96399 from andyprice/fileperms
Unix: Don't create world-writable files when safe save is enabled
This commit is contained in:
@@ -118,7 +118,7 @@ Error FileAccessUnix::open_internal(const String &p_path, int p_mode_flags) {
|
|||||||
last_error = ERR_FILE_CANT_OPEN;
|
last_error = ERR_FILE_CANT_OPEN;
|
||||||
return last_error;
|
return last_error;
|
||||||
}
|
}
|
||||||
fchmod(fd, 0666);
|
fchmod(fd, 0644);
|
||||||
path = String::utf8(cs.ptr());
|
path = String::utf8(cs.ptr());
|
||||||
|
|
||||||
f = fdopen(fd, mode_string);
|
f = fdopen(fd, mode_string);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Error FileAccessUnixPipe::open_internal(const String &p_path, int p_mode_flags)
|
|||||||
struct stat st = {};
|
struct stat st = {};
|
||||||
int err = stat(path.utf8().get_data(), &st);
|
int err = stat(path.utf8().get_data(), &st);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (mkfifo(path.utf8().get_data(), 0666) != 0) {
|
if (mkfifo(path.utf8().get_data(), 0600) != 0) {
|
||||||
last_error = ERR_FILE_CANT_OPEN;
|
last_error = ERR_FILE_CANT_OPEN;
|
||||||
return last_error;
|
return last_error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user