1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 15:48:00 +02:00

Fix access control

This commit is contained in:
Eelco Dolstra 2022-05-17 11:53:02 +02:00
parent 65e1e49cf7
commit fdba67d4fa
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 125 additions and 28 deletions

View file

@ -682,22 +682,10 @@ struct GitInputScheme : InputScheme
auto files = listFiles(repoInfo);
CanonPath repoDir(repoInfo.url);
PathFilter filter = [&](const Path & p) -> bool {
abort();
#if 0
assert(hasPrefix(p, repoInfo.url));
std::string file(p, repoInfo.url.size() + 1);
auto st = lstat(p);
if (S_ISDIR(st.st_mode)) {
auto prefix = file + "/";
auto i = files.lower_bound(prefix);
return i != files.end() && hasPrefix(*i, prefix);
}
return files.count(file);
#endif
return CanonPath(p).removePrefix(repoDir).isAllowed(files);
};
auto storePath = store->addToStore(input.getName(), repoInfo.url, FileIngestionMethod::Recursive, htSHA256, filter);