fusermount: Accept mount options, and completely ignore them

When using fuse-exfat, fusermount actually recives some options, but
these are entirely safe to ignore, so let's just do that (and log a
warning) to get things working.
This commit is contained in:
implicitfield
2025-04-14 00:39:23 +03:00
committed by Sönke Holz
parent 8beec85cc8
commit 7da4f182ca

View File

@@ -28,11 +28,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
StringView fd_string;
StringView target;
StringView mount_options;
Core::ArgsParser args_parser;
args_parser.set_general_help("Mount a FUSE-based filesystem");
args_parser.add_positional_argument(fd_string, "File descriptor to mount", "fd");
args_parser.add_positional_argument(target, "Path to mount location", "target");
args_parser.add_option(mount_options, "Mount options", "mount-options", 'o', "mount-options");
args_parser.parse(arguments);
if (fd_string.is_empty())
@@ -41,6 +43,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (target.is_empty())
return Error::from_string_literal("No target passed");
if (!mount_options.is_empty())
dbgln("Warning: The following mount options will be ignored: {}", mount_options);
auto maybe_fd = fd_string.to_number<int>();
if (!maybe_fd.has_value())
return Error::from_string_literal("Invalid file descriptor passed");