]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy: fix a segfault in SELinux context copying code
authorNicolas Iooss <nicolas.iooss@m4x.org>
Sat, 4 Jan 2014 03:03:51 +0000 (03:03 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 13 Jan 2014 23:11:37 +0000 (23:11 +0000)
commitd718331e59afb35e56445f3a1597ed74a7f3a3e2
treee223ecfbeca136b7001a8efaacbc80e011603825
parentba25b75dc2a4f37cb65b5e2ff1bf41bd1707770b
copy: fix a segfault in SELinux context copying code

* src/selinux.c (restorecon_private): On ArchLinux the
`fakeroot cp -a file1 file2` command segfaulted due
to getfscreatecon() returning a NULL context.
So map this to the sometimes ignored ENODATA error,
rather than crashing.
* tests/cp/no-ctx.sh: Add a new test case.
* tests/local.mk: Reference the new test.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/16335
NEWS
src/selinux.c
tests/cp/no-ctx.sh [new file with mode: 0755]
tests/local.mk