Skip to content

Commit 64077ff

Browse files
committed
unix: Limit named pipe permissions to the current user
Named pipes created using the "pipe://" file access scheme should not be world-writable or readable. Limit their access to the current user by creating them with 0600 permissions instead of 0666.
1 parent f49c9d7 commit 64077ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/unix/file_access_unix_pipe.cpp

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

0 commit comments

Comments
 (0)