]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy: handle system security config issues with copy_file_range()
authorPádraig Brady <P@draigBrady.com>
Sat, 8 May 2021 18:23:20 +0000 (19:23 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 12 May 2021 21:14:11 +0000 (22:14 +0100)
commit2e66e1732fced7af20fa76c60e636d39a1767d48
treefb0ba54c9fc511acd3cdb331d953a76e20452a19
parent017877bd088284d515753d78b81ca6e6a88c1350
copy: handle system security config issues with copy_file_range()

* src/copy.c (sparse_copy): Upon EPERM from copy_file_range(),
fall back to a standard copy, which will give a more accurate
error as to whether the issue is with the source or destination.
Also this will avoid the issue where seccomp or apparmor are
not configured to handle copy_file_range(), in which case
the fall back standard copy would succeed without issue.
This specific issue with seccomp was noticed for example in:
https://github.com/golang/go/issues/40900
src/copy.c