Kernel/FUSE: Fill in uid, gid, and pid records

This commit is contained in:
implicitfield 2024-05-11 08:05:26 +04:00 committed by Andrew Kaster
parent a343c7cde4
commit 7acc5763ed
Notes: sideshowbarker 2024-07-16 18:06:41 +09:00

View File

@ -9,6 +9,7 @@
#include <Kernel/FileSystem/FUSE/Definitions.h>
#include <Kernel/FileSystem/OpenFileDescription.h>
#include <Kernel/Library/KBuffer.h>
#include <Kernel/Tasks/Process.h>
namespace Kernel {
@ -41,10 +42,10 @@ public:
header->unique = unique;
header->nodeid = nodeid;
// FIXME: Fill in proper values for these.
header->uid = 0;
header->gid = 0;
header->pid = 1;
auto current_process_credentials = Process::current().credentials();
header->uid = current_process_credentials->euid().value();
header->gid = current_process_credentials->egid().value();
header->pid = Process::current().pid().value();
u8* payload = bit_cast<u8*>(request->data() + sizeof(fuse_in_header));
memcpy(payload, request_body.data(), request_body.size());