fs-util: when calling chase_symlinks() with root path, leave root part unresolved
authorLennart Poettering <lennart@poettering.net>
Tue, 28 Jan 2020 20:02:29 +0000 (21:02 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 28 Jan 2020 21:53:59 +0000 (22:53 +0100)
commitc2595d3b02849b7baa94483f03cbc888e0c63ebd
tree8fdd5638d3c9acef4b4f945f10338ace3ff1fc0b
parent1ffadeaae32d3780b2a208cb7368661973e9c984
fs-util: when calling chase_symlinks() with root path, leave root part unresolved

Previously there was a weird asymmetry: initially we'd resolve the
specified prefix path when chasing symlinks together with the actual
path we were supposed to cover, except when we hit an absolute symlink
where we'd use the root as it was. Let's unify handling here: the prefix
path is never resolved, and always left as it is.

This in particular fixes issues with symlinks in the prefix path, as
that confused the check that made sure we never left the root directory.

Fixes: #14634
Replaces: #14635
src/basic/fs-util.c