[coreutils] cp: correct error message for invalid arguments of '--no-preserve' (#1018206)

Ondrej Vasik ovasik at fedoraproject.org
Mon Oct 14 07:58:50 UTC 2013


commit 9b2b9416824f0c72dab7997212a33a504eb2e777
Author: Ondřej Vašík <ovasik at redhat.com>
Date:   Mon Oct 14 09:58:44 2013 +0200

    cp: correct error message for invalid arguments of '--no-preserve' (#1018206)

 coreutils-cp-nopreserve-invalidargs.patch |   29 +++++++++++++++++++++++++++++
 coreutils.spec                            |    8 +++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/coreutils-cp-nopreserve-invalidargs.patch b/coreutils-cp-nopreserve-invalidargs.patch
new file mode 100644
index 0000000..5933b91
--- /dev/null
+++ b/coreutils-cp-nopreserve-invalidargs.patch
@@ -0,0 +1,29 @@
+From 124ab798e65b6c95a8486f6f6af9bdf69b11e1bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <ovasik at redhat.com>
+Date: Fri, 11 Oct 2013 14:44:53 +0200
+Subject: [PATCH] cp: correct error message for invalid arguments of '--no-preserve'
+
+* src/cp.c (decode_preserve_arg) :
+Correct error message for invalid arguments of '--no-preserve'.
+Reported by M.Vadkerti in rhbz #1018206
+---
+ src/cp.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/src/cp.c b/src/cp.c
+index e235b32..7bc8630 100644
+--- a/src/cp.c
++++ b/src/cp.c
+@@ -854,7 +854,8 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
+         *comma++ = 0;
+ 
+       /* process S.  */
+-      val = XARGMATCH ("--preserve", s, preserve_args, preserve_vals);
++      val = XARGMATCH (on_off ? "--preserve" : "--no-preserve",
++                       s, preserve_args, preserve_vals);
+       switch (val)
+         {
+         case PRESERVE_MODE:
+-- 
+1.7.1
+
diff --git a/coreutils.spec b/coreutils.spec
index bb9c1ee..de68bd3 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
 Summary: A set of basic GNU tools commonly used in shell scripts
 Name:    coreutils
 Version: 8.21
-Release: 18%{?dist}
+Release: 19%{?dist}
 License: GPLv3+
 Group:   System Environment/Base
 Url:     http://www.gnu.org/software/coreutils/
@@ -15,6 +15,7 @@ Source106:  coreutils-colorls.csh
 # From upstream
 Patch1: coreutils-8.21-install-strip.patch
 Patch2: coreutils-aarch64-longlong.patch
+Patch3: coreutils-cp-nopreserve-invalidargs.patch
 
 # Our patches
 #general patch to workaround koji build system issues
@@ -129,6 +130,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
 # From upstream
 %patch1 -p1 -b .strip
 %patch2 -p1 -b .aarch64
+%patch3 -p1 -b .nopres
 
 # Our patches
 %patch100 -p1 -b .configure
@@ -375,6 +377,10 @@ fi
 %{_sbindir}/chroot
 
 %changelog
+* Mon Oct 14 2013 Ondrej Vasik <ovasik at redhat.com> 8.21-19
+- cp: correct error message for invalid arguments
+  of '--no-preserve' (#1018206)
+
 * Thu Aug 15 2013 Ondrej Vasik <ovasik at redhat.com> 8.21-18
 - pr -e, with a mix of backspaces and TABs, could corrupt the heap
   in multibyte locales (analyzed by J.Koncicky)


More information about the scm-commits mailing list