GNU bug report logs - #23277
md5sum: Output broken when filename contains \n

Previous Next

Package: coreutils;

Reported by: Ulrich Sibiller <u.sibiller <at> science-computing.de>

Date: Tue, 12 Apr 2016 15:33:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23277 in the body.
You can then email your comments to 23277 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#23277; Package coreutils. (Tue, 12 Apr 2016 15:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Sibiller <u.sibiller <at> science-computing.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 12 Apr 2016 15:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Sibiller <u.sibiller <at> science-computing.de>
To: bug-coreutils <at> gnu.org
Subject: md5sum: Output broken when filename contains \n
Date: Tue, 12 Apr 2016 15:17:57 +0200
Hello,

I observe a strange behaviour for {md5,sha1,sha512}sum on RHEL 6.7:

# sha512sum dat_files/1.000e-01*dat
a66f6f8f8da256d07330a17bea942bba9584e182799dce2a42bc7e882d4d9267c40568644d7f5b63128b286a6393764fc599cc30f687b8dacf86e0a96d87795c 
 dat_files/1.000e-01.dat
\a66f6f8f8da256d07330a17bea942bba9584e182799dce2a42bc7e882d4d9267c40568644d7f5b63128b286a6393764fc599cc30f687b8dacf86e0a96d87795c 
 dat_files/1.000e-01\n.dat

The second file has \n in the name and the output gets a backslash prepended which looks wrong to me.

Kind regards,

Ulrich Sibiller
-- 
Vorstandsvorsitzender/Chairman of the board of management:
Dr. Martin Matzke
Vorstand/Board of Management:
Johannes Barthmes, Yvonne Veyhelmann
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Aufsichtsrat/Supervisory Board:
Martin Wibbe, Winfried Holz
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Tue, 12 Apr 2016 15:38:02 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Tue, 12 Apr 2016 15:38:02 GMT) Full text and rfc822 format available.

Notification sent to Ulrich Sibiller <u.sibiller <at> science-computing.de>:
bug acknowledged by developer. (Tue, 12 Apr 2016 15:38:03 GMT) Full text and rfc822 format available.

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

From: Eric Blake <eblake <at> redhat.com>
To: Ulrich Sibiller <u.sibiller <at> science-computing.de>,
 23277-done <at> debbugs.gnu.org
Subject: Re: bug#23277: md5sum: Output broken when filename contains \n
Date: Tue, 12 Apr 2016 09:37:47 -0600
[Message part 1 (text/plain, inline)]
tag 23277 notabug
thanks

On 04/12/2016 07:17 AM, Ulrich Sibiller wrote:
> Hello,
> 
> I observe a strange behaviour for {md5,sha1,sha512}sum on RHEL 6.7:
> 
> # sha512sum dat_files/1.000e-01*dat
> a66f6f8f8da256d07330a17bea942bba9584e182799dce2a42bc7e882d4d9267c40568644d7f5b63128b286a6393764fc599cc30f687b8dacf86e0a96d87795c
>  dat_files/1.000e-01.dat
> \a66f6f8f8da256d07330a17bea942bba9584e182799dce2a42bc7e882d4d9267c40568644d7f5b63128b286a6393764fc599cc30f687b8dacf86e0a96d87795c
>  dat_files/1.000e-01\n.dat
> 
> The second file has \n in the name and the output gets a backslash
> prepended which looks wrong to me.

Thanks for the report, but the behavior you are seeing is documented as
intentional.  This is so that a newline in a filename is unambiguously
parseable via an escape sequence (the leading \ tells you that escape
sequences will be present).  As the manual mentions that this is
intentional behavior, I'm closing this as not a bug, but feel free to
respond with further comments.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 May 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 44 days ago.

Previous Next


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