1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

Fix showing an appropriate RestrictedPathError

This commit is contained in:
Eelco Dolstra 2022-05-18 14:20:24 +02:00
parent c1a202c348
commit 1970d6db12
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 29 additions and 11 deletions

View file

@ -7,6 +7,8 @@
namespace nix {
MakeError(RestrictedPathError, Error);
struct InputAccessor
{
const size_t number;
@ -68,9 +70,12 @@ struct FSInputAccessor : InputAccessor
virtual bool hasAccessControl() = 0;
};
typedef std::function<RestrictedPathError(const CanonPath & path)> MakeNotAllowedError;
ref<FSInputAccessor> makeFSInputAccessor(
const CanonPath & root,
std::optional<std::set<CanonPath>> && allowedPaths = {});
std::optional<std::set<CanonPath>> && allowedPaths = {},
MakeNotAllowedError && makeNotAllowedError = {});
struct MemoryInputAccessor : InputAccessor
{