fs-util: change chase_symlinks() behaviour in regards to escaping the root dir
authorLennart Poettering <lennart@poettering.net>
Tue, 29 Nov 2016 14:54:42 +0000 (15:54 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 30 Nov 2016 23:25:51 +0000 (00:25 +0100)
commita4eaf3cf822dae1d076dfc98afc3ab0d53871dac
tree4d1ac4a9856c484b4fb94fd008f19acf1390fe69
parentdf878e682d009bc3c0842499fedc44703a7e7ede
fs-util: change chase_symlinks() behaviour in regards to escaping the root dir

Previously, we'd generate an EINVAL error if it is attempted to escape a root
directory with relative ".." symlinks. With this commit this is changed so that
".." from the root directory is a NOP, following the kernel's own behaviour
where /.. is equivalent to /.

As suggested by @keszybz.
src/basic/fs-util.c
src/test/test-fs-util.c