chiark / gitweb /
copy: extend check for mount point crossing
authorLennart Poettering <lennart@poettering.net>
Wed, 6 Jun 2018 15:33:28 +0000 (17:33 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commit46d4c3a36a98c9f3add60e1d4e25b4fed1d304da
tree85c93ce893bfd32e2ad322eedd0b7d0a39b17b2e
parentcca09ee8d6ece8e22b638efd05c4c0eb49e91b91
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