fix cp -Z issues(#466653, #466646), do not require preservation of SELinux

CTX for preserve=all cp mode
This commit is contained in:
Ondrej Vasik 2008-10-12 16:14:22 +00:00
parent 0beb80a141
commit 146c35e640
2 changed files with 9 additions and 15 deletions

View File

@ -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)
{

View File

@ -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 <ovasik@redhat.com> - 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 <ovasik@redhat.com> - 6.12-13
- remove unimplemented (never accepted by upstream) option
for chcon changes only. Removed from help and man.