]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy,install: avoid unnecessary security context translations
authorChristian Göttsche <cgzones@googlemail.com>
Tue, 19 Dec 2023 14:55:28 +0000 (15:55 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 19 Dec 2023 17:34:33 +0000 (17:34 +0000)
commit98d463ef5d44b9dfe6757942251164b56795b06f
tree5add6be8c26bb7d931ea9f1911609ec1e518d620
parent343b8d7ba705c4e2a537bdc06ac6aa043e5f9e31
copy,install: avoid unnecessary security context translations

Do not perform SELinux context translation for operations not involving
user input or output.  Context translation converts MCS/MLS labels into
human readable form, which is useful for user facing applications like
ls(1) or the --context=CTX argument of cp(1).

* src/copy.c (set_process_security_ctx): Use raw selinux variants.
* src/install.c (need_copy): Likewise.
(setdefaultfilecon): Likewise.
* src/selinux.c (computecon): Likewise.
(defaultcon): Likewise.
* tests/cp/no-ctx.sh: Add raw variants to preload lib.
* NEWS: Mention the improvement.
NEWS
src/copy.c
src/install.c
src/selinux.c
tests/cp/no-ctx.sh