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:
parent
c1a202c348
commit
1970d6db12
4 changed files with 29 additions and 11 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue