From unknown Sun Aug 17 10:26:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13119: cp --no-preserve=mode exits 1 since coreutils 8.20 Resent-From: Florian Pritz Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 07 Dec 2012 21:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13119 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 13119@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135491541218471 (code B ref -1); Fri, 07 Dec 2012 21:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Dec 2012 21:23:32 +0000 Received: from localhost ([127.0.0.1]:59354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Th5ON-0004nq-8A for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:23:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48436) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Th5C9-0004WC-5H for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:10:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Th5Bi-0003qa-U3 for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:10:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:59427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th5Bi-0003qW-QY for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:10:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th5Bc-0007O6-Vw for bug-coreutils@gnu.org; Fri, 07 Dec 2012 16:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Th5BT-0003os-Nl for bug-coreutils@gnu.org; Fri, 07 Dec 2012 16:10:20 -0500 Received: from karif.server-speed.net ([188.40.51.140]:41406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th5BT-0003lG-Gy for bug-coreutils@gnu.org; Fri, 07 Dec 2012 16:10:11 -0500 Received: from karif.server-speed.net (karif.server-speed.net [127.0.0.1]) by karif.server-speed.net (Postfix) with ESMTP id A494013804C for ; Fri, 7 Dec 2012 21:43:48 +0100 (CET) Received: from [192.168.4.247] (h081217049118.dyn.cm.kabsi.at [81.217.49.118]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: flo) by karif.server-speed.net (Postfix) with ESMTPSA for ; Fri, 7 Dec 2012 21:43:48 +0100 (CET) Message-ID: <50C25503.70206@xinu.at> Date: Fri, 07 Dec 2012 21:43:47 +0100 From: Florian Pritz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 X-Enigmail-Version: 1.4.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC3201C3328CC9A68BF6532BF" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Mailman-Approved-At: Fri, 07 Dec 2012 16:23:29 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC3201C3328CC9A68BF6532BF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I've used the following code in an update script. I don't want cp to change permission since the target directory has default ACLs in place that will set the correct permissions, but I want to keep timestamps so once upon a time I added "--preserve=3Dtimestamp --nopreserve=3Dmode,ownership". I've tested without mode now and it seems= permission are fine. mkdir a touch a/a cp -rfT --preserve=3Dtimestamps --no-preserve=3Dmode,ownership a b If I remove mode from the arguments to --no-preserve it exits 0, but if you have it it exits 1 and doesn't print anything. It worked in coreutils 8.19 (exit code 0) even though it might not actually do anything. If it's intended behaviour you should at least print some kind of error message. The cause of this change is commit 24ebca61a3a0f10d6cd2800b188b3c034d1c4755 but it doesn't say anything about changing the exit code. --=20 Florian Pritz --------------enigC3201C3328CC9A68BF6532BF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJQwlUEAAoJEG0WVcFM4cE+kqoP/2qU3Bvzx5Z6fYwQioZq1Pwb MztfrcJGfD1o/NZLo1HoQxIZ0FeyMN45fv/XIAQm8WFtsfOv1sU2eCdUvZxYT0Cm 9M8oJhng1ie1v3dO2KZrRgUME8K0kWgBnr1Oa9BKQV1Jy4S3GIPdWo7KEiBF84VN 9OeVN/39h7U3Vj1xfVaYMiFmgWHOVvLux0Ta/FTSL7dR18WDIH5zclVFO7315AE9 b84fusY2Kji1gYdlOQyzbVb+RggEy0sEsGSkFtwyTa7KuVISPfwKMpYRqSIJfy/0 mDp92iDA94pKX0vmkC/L8nn1ROnyMjQ7v+3Pc1EUj0mymFyRsxKi8qRlzVOCOwEn NiwwH041CY+88VfCHQTQIJuRHWJvNOD2r4/Hw7My/A+lndJfun3V6YwQudUQxhBz VXrk4RlmqJ2497mQemUSgqvOemaWJHVafSiwvI/ePGfre2I5xW3eHdSMPvzZZFzO 3/xvMRL4CZZVK36UsYlMAuBSAPoepMVF7XIxRFf0MMCBXVgGe7DByXJyo3OywejC B0JzaLyga07mVgZA+Al2plI3j8so3TSB0nUn+H0UBhtLr9QkLfQU7HogL/0goH31 p4D4Q9G2zHXxWNfLrNfPCE4N472G1zzrqSWusIfnoJZGck/lg8WUDdjdYprWSrpr owxoFUBhgt5UsL3skesz =/Mqf -----END PGP SIGNATURE----- --------------enigC3201C3328CC9A68BF6532BF-- From unknown Sun Aug 17 10:26:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13119: cp --no-preserve=mode exits 1 since coreutils 8.20 Resent-From: Bernhard Voelker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 08 Dec 2012 18:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13119 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Florian Pritz Cc: 13119@debbugs.gnu.org Received: via spool by 13119-submit@debbugs.gnu.org id=B13119.135499040726598 (code B ref 13119); Sat, 08 Dec 2012 18:14:01 +0000 Received: (at 13119) by debbugs.gnu.org; 8 Dec 2012 18:13:27 +0000 Received: from localhost ([127.0.0.1]:33147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThOtz-0006ux-5c for submit@debbugs.gnu.org; Sat, 08 Dec 2012 13:13:27 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:54356) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThOtw-0006up-Qg for 13119@debbugs.gnu.org; Sat, 08 Dec 2012 13:13:26 -0500 Received: from [192.168.1.11] (p4FC3E64E.dip.t-dialin.net [79.195.230.78]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LzWOk-1T3EbL3blK-01423O; Sat, 08 Dec 2012 19:12:58 +0100 Message-ID: <50C38329.8050106@bernhard-voelker.de> Date: Sat, 08 Dec 2012 19:12:57 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 References: <50C25503.70206@xinu.at> In-Reply-To: <50C25503.70206@xinu.at> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Zo0G/aR7/OuATWgXIN+fPZPiNKqJPFKZYtTAqmwI6jq 9cWcYsSSQhxx3rx9qs4Ngvlkypdn922SI7oy761q7vZ//bDwYL mcUkciFPCdnKf56yqpe91id199PsNhqPxUcTMEZ4dCO+Qw6jA9 fg1oX+S77zl/bzfZW8197c+xdGPuY0C8qWllnpV34abJ4hl2gr RUhoylevsUENG5/a+Io/sIuDXMwxofhPifHKIkB1yKwdQH5jMJ gZbwdOTkJrFsw/ZQs4leu6Lew/y3rUt+h8DVYMs3ARdx9j6/z6 75gvvxZRDfIlKsCEeJdOusb+SbE2W2l6DmSeT3964KM5+0e8te iIkO13bWJNTUh1wjTX69Uo3kpz0aIam0UsY0AwvGi X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On 12/07/2012 09:43 PM, Florian Pritz wrote: > Hi, > > I've used the following code in an update script. I don't want cp to > change permission since the target directory has default ACLs in place > that will set the correct permissions, but I want to keep timestamps so > once upon a time I added "--preserve=timestamp > --nopreserve=mode,ownership". I've tested without mode now and it seems > permission are fine. > > mkdir a > touch a/a > cp -rfT --preserve=timestamps --no-preserve=mode,ownership a b > > If I remove mode from the arguments to --no-preserve it exits 0, but if > you have it it exits 1 and doesn't print anything. It worked in > coreutils 8.19 (exit code 0) even though it might not actually do > anything. If it's intended behaviour you should at least print some kind > of error message. > > The cause of this change is commit > 24ebca61a3a0f10d6cd2800b188b3c034d1c4755 but it doesn't say anything > about changing the exit code. Thanks for the report. Outch, yes, unlike in other places, return_val is set to false unconditionally in copy_reg(): + else if (x->explicit_no_preserve_mode) + { + set_acl (dst_name, dest_desc, 0666 & ~cached_umask ()); + return_val = false; + } And furthermore, the test preserve-mode.sh which would have detected this error, don't check cp's exit code ;-( Here's a proposed patch. Have a nice day, Berny >From 62543570d72b756a3b04ca9d1ebec6f4dd2eea4b Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sat, 8 Dec 2012 19:09:19 +0100 Subject: [PATCH] cp: fix --no-preserve=mode to not exit 1 cp --no-preserve=mode exited 1 unconditionally. Furthermore, the tests which would have detected this error - namely link-preserve.sh and reserve-mode.sh - failed to test cp's exit code. * src/copy.c (copy_reg): In the case x->explicit_no_preserve_mode, do only set return_val to false iff the previous set_acl () failed. * tests/cp/link-preserve.sh: Check cp's exit code. * tests/cp/link-symlink.sh: Likewise. * tests/cp/preserve-mode.sh: Likewise. * NEWS: Mention the fix. Bug introduced in commit v8.19-145-g24ebca6. Reported by Florian Pritz in http://bugs.gnu.org/13119. --- NEWS | 3 +++ src/copy.c | 4 ++-- tests/cp/link-preserve.sh | 12 ++++++------ tests/cp/link-symlink.sh | 2 +- tests/cp/preserve-mode.sh | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index 0e1414c..6576b50 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes + cp --no-preserve=mode now no longer exits non-zero. + [bug introduced in coreutils-8.20] + cut no longer accepts the invalid range 0-, which made it print empty lines. Instead, cut now fails and emits an appropriate diagnostic. [This bug was present in "the beginning".] diff --git a/src/copy.c b/src/copy.c index 7a35414..0decf9f 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1153,8 +1153,8 @@ preserve_metadata: } else if (x->explicit_no_preserve_mode) { - set_acl (dst_name, dest_desc, 0666 & ~cached_umask ()); - return_val = false; + if (set_acl (dst_name, dest_desc, 0666 & ~cached_umask ()) != 0) + return_val = false; } else if (omitted_permissions) { diff --git a/tests/cp/link-preserve.sh b/tests/cp/link-preserve.sh index bb3b244..44768e4 100755 --- a/tests/cp/link-preserve.sh +++ b/tests/cp/link-preserve.sh @@ -37,7 +37,7 @@ rm -rf a b c touch a ln -s a b mkdir c -cp --preserve=links -R -H a b c +cp --preserve=links -R -H a b c || fail=1 a_inode=$(ls -i c/a|sed 's,c/.*,,') b_inode=$(ls -i c/b|sed 's,c/.*,,') test "$a_inode" = "$b_inode" || fail=1 @@ -46,7 +46,7 @@ test "$a_inode" = "$b_inode" || fail=1 # Ensure that -L makes cp follow the b->a symlink # and translates to hard-linked a and b in the destination dir. rm -rf a b c d; mkdir d; (cd d; touch a; ln -s a b) -cp --preserve=links -R -L d c +cp --preserve=links -R -L d c || fail=1 a_inode=$(ls -i c/a|sed 's,c/.*,,') b_inode=$(ls -i c/b|sed 's,c/.*,,') test "$a_inode" = "$b_inode" || fail=1 @@ -54,7 +54,7 @@ test "$a_inode" = "$b_inode" || fail=1 # Same as above, but starting with a/b hard linked. rm -rf a b c d; mkdir d; (cd d; touch a; ln a b) -cp --preserve=links -R -L d c +cp --preserve=links -R -L d c || fail=1 a_inode=$(ls -i c/a|sed 's,c/.*,,') b_inode=$(ls -i c/b|sed 's,c/.*,,') test "$a_inode" = "$b_inode" || fail=1 @@ -62,7 +62,7 @@ test "$a_inode" = "$b_inode" || fail=1 # Ensure that --no-preserve=links works. rm -rf a b c d; mkdir d; (cd d; touch a; ln a b) -cp -dR --no-preserve=links d c +cp -dR --no-preserve=links d c || fail=1 a_inode=$(ls -i c/a|sed 's,c/.*,,') b_inode=$(ls -i c/b|sed 's,c/.*,,') test "$a_inode" = "$b_inode" && fail=1 @@ -72,7 +72,7 @@ test "$a_inode" = "$b_inode" && fail=1 rm -rf a b c d touch a; ln a b mkdir c -cp -d a b c +cp -d a b c || fail=1 a_inode=$(ls -i c/a|sed 's,c/.*,,') b_inode=$(ls -i c/b|sed 's,c/.*,,') test "$a_inode" = "$b_inode" || fail=1 @@ -82,7 +82,7 @@ test "$a_inode" = "$b_inode" || fail=1 rm -rf a b c d touch a; chmod 731 a umask 077 -cp -a --no-preserve=mode a b +cp -a --no-preserve=mode a b || fail=1 mode=$(ls -l b|cut -b-10) test "$mode" = "-rw-------" || fail=1 umask 022 diff --git a/tests/cp/link-symlink.sh b/tests/cp/link-symlink.sh index 5186887..0b7fb6e 100755 --- a/tests/cp/link-symlink.sh +++ b/tests/cp/link-symlink.sh @@ -32,7 +32,7 @@ esac # link.cp is probably a hardlink, but may also be a symlink # In either case the timestamp should match the original. -cp -al link link.cp +cp -al link link.cp || fail=1 case $(stat --format=%y link.cp) in 2011-01-01*) ;; *) fail=1 ;; diff --git a/tests/cp/preserve-mode.sh b/tests/cp/preserve-mode.sh index dc97cba..e1096f5 100755 --- a/tests/cp/preserve-mode.sh +++ b/tests/cp/preserve-mode.sh @@ -26,7 +26,7 @@ touch b chmod 600 b #regular file test -cp --no-preserve=mode b c +cp --no-preserve=mode b c || fail=1 mode_a=$(ls -l a | gawk '{print $1}') mode_c=$(ls -l c | gawk '{print $1}') test "$mode_a" = "$mode_c" || fail=1 @@ -36,7 +36,7 @@ mkdir d1 d2 chmod 705 d2 #directory test -cp --no-preserve=mode -r d2 d3 +cp --no-preserve=mode -r d2 d3 || fail=1 mode_d1=$(ls -l d1 | gawk '{print $1}') mode_d3=$(ls -l d3 | gawk '{print $1}') test "$mode_d1" = "$mode_d3" || fail=1 @@ -46,7 +46,7 @@ touch a chmod 600 a #contradicting options test -cp --no-preserve=mode --preserve=all a b +cp --no-preserve=mode --preserve=all a b || fail=1 mode_a=$(ls -l a | gawk '{print $1}') mode_b=$(ls -l b | gawk '{print $1}') test "$mode_a" = "$mode_b" || fail=1 -- 1.7.7 From unknown Sun Aug 17 10:26:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13119: cp --no-preserve=mode exits 1 since coreutils 8.20 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 09 Dec 2012 12:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13119 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker Cc: 13119@debbugs.gnu.org, Florian Pritz Received: via spool by 13119-submit@debbugs.gnu.org id=B13119.13550573622012 (code B ref 13119); Sun, 09 Dec 2012 12:50:02 +0000 Received: (at 13119) by debbugs.gnu.org; 9 Dec 2012 12:49:22 +0000 Received: from localhost ([127.0.0.1]:33677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThgJu-0000WP-JT for submit@debbugs.gnu.org; Sun, 09 Dec 2012 07:49:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45919) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThgJs-0000WH-64 for 13119@debbugs.gnu.org; Sun, 09 Dec 2012 07:49:21 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB9CmkGB017668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 9 Dec 2012 07:48:46 -0500 Received: from [10.36.116.39] (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB9Cmiba021373 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 9 Dec 2012 07:48:45 -0500 Message-ID: <50C488AB.8020308@draigBrady.com> Date: Sun, 09 Dec 2012 12:48:43 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 References: <50C25503.70206@xinu.at> <50C38329.8050106@bernhard-voelker.de> In-Reply-To: <50C38329.8050106@bernhard-voelker.de> Content-Type: text/plain; charset=UTF-8; format=flowed X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qB9CmkGB017668 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) On 12/08/2012 06:12 PM, Bernhard Voelker wrote: > On 12/07/2012 09:43 PM, Florian Pritz wrote: >> Hi, >> >> I've used the following code in an update script. I don't want cp to >> change permission since the target directory has default ACLs in place >> that will set the correct permissions, but I want to keep timestamps s= o >> once upon a time I added "--preserve=3Dtimestamp >> --nopreserve=3Dmode,ownership". I've tested without mode now and it se= ems >> permission are fine. >> >> mkdir a >> touch a/a >> cp -rfT --preserve=3Dtimestamps --no-preserve=3Dmode,ownership a b >> >> If I remove mode from the arguments to --no-preserve it exits 0, but i= f >> you have it it exits 1 and doesn't print anything. It worked in >> coreutils 8.19 (exit code 0) even though it might not actually do >> anything. If it's intended behaviour you should at least print some ki= nd >> of error message. >> >> The cause of this change is commit >> 24ebca61a3a0f10d6cd2800b188b3c034d1c4755 but it doesn't say anything >> about changing the exit code. > > Thanks for the report. > > Outch, yes, unlike in other places, return_val is set to false > unconditionally in copy_reg(): > > + else if (x->explicit_no_preserve_mode) > + { > + set_acl (dst_name, dest_desc, 0666 & ~cached_umask ()); > + return_val =3D false; > + } > > And furthermore, the test preserve-mode.sh which would have > detected this error, don't check cp's exit code ;-( > > Here's a proposed patch. Ouch indeed. The patch looks perfect. thanks! P=C3=A1draig. From unknown Sun Aug 17 10:26:29 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Florian Pritz Subject: bug#13119: closed (Re: bug#13119: cp --no-preserve=mode exits 1 since coreutils 8.20) Message-ID: References: <50C4BD08.4040804@bernhard-voelker.de> <50C25503.70206@xinu.at> X-Gnu-PR-Message: they-closed 13119 X-Gnu-PR-Package: coreutils Reply-To: 13119@debbugs.gnu.org Date: Sun, 09 Dec 2012 16:33:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1355070782-21675-1" This is a multi-part message in MIME format... ------------=_1355070782-21675-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13119: cp --no-preserve=3Dmode exits 1 since coreutils 8.20 which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13119@debbugs.gnu.org. --=20 13119: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13119 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1355070782-21675-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13119-done) by debbugs.gnu.org; 9 Dec 2012 16:32:45 +0000 Received: from localhost ([127.0.0.1]:34258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Thjo4-0005d9-OB for submit@debbugs.gnu.org; Sun, 09 Dec 2012 11:32:44 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:63248) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Thjo2-0005d1-08 for 13119-done@debbugs.gnu.org; Sun, 09 Dec 2012 11:32:43 -0500 Received: from [192.168.1.11] (p4FC3E64E.dip.t-dialin.net [79.195.230.78]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0M9RBC-1Ts8rm29Gw-00CsRD; Sun, 09 Dec 2012 17:32:08 +0100 Message-ID: <50C4BD08.4040804@bernhard-voelker.de> Date: Sun, 09 Dec 2012 17:32:08 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= Subject: Re: bug#13119: cp --no-preserve=mode exits 1 since coreutils 8.20 References: <50C25503.70206@xinu.at> <50C38329.8050106@bernhard-voelker.de> <50C488AB.8020308@draigBrady.com> In-Reply-To: <50C488AB.8020308@draigBrady.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:UigiL9IVpOqnnfci/yT2vxOJRkWJSy3g3AUoJFCz1Be gbV6YOjGrvbmB724oweiM8FFKnGwITgsQiNC2u+k+TIS2XdoFc QDYJs8ZIQUjcMz9STUYKghMh50BdUHCbDRXlfeJve8GAq5GB0v lr1pfJOgT+0TticebuJRRuqEVYsSj0BuxGDaC+am/rKNSSA72C 7pQIEC9mFr8aCesFbmv+AId1byBz3Vdvy+VoKXm8TnTxwtUvqM RcAImkwwpxf/shK2Zd4zU7O18yd+MMeIO7bGWI7ah6anK5uez/ rrlCyt7TzVPgdA1WeESi0HdFZL3BfW3VlvfdLse2HeSuuENonw PISrDTrP+/sh9E9+JNcPPLdVXbO1j/JyllJwP0+yU X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13119-done Cc: 13119-done@debbugs.gnu.org, Florian Pritz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) On 12/09/2012 01:48 PM, Pádraig Brady wrote: > The patch looks perfect. Thanks for the review. Pushed: http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=62543570 Marking the bug as "done". Have a nice day, Berny ------------=_1355070782-21675-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Dec 2012 21:23:32 +0000 Received: from localhost ([127.0.0.1]:59354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Th5ON-0004nq-8A for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:23:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48436) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Th5C9-0004WC-5H for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:10:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Th5Bi-0003qa-U3 for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:10:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:59427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th5Bi-0003qW-QY for submit@debbugs.gnu.org; Fri, 07 Dec 2012 16:10:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th5Bc-0007O6-Vw for bug-coreutils@gnu.org; Fri, 07 Dec 2012 16:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Th5BT-0003os-Nl for bug-coreutils@gnu.org; Fri, 07 Dec 2012 16:10:20 -0500 Received: from karif.server-speed.net ([188.40.51.140]:41406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th5BT-0003lG-Gy for bug-coreutils@gnu.org; Fri, 07 Dec 2012 16:10:11 -0500 Received: from karif.server-speed.net (karif.server-speed.net [127.0.0.1]) by karif.server-speed.net (Postfix) with ESMTP id A494013804C for ; Fri, 7 Dec 2012 21:43:48 +0100 (CET) Received: from [192.168.4.247] (h081217049118.dyn.cm.kabsi.at [81.217.49.118]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: flo) by karif.server-speed.net (Postfix) with ESMTPSA for ; Fri, 7 Dec 2012 21:43:48 +0100 (CET) Message-ID: <50C25503.70206@xinu.at> Date: Fri, 07 Dec 2012 21:43:47 +0100 From: Florian Pritz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: cp --no-preserve=mode exits 1 since coreutils 8.20 X-Enigmail-Version: 1.4.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC3201C3328CC9A68BF6532BF" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 07 Dec 2012 16:23:29 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC3201C3328CC9A68BF6532BF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I've used the following code in an update script. I don't want cp to change permission since the target directory has default ACLs in place that will set the correct permissions, but I want to keep timestamps so once upon a time I added "--preserve=3Dtimestamp --nopreserve=3Dmode,ownership". I've tested without mode now and it seems= permission are fine. mkdir a touch a/a cp -rfT --preserve=3Dtimestamps --no-preserve=3Dmode,ownership a b If I remove mode from the arguments to --no-preserve it exits 0, but if you have it it exits 1 and doesn't print anything. It worked in coreutils 8.19 (exit code 0) even though it might not actually do anything. If it's intended behaviour you should at least print some kind of error message. The cause of this change is commit 24ebca61a3a0f10d6cd2800b188b3c034d1c4755 but it doesn't say anything about changing the exit code. --=20 Florian Pritz --------------enigC3201C3328CC9A68BF6532BF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJQwlUEAAoJEG0WVcFM4cE+kqoP/2qU3Bvzx5Z6fYwQioZq1Pwb MztfrcJGfD1o/NZLo1HoQxIZ0FeyMN45fv/XIAQm8WFtsfOv1sU2eCdUvZxYT0Cm 9M8oJhng1ie1v3dO2KZrRgUME8K0kWgBnr1Oa9BKQV1Jy4S3GIPdWo7KEiBF84VN 9OeVN/39h7U3Vj1xfVaYMiFmgWHOVvLux0Ta/FTSL7dR18WDIH5zclVFO7315AE9 b84fusY2Kji1gYdlOQyzbVb+RggEy0sEsGSkFtwyTa7KuVISPfwKMpYRqSIJfy/0 mDp92iDA94pKX0vmkC/L8nn1ROnyMjQ7v+3Pc1EUj0mymFyRsxKi8qRlzVOCOwEn NiwwH041CY+88VfCHQTQIJuRHWJvNOD2r4/Hw7My/A+lndJfun3V6YwQudUQxhBz VXrk4RlmqJ2497mQemUSgqvOemaWJHVafSiwvI/ePGfre2I5xW3eHdSMPvzZZFzO 3/xvMRL4CZZVK36UsYlMAuBSAPoepMVF7XIxRFf0MMCBXVgGe7DByXJyo3OywejC B0JzaLyga07mVgZA+Al2plI3j8so3TSB0nUn+H0UBhtLr9QkLfQU7HogL/0goH31 p4D4Q9G2zHXxWNfLrNfPCE4N472G1zzrqSWusIfnoJZGck/lg8WUDdjdYprWSrpr owxoFUBhgt5UsL3skesz =/Mqf -----END PGP SIGNATURE----- --------------enigC3201C3328CC9A68BF6532BF-- ------------=_1355070782-21675-1--