GNU bug report logs - #17087
cp -i/yes gets ignored

Previous Next

Package: coreutils;

Reported by: karl <at> freefriends.org (Karl Berry)

Date: Mon, 24 Mar 2014 16:18:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 17087-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 17087-done <at> debbugs.gnu.org, Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#17087: cp -i/yes gets ignored
Date: Tue, 25 Mar 2014 11:10:19 +0000
On 03/25/2014 06:25 AM, Paul Eggert wrote:
> Pádraig Brady wrote:
>> That code has been there "from the beginning" and I'm guessing it's
>> to prompt users to allow them to chmod the file in a separate terminal?
> 
> If we go back far enough (i.e., before commit 6bf3479 dated 2000-08-27), this message was output only if -f was also given.

Things have flipped around a bit. Originally no prompts were output at all with --force (which was incorrect).

> More recently we've seen similar complaints, e.g.: http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html

Ah thanks for linking that.

> At least the diagnostic wording could be improved so that users who are prompted don't get the false impression that the copy will succeed; POSIX clearly allows this.  I installed the attached patches (the second is just a code cleanup).  Perhaps that's enough.

Looks good.

It will need adjustment so that the second string is tagged for translation.
I'll apply the following:

diff --git a/src/copy.c b/src/copy.c
index 71813dc..68b4c5e 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1575,10 +1575,10 @@ overwrite_ok (struct cp_options const *x, char const *dst_name,
       strmode (dst_sb->st_mode, perms);
       perms[10] = '\0';
       fprintf (stderr,
-               _((x->unlink_dest_before_opening
-                  || x->unlink_dest_after_failed_open)
-                 ? "%s: replace %s, overriding mode %04lo (%s)? "
-                 : "%s: unwritable %s (mode %04lo, %s); try anyway? "),
+               (x->unlink_dest_before_opening
+                || x->unlink_dest_after_failed_open)
+               ? _("%s: replace %s, overriding mode %04lo (%s)? ")
+               : _("%s: unwritable %s (mode %04lo, %s); try anyway? "),
                program_name, quote (dst_name),
                (unsigned long int) (dst_sb->st_mode & CHMOD_MODE_BITS),
                &perms[1]);

Marking this bug as done.

thanks,
Pádraig.




This bug report was last modified 11 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.