From e933e7885f3a8bfe50ca38586ced74669731a0e4 Mon Sep 17 00:00:00 2001 From: Ger Schinkel Date: Tue, 3 May 2022 08:08:36 +0200 Subject: [PATCH] Create files according to the process umask. --- BasiliskII/src/Unix/prefs_editor_gtk.cpp | 2 +- SheepShaver/src/Unix/prefs_editor_gtk.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/Unix/prefs_editor_gtk.cpp b/BasiliskII/src/Unix/prefs_editor_gtk.cpp index e9432629..a7a03db5 100644 --- a/BasiliskII/src/Unix/prefs_editor_gtk.cpp +++ b/BasiliskII/src/Unix/prefs_editor_gtk.cpp @@ -581,7 +581,7 @@ static void create_volume_ok(GtkWidget *button, file_req_assoc *assoc) delete assoc; return; } - int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR); + int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd < 0 && errno == EEXIST) { printf("File already exists, refusing to overwrite file.\n"); } else { diff --git a/SheepShaver/src/Unix/prefs_editor_gtk.cpp b/SheepShaver/src/Unix/prefs_editor_gtk.cpp index a26ba7de..a15337d3 100644 --- a/SheepShaver/src/Unix/prefs_editor_gtk.cpp +++ b/SheepShaver/src/Unix/prefs_editor_gtk.cpp @@ -510,7 +510,7 @@ static void create_volume_ok(GtkWidget *button, file_req_assoc *assoc) delete assoc; return; } - int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR); + int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd < 0 && errno == EEXIST) { printf("File already exists, refusing to overwrite file.\n"); } else {