LibSandbox: Remove redundant restrict_filesystem_with_landlock overload

None of the callers actually passed `ReadonlySpan<StringView>` so we can
achieve the same thing by giving a default argument to the
`ReadonlySpan<LandlockPath>` overload.
This commit is contained in:
Callum Law 2026-06-19 19:55:19 +12:00 committed by Jelle Raaijmakers
parent 78851f69f0
commit 30c33bd918
2 changed files with 1 additions and 10 deletions

View file

@ -504,14 +504,6 @@ ErrorOr<void> restrict_filesystem_with_landlock(ReadonlySpan<LandlockPath> paths
return {};
}
ErrorOr<void> restrict_filesystem_with_landlock(ReadonlySpan<StringView> readable_paths)
{
Vector<LandlockPath> paths;
for (auto readable_path : readable_paths)
TRY(paths.try_append({ readable_path.to_byte_string(), LandlockPath::Access::ReadOnly }));
return restrict_filesystem_with_landlock(paths.span());
}
#endif
}

View file

@ -52,8 +52,7 @@ enum class NetworkAccess {
#if defined(AK_OS_LINUX)
[[nodiscard]] ErrorOr<void> add_landlock_path_if_exists(Vector<LandlockPath>& paths, StringView path, LandlockPath::Access);
[[nodiscard]] ErrorOr<void> restrict_filesystem_with_landlock(ReadonlySpan<LandlockPath>);
[[nodiscard]] ErrorOr<void> restrict_filesystem_with_landlock(ReadonlySpan<StringView> readable_paths = {});
[[nodiscard]] ErrorOr<void> restrict_filesystem_with_landlock(ReadonlySpan<LandlockPath> = {});
#endif
#if defined(AK_OS_MACOS)