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

This commit is contained in:
Ondřej Vašík 2013-10-14 09:58:44 +02:00
parent 32c6651930
commit 9b2b941682
2 changed files with 36 additions and 1 deletions

View File

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

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils Name: coreutils
Version: 8.21 Version: 8.21
Release: 18%{?dist} Release: 19%{?dist}
License: GPLv3+ License: GPLv3+
Group: System Environment/Base Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/ Url: http://www.gnu.org/software/coreutils/
@ -15,6 +15,7 @@ Source106: coreutils-colorls.csh
# From upstream # From upstream
Patch1: coreutils-8.21-install-strip.patch Patch1: coreutils-8.21-install-strip.patch
Patch2: coreutils-aarch64-longlong.patch Patch2: coreutils-aarch64-longlong.patch
Patch3: coreutils-cp-nopreserve-invalidargs.patch
# Our patches # Our patches
#general patch to workaround koji build system issues #general patch to workaround koji build system issues
@ -129,6 +130,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
# From upstream # From upstream
%patch1 -p1 -b .strip %patch1 -p1 -b .strip
%patch2 -p1 -b .aarch64 %patch2 -p1 -b .aarch64
%patch3 -p1 -b .nopres
# Our patches # Our patches
%patch100 -p1 -b .configure %patch100 -p1 -b .configure
@ -375,6 +377,10 @@ fi
%{_sbindir}/chroot %{_sbindir}/chroot
%changelog %changelog
* Mon Oct 14 2013 Ondrej Vasik <ovasik@redhat.com> 8.21-19
- cp: correct error message for invalid arguments
of '--no-preserve' (#1018206)
* Thu Aug 15 2013 Ondrej Vasik <ovasik@redhat.com> 8.21-18 * Thu Aug 15 2013 Ondrej Vasik <ovasik@redhat.com> 8.21-18
- pr -e, with a mix of backspaces and TABs, could corrupt the heap - pr -e, with a mix of backspaces and TABs, could corrupt the heap
in multibyte locales (analyzed by J.Koncicky) in multibyte locales (analyzed by J.Koncicky)