emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#23388: closed ([PATCH] size option may want to rej


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#23388: closed ([PATCH] size option may want to reject "bB" or "biB" suffix)
Date: Wed, 27 Apr 2016 19:13:01 +0000

Your message dated Wed, 27 Apr 2016 12:12:03 -0700
with message-id <address@hidden>
and subject line Re: bug#23388: [PATCH] size option may want to reject "bB" or 
"biB" suffix
has caused the debbugs.gnu.org bug report #23388,
regarding [PATCH] size option may want to reject "bB" or "biB" suffix
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
23388: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23388
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] size option may want to reject "bB" or "biB" suffix Date: Thu, 28 Apr 2016 01:29:21 +0900
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

Attachment: 0001-Reject-unaccepted-suffixes-such-as-bB-or-biB.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#23388: [PATCH] size option may want to reject "bB" or "biB" suffix Date: Wed, 27 Apr 2016 12:12:03 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0
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.

Attachment: 0001-xstrtol-prohibit-monstrosities-like-1bB.patch
Description: Source code patch


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]