GNU bug report logs -
#23388
[PATCH] size option may want to reject "bB" or "biB" suffix
Previous Next
Reported by: Young Mo Kang <kym327 <at> gmail.com>
Date: Wed, 27 Apr 2016 16:44:02 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
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 23388 in the body.
You can then email your comments to 23388 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#23388
; Package
coreutils
.
(Wed, 27 Apr 2016 16:44:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Young Mo Kang <kym327 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Wed, 27 Apr 2016 16:44:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
I found a bug in coreutils' size option, which currently accepts options
like "split -b 1bB" or "split -b 1biB". I believe these options should be
rejected. I looked through the code and found out that gnulib's __xstrtol
function in xstrtol.c is the culprit. I did a quick fix and the patch is
attached. The patch should fix this issue in general.
Additionally, while looking at the code, I may have found another bug, but
I am not so sure whether this is how it is intended. When I run "shred -s
1B", I think it should shred only a single byte, but it seems to shred 1024
bytes instead. Is this behavior intended?
Anyways, I have marked this down in the patch as a FIXME comment. Since the
patch applies to gnulib, I am not sure whether this patch should be
submitted to gnulib bug report instead. Please let me know if so.
Lastly, I noticed that different programs within coreutils accept different
size suffixes. For example, split's valid suffix is "bEGKkMmPTYZ0" while
shred's is "cbBkKMGTPEZY0". I thought maybe it is better to unify valid
suffix for all the programs within coreutils.
Best,
Young Mo
[Message part 2 (text/html, inline)]
[0001-Reject-unaccepted-suffixes-such-as-bB-or-biB.patch (text/x-patch, attachment)]
Reply sent
to
Paul Eggert <eggert <at> cs.ucla.edu>
:
You have taken responsibility.
(Wed, 27 Apr 2016 19:13:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Young Mo Kang <kym327 <at> gmail.com>
:
bug acknowledged by developer.
(Wed, 27 Apr 2016 19:13:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 23388-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 04/27/2016 09:29 AM, Young Mo Kang wrote:
> different programs within coreutils accept different
> size suffixes. For example, split's valid suffix is "bEGKkMmPTYZ0" while
> shred's is "cbBkKMGTPEZY0". I thought maybe it is better to unify valid
> suffix for all the programs within coreutils.
The intent, as I recall, was to prefer a standard set of suffixes listed
in the "Block size" section of the Coreutils manual. Some programs
accept additional suffixes for historical reasons but we'd rather not
encourage the use of these obsolescent usages.
Thanks for reporting the glitch. I installed the attached patch into Gnulib.
[0001-xstrtol-prohibit-monstrosities-like-1bB.patch (application/x-patch, attachment)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 26 May 2016 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 9 years and 26 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.