]> git.ipfire.org Git - thirdparty/systemd.git/commit
copy: extend check for mount point crossing
authorLennart Poettering <lennart@poettering.net>
Wed, 6 Jun 2018 15:33:28 +0000 (17:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Jun 2018 11:27:38 +0000 (13:27 +0200)
commitf6a77804c9d743e8d01051d2cb0511b53a49c56e
treea9f4f8e2944c28dbf7ececdc86418e8b6c755b86
parentef202b848bb6635dec17d3ec0041b04cd2301bed
copy: extend check for mount point crossing

We do this checks as protection against bind mount cycles on the same
file system. However, the check wasn't really effective for that, as
it would only detect cycles A → B → A this way. By using
fs_is_mount_point() we'll also detect cycles A → A.

Also, while we are at it, make these file system boundary checks
optional. This is not used anywhere, but might be eventually...

Most importantly though add a longer blurb explanation the why.
src/basic/copy.c
src/basic/copy.h