From 473821bfa8af1421e8cc9665302b88b7d6720e25 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Mon, 1 Apr 2024 00:47:33 +0300 Subject: [PATCH] Implement process file mode creation mask --- include/task.hpp | 2 ++ syscalls/linux.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/include/task.hpp b/include/task.hpp index 29e648f..470cfe8 100644 --- a/include/task.hpp +++ b/include/task.hpp @@ -465,6 +465,8 @@ namespace Tasking /* Other */ Signal Signals; + mode_t FileCreationMask = S_IRUSR | S_IWUSR | S_IRGRP | + S_IWGRP | S_IROTH | S_IWOTH; /* Threads & Children */ std::list Threads; diff --git a/syscalls/linux.cpp b/syscalls/linux.cpp index ff7688d..f42d485 100644 --- a/syscalls/linux.cpp +++ b/syscalls/linux.cpp @@ -1158,6 +1158,7 @@ static pid_t linux_fork(SysFrm *sf) NewProcess->FileDescriptors->Fork(Parent->FileDescriptors); NewProcess->Executable = Parent->Executable; NewProcess->CurrentWorkingDirectory = Parent->CurrentWorkingDirectory; + NewProcess->FileCreationMask = Parent->FileCreationMask; TCB *NewThread = TaskManager->CreateThread(NewProcess,