mirror of
https://github.com/NixOS/nix
synced 2025-06-30 15:48:00 +02:00
Fix access control
This commit is contained in:
parent
65e1e49cf7
commit
fdba67d4fa
5 changed files with 125 additions and 28 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue