From ac658beb5b2818bb7b0d3ac35f0301ac4f3e5722 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Thu, 28 Mar 2024 01:31:47 +0200 Subject: [PATCH] Fix file mode in statbuf structure --- storage/file_descriptor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/file_descriptor.cpp b/storage/file_descriptor.cpp index 93a7588..5a27992 100644 --- a/storage/file_descriptor.cpp +++ b/storage/file_descriptor.cpp @@ -497,7 +497,7 @@ namespace vfs Node *node = file->node; statbuf->st_dev = 0; /* FIXME: stub */ statbuf->st_ino = node->IndexNode; - statbuf->st_mode = node->Type | node->Mode; + statbuf->st_mode = node->Type | (node->Mode & ~S_IFMT); statbuf->st_nlink = 0; /* FIXME: stub */ statbuf->st_uid = node->UserIdentifier; statbuf->st_gid = node->GroupIdentifier; @@ -521,7 +521,7 @@ namespace vfs Node *node = fd.Handle->node; statbuf->st_dev = 0; /* FIXME: stub */ statbuf->st_ino = node->IndexNode; - statbuf->st_mode = node->Type | node->Mode; + statbuf->st_mode = node->Type | (node->Mode & ~S_IFMT); statbuf->st_nlink = 0; /* FIXME: stub */ statbuf->st_uid = node->UserIdentifier; statbuf->st_gid = node->GroupIdentifier; @@ -552,7 +552,7 @@ namespace vfs Node *node = file->node; statbuf->st_dev = 0; /* FIXME: stub */ statbuf->st_ino = node->IndexNode; - statbuf->st_mode = node->Type | node->Mode; + statbuf->st_mode = node->Type | (node->Mode & ~S_IFMT); statbuf->st_nlink = 0; /* FIXME: stub */ statbuf->st_uid = node->UserIdentifier; statbuf->st_gid = node->GroupIdentifier;