]> git.ipfire.org Git - thirdparty/coreutils.git/commit
* tests/cp/cp-a-selinux: New file. Test for the bug reported in
authorJim Meyering <jim@meyering.net>
Wed, 31 Jan 2007 22:01:50 +0000 (23:01 +0100)
committerJim Meyering <jim@meyering.net>
Sun, 18 Mar 2007 17:15:08 +0000 (18:15 +0100)
commitbeb12e09f3c93a7175d37bc1894bc047f26cc660
tree1fcd2d5e10d267c5daa537bfa89888924f1df398
parent65ba507e17baefb7808b24dd7627814a0ea7902b
* tests/cp/cp-a-selinux: New file. Test for the bug reported in

* tests/cp/Makefile.am (TESTS): Add cp-a-selinux.

* tests/selinux: New file.
* tests/Makefile.am (EXTRA_DIST): Add selinux.
* tests/misc/selinux: Source the new script, rather than open coding it.

Change how "cp -a" and "cp --preserve=context" work with SELinux.
Now, cp -a attempts to preserve context, but failure to do so does
not change cp's exit status.  However "cp --preserve=context" is
similar, but failure *does* cause cp to exit with nonzero status.
* src/copy.h (struct cp_options) [require_preserve_context]: New member.
* src/copy.c (copy_reg, copy_internal): Implement the above.
* src/mv.c (cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(decode_preserve_arg): Set it or reset it.

FIXME: add an on-writable-NFS-only test
ChangeLog-selinux
src/copy.c
src/copy.h
src/cp.c
src/install.c
src/mv.c
tests/Makefile.am
tests/cp/Makefile.am
tests/cp/cp-a-selinux [new file with mode: 0755]
tests/misc/selinux
tests/selinux [new file with mode: 0644]