Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix: Don't create world-writable files when safe save is enabled #96399

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/unix/file_access_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,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);
bruvzg marked this conversation as resolved.
Show resolved Hide resolved
path = String::utf8(cs.ptr());

f = fdopen(fd, mode_string);
Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/file_access_unix_pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,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) {
bruvzg marked this conversation as resolved.
Show resolved Hide resolved
last_error = ERR_FILE_CANT_OPEN;
return last_error;
}
Expand Down
Loading