From 146c35e640c9a931d9b3e9e7aa49f03eeef03aa7 Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Sun, 12 Oct 2008 16:14:22 +0000 Subject: [PATCH] fix cp -Z issues(#466653, #466646), do not require preservation of SELinux CTX for preserve=all cp mode --- coreutils-selinux.patch | 16 ++-------------- coreutils.spec | 8 +++++++- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/coreutils-selinux.patch b/coreutils-selinux.patch index e4c8640..81d801a 100644 --- a/coreutils-selinux.patch +++ b/coreutils-selinux.patch @@ -31,9 +31,9 @@ diff -urp coreutils-6.10-orig/man/cp.1 coreutils-6.10/man/cp.1 .TP \fB\-x\fR, \fB\-\-one\-file\-system\fR stay on this file system ++.TP +\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR +(SELinux) set SELinux security context of copy to CONTEXT -+.TP .TP \fB\-\-help\fR display this help and exit @@ -384,24 +384,12 @@ diff -urp coreutils-6.10-orig/src/cp.c coreutils-6.10/src/cp.c x->require_preserve = false; x->recursive = false; -@@ -867,8 +873,10 @@ decode_preserve_arg (char const *arg, st - x->preserve_timestamps = on_off; - x->preserve_ownership = on_off; - x->preserve_links = on_off; -- if (selinux_enabled) -+ if (selinux_enabled) { - x->preserve_security_context = on_off; -+ x->require_preserve_context = on_off; -+ } - break; - - default: @@ -909,7 +917,7 @@ main (int argc, char **argv) we'll actually use backup_suffix_string. */ backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - while ((c = getopt_long (argc, argv, "abdfHilLprst:uvxPRS:T", -+ while ((c = getopt_long (argc, argv, "abcdfHilLprst:uvxPRS:TZ", ++ while ((c = getopt_long (argc, argv, "abcdfHilLprst:uvxPRS:TZ:", long_opts, NULL)) != -1) { diff --git a/coreutils.spec b/coreutils.spec index 55d4e7d..b1d53e1 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: The GNU core utilities: a set of tools commonly used in shell scripts Name: coreutils Version: 6.12 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -333,6 +333,12 @@ fi /sbin/runuser %changelog +* Sun Oct 12 2008 Ondrej Vasik - 6.12-14 +- cp -Z now correctly separated in man page (#466646) +- cp -Z works again (#466653) +- make preservation of SELinux CTX non-mandatory for + preserve=all cp option + * Wed Oct 08 2008 Ondrej Vasik - 6.12-13 - remove unimplemented (never accepted by upstream) option for chcon changes only. Removed from help and man.