diff --git a/src/libexpr/primops/filterPath.cc b/src/libexpr/primops/filterPath.cc index c2db5b029..b4325c6d8 100644 --- a/src/libexpr/primops/filterPath.cc +++ b/src/libexpr/primops/filterPath.cc @@ -29,8 +29,7 @@ struct FilteringInputAccessor : InputAccessor bool pathExists(const CanonPath & path) override { - checkAccess(path); - return next->pathExists(prefix + path); + return isAllowed(path) && next->pathExists(prefix + path); } Stat lstat(const CanonPath & path) override