mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Merge pull request #11951 from Mic92/libstore
source-accessor: fix case where normalization goes beyond root
This commit is contained in:
commit
3180c09723
1 changed files with 4 additions and 3 deletions
|
@ -84,9 +84,10 @@ CanonPath SourceAccessor::resolveSymlinks(
|
||||||
todo.pop_front();
|
todo.pop_front();
|
||||||
if (c == "" || c == ".")
|
if (c == "" || c == ".")
|
||||||
;
|
;
|
||||||
else if (c == "..")
|
else if (c == "..") {
|
||||||
|
if (!res.isRoot())
|
||||||
res.pop();
|
res.pop();
|
||||||
else {
|
} else {
|
||||||
res.push(c);
|
res.push(c);
|
||||||
if (mode == SymlinkResolution::Full || !todo.empty()) {
|
if (mode == SymlinkResolution::Full || !todo.empty()) {
|
||||||
if (auto st = maybeLstat(res); st && st->type == SourceAccessor::tSymlink) {
|
if (auto st = maybeLstat(res); st && st->type == SourceAccessor::tSymlink) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue