mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-28 16:46:16 +02:00
ea38605d11
Backported from the lazy-trees branch. Note that this doesn't yet use the access control features of FSInputAccessor.
33 lines
772 B
C++
33 lines
772 B
C++
#pragma once
|
|
|
|
#include "input-accessor.hh"
|
|
|
|
namespace nix {
|
|
|
|
class StorePath;
|
|
class Store;
|
|
|
|
struct FSInputAccessor : InputAccessor
|
|
{
|
|
virtual void checkAllowed(const CanonPath & absPath) = 0;
|
|
|
|
virtual void allowPath(CanonPath path) = 0;
|
|
|
|
virtual bool hasAccessControl() = 0;
|
|
};
|
|
|
|
typedef std::function<RestrictedPathError(const CanonPath & path)> MakeNotAllowedError;
|
|
|
|
ref<FSInputAccessor> makeFSInputAccessor(
|
|
const CanonPath & root,
|
|
std::optional<std::set<CanonPath>> && allowedPaths = {},
|
|
MakeNotAllowedError && makeNotAllowedError = {});
|
|
|
|
ref<FSInputAccessor> makeStorePathAccessor(
|
|
ref<Store> store,
|
|
const StorePath & storePath,
|
|
MakeNotAllowedError && makeNotAllowedError = {});
|
|
|
|
SourcePath getUnfilteredRootPath(CanonPath path);
|
|
|
|
}
|