]> git.ipfire.org Git - thirdparty/coreutils.git/commit
selinux: fix --context=CTX for cp and diagnose defaultcon() errors
authorPádraig Brady <P@draigBrady.com>
Wed, 4 Dec 2013 19:10:37 +0000 (19:10 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 5 Dec 2013 00:18:36 +0000 (00:18 +0000)
commit0013de3e603162081c4464ea1f7ad3285f633d78
treed93f83bc57d79b098b7d20d9cb60cf1b8296779e
parentb53b0fd940382497e58a9e912f1262c2084fe534
selinux: fix --context=CTX for cp and diagnose defaultcon() errors

* src/selinux.h (ignorable_ctx_err): A new function used
to determine if a warning should be given after a call
to defaultcon() or restorecon().
* src/cp.c (main): Fix the setfscreatecon() call to use
the argument passed by the user.
* src/mkdir.c (make_ancestor): Show all but "ignoreable" errors
from defaultcon() and restorecon().
* tests/misc/selinux.sh: Add a test run as root in selinux enforcing
mode, to ensure cp --context=invalid is honored and fails immediately.
src/copy.c
src/cp.c
src/mkdir.c
src/mv.c
src/selinux.h
tests/misc/selinux.sh