Create files according to the process umask.

This commit is contained in:
Ger Schinkel 2022-05-03 08:08:36 +02:00
parent 2666bef882
commit e933e7885f
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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 {