diff --git a/Kernel/API/POSIX/unistd.h b/Kernel/API/POSIX/unistd.h index cc3ce83612..a7d841522c 100644 --- a/Kernel/API/POSIX/unistd.h +++ b/Kernel/API/POSIX/unistd.h @@ -30,6 +30,7 @@ extern "C" { #define MS_WXALLOWED (1 << 6) #define MS_AXALLOWED (1 << 7) #define MS_NOREGULAR (1 << 8) +#define MS_SRCHIDDEN (1 << 9) enum { _SC_MONOTONIC_CLOCK, diff --git a/Kernel/FileSystem/SysFS/Subsystems/Kernel/DiskUsage.cpp b/Kernel/FileSystem/SysFS/Subsystems/Kernel/DiskUsage.cpp index e9e7005b8f..2f8ed31c72 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Kernel/DiskUsage.cpp +++ b/Kernel/FileSystem/SysFS/Subsystems/Kernel/DiskUsage.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -40,18 +41,22 @@ ErrorOr SysFSDiskUsage::try_generate(KBufferBuilder& builder) TRY(fs_object.add("readonly"sv, fs.is_readonly())); TRY(fs_object.add("mount_flags"sv, mount.flags())); - if (fs.is_file_backed()) { - auto& file = static_cast(fs).file(); - if (file.is_loop_device()) { - auto& device = static_cast(file); - auto path = TRY(device.custody().try_serialize_absolute_path()); - TRY(fs_object.add("source"sv, path->view())); - } else { - auto pseudo_path = TRY(static_cast(fs).file_description().pseudo_path()); - TRY(fs_object.add("source"sv, pseudo_path->view())); - } + if (mount.flags() & MS_SRCHIDDEN) { + TRY(fs_object.add("source"sv, "unknown")); } else { - TRY(fs_object.add("source"sv, "none")); + if (fs.is_file_backed()) { + auto& file = static_cast(fs).file(); + if (file.is_loop_device()) { + auto& device = static_cast(file); + auto path = TRY(device.custody().try_serialize_absolute_path()); + TRY(fs_object.add("source"sv, path->view())); + } else { + auto pseudo_path = TRY(static_cast(fs).file_description().pseudo_path()); + TRY(fs_object.add("source"sv, pseudo_path->view())); + } + } else { + TRY(fs_object.add("source"sv, "none")); + } } TRY(fs_object.finish()); diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp index 573fbececb..9abc8e2ea4 100644 --- a/Userland/Utilities/mount.cpp +++ b/Userland/Utilities/mount.cpp @@ -43,6 +43,8 @@ static int parse_options(StringView options) flags |= MS_AXALLOWED; else if (part == "noregular") flags |= MS_NOREGULAR; + else if (part == "srchidden") + flags |= MS_SRCHIDDEN; else warnln("Ignoring invalid option: {}", part); } @@ -181,6 +183,8 @@ static ErrorOr print_mounts() out(",nodev"); if (mount_flags & MS_NOREGULAR) out(",noregular"); + if (mount_flags & MS_SRCHIDDEN) + out(",srcobfuscate"); if (mount_flags & MS_NOEXEC) out(",noexec"); if (mount_flags & MS_NOSUID)