GNU bug report logs - #64392
cksum: escaping issues of --check output

Previous Next

Package: coreutils;

Reported by: Christoph Anton Mitterer <calestyo <at> scientia.org>

Date: Sat, 1 Jul 2023 00:22:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Christoph Anton Mitterer <calestyo <at> scientia.org>, 64392 <at> debbugs.gnu.org
Subject: bug#64392: cksum: escaping issues of --check output
Date: Sat, 1 Jul 2023 18:53:10 +0100
On 01/07/2023 18:20, Christoph Anton Mitterer wrote:
> On Sat, 2023-07-01 at 17:07 +0100, Pádraig Brady wrote:
>> Right. We traditionally didn't escape any chars in the --check
>> output,
>> but that changed with
>> https://github.com/coreutils/coreutils/commit/646902b30
>> To minimize escaping, that patch only considered the '\n' character,
>> but we should also have considered file names with a leading '\'.
>>
>> The attached should address this.
> 
> Thanks, but wouldn't it be better to use exactly the same escaping as
> in the sums output? I.e. also escaping \r?

Yes maybe. I was thinking this status output would be less likely to be persisted,
and so would not need the same escaping requirements,
but for consistency it may be better to have the same escaping rules,
with the caveat that file names with a literal backslash anywhere
would now be escaped. That's not a common case I suppose,
so I'm amenable to using the consistent escaping here.

> Also, documenting the escaping behaviour in info/manpages?

Info docs already contain:

"Without ‘--zero’, if FILE contains a backslash, newline, or carriage
return, the line is started with a backslash, and each problematic
character in the file name is escaped with a backslash, making the
output unambiguous even in the presence of arbitrary file names."

cheers,
Pádraig





This bug report was last modified 2 years and 7 days ago.

Previous Next


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