mirror of
https://github.com/NixOS/nix
synced 2025-06-26 15:51:15 +02:00
Fix GC failures on bad store path names
It failed on names like '/nix/store/9ip48nkc9rfy0a4yaw98lp6gipqlib1a-'.
This commit is contained in:
parent
2e953b567e
commit
22a754c091
4 changed files with 35 additions and 29 deletions
|
@ -19,14 +19,6 @@ bool Store::isInStore(const Path & path) const
|
|||
}
|
||||
|
||||
|
||||
bool Store::isStorePath(const Path & path) const
|
||||
{
|
||||
return isInStore(path)
|
||||
&& path.size() >= storeDir.size() + 1 + storePathHashLen
|
||||
&& path.find('/', storeDir.size() + 1) == Path::npos;
|
||||
}
|
||||
|
||||
|
||||
Path Store::toStorePath(const Path & path) const
|
||||
{
|
||||
if (!isInStore(path))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue