1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 20:16:03 +01:00

Rename one overload to allowPathLegacy

Makes it easier to tell when it is isued.
This commit is contained in:
John Ericson 2025-09-24 23:37:07 -04:00
parent 339338e166
commit 8ef70ef522
3 changed files with 8 additions and 5 deletions

View file

@ -334,7 +334,7 @@ EvalState::EvalState(
EvalState::~EvalState() {} EvalState::~EvalState() {}
void EvalState::allowPath(const Path & path) void EvalState::allowPathLegacy(const Path & path)
{ {
if (auto rootFS2 = rootFS.dynamic_pointer_cast<AllowListSourceAccessor>()) if (auto rootFS2 = rootFS.dynamic_pointer_cast<AllowListSourceAccessor>())
rootFS2->allowPrefix(CanonPath(path)); rootFS2->allowPrefix(CanonPath(path));
@ -3177,7 +3177,7 @@ std::optional<SourcePath> EvalState::resolveLookupPathPath(const LookupPath::Pat
/* Allow access to paths in the search path. */ /* Allow access to paths in the search path. */
if (initAccessControl) { if (initAccessControl) {
allowPath(path.path.abs()); allowPathLegacy(path.path.abs());
if (store->isInStore(path.path.abs())) { if (store->isInStore(path.path.abs())) {
try { try {
allowClosure(store->toStorePath(path.path.abs()).first); allowClosure(store->toStorePath(path.path.abs()).first);

View file

@ -488,8 +488,11 @@ public:
/** /**
* Allow access to a path. * Allow access to a path.
*
* Only for restrict eval: pure eval just whitelist store paths,
* never arbitrary paths.
*/ */
void allowPath(const Path & path); void allowPathLegacy(const Path & path);
/** /**
* Allow access to a store path. Note that this gets remapped to * Allow access to a store path. Note that this gets remapped to

View file

@ -177,8 +177,8 @@ struct ProfileManifest
else if (std::filesystem::exists(profile / "manifest.nix")) { else if (std::filesystem::exists(profile / "manifest.nix")) {
// FIXME: needed because of pure mode; ugly. // FIXME: needed because of pure mode; ugly.
state.allowPath(state.store->followLinksToStore(profile.string())); state.allowPath(state.store->followLinksToStorePath(profile.string()));
state.allowPath(state.store->followLinksToStore((profile / "manifest.nix").string())); state.allowPath(state.store->followLinksToStorePath((profile / "manifest.nix").string()));
auto packageInfos = queryInstalled(state, state.store->followLinksToStore(profile.string())); auto packageInfos = queryInstalled(state, state.store->followLinksToStore(profile.string()));