Bug 3769

Summary: Non compliant option on od
Product: Busybox Reporter: Zakhar <jimfr06>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED INVALID    
Severity: minor CC: busybox-cvs, jimfr06
Priority: P5    
Version: 1.16.x   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:

Description Zakhar 2011-05-21 09:13:11 UTC
First I want to apologize in advance if my report is not complete, because I don't have the hardware/software I report on.
I just report it because I ran into it while improving a script to make it run on Synology DS1010+ that uses 

BusyBox v1.16.1 (2011-02-25 19:05:47 CST) multi-call binary.

The whole story (with explained and workaround-ed differences) is here http://forum.ubuntu-fr.org/viewtopic.php?id=408024&p=2 (sorry it is in French), starting at post #36 and next.


The "bug" occurs on 'od', which is not part of the 'core' for Synology DS1010+ but belongs to 'texutils'. Sorry don't know which version of 'textutil' it is exactly, but it is the one available for Synology DS1010+ with the extension process.

So here is what the help of od says:

od --help
Usage: od [OPTION]... [FILE]...
  or:  od --traditional [FILE] [[+]OFFSET [[+]LABEL]]

Write an unambiguous representation, octal bytes by default,
of FILE to standard output.  With more than one FILE argument,
concatenate them in the listed order to form the input.
With no FILE, or when FILE is -, read standard input.

All arguments to long options are mandatory for short options.
  -A, --address-radix=RADIX   decide how file offsets are printed
  -j, --skip-bytes=BYTES      skip BYTES input bytes first
  -N, --read-bytes=BYTES      limit dump to BYTES input bytes
  -s, --strings[=BYTES]       output strings of at least BYTES graphic chars


Please notice the -s (lowercase 's'), short option for --string

(Be aware also that in the process, the tester warped to Busybox 1.10.3, I don't know it that has an effect on the options recognized by 'od')


Unfortunately that is NOT COMPLIANT.
The compliant short form is -S (uppercase 'S')


But I ran into the bug myself on GNU version of 'od' because there is a translation bug I filed on the ubuntu tracking system (link here: https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/784758 )

The "bug" in the GNU world is only translation as you can see here :

$ env LANGUAGE=en_GB:en od --help | grep strings
  -S, --strings[=BYTES]       output strings of at least BYTES graphic chars

$ env LANGUAGE=fr_FR:fr od --help | grep strings
  -s, --strings[=BYTES]       affiche les chaînes d'au moins BYTES caractères

So may be it was this old bug that tricked you into using a "non-compliant" short form for --string. The "bug" in still there on the GNU version for French translations (and potentially others?) but it is correct in english.

In both case, the 'man' that is in English displays the correct option.

The GNU 'od' accepts -S (uppercase 'S') as short for --string
For the GNU 'od' -s (lowercase 's') seems to have other meaning than --string.


Of course the bug is "minor" as you can still workaround (didn't test) using the long form --string


Best regards, in the hope my report helps better compliance of your fantastic work (with no increase in the footprint of Busybox as it is only a "typo").
Comment 1 Denys Vlasenko 2011-05-21 16:51:21 UTC
> I just report it because I ran into it while improving a script to make it run
> on Synology DS1010+ that uses 
> 
> BusyBox v1.16.1 (2011-02-25 19:05:47 CST) multi-call binary.
> 
> The whole story (with explained and workaround-ed differences) is here
> http://forum.ubuntu-fr.org/viewtopic.php?id=408024&p=2 (sorry it is in French),
> starting at post #36 and next.
> 
> The "bug" occurs on 'od', which is not part of the 'core' for Synology DS1010+
> but belongs to 'texutils'. Sorry don't know which version of 'textutil' it is
> exactly, but it is the one available for Synology DS1010+ with the extension
> process.
> 
> So here is what the help of od says:
> 
> od --help
> Usage: od [OPTION]... [FILE]...
>   or:  od --traditional [FILE] [[+]OFFSET [[+]LABEL]]
> 
> Write an unambiguous representation, octal bytes by default,
> of FILE to standard output.  With more than one FILE argument,
> concatenate them in the listed order to form the input.
> With no FILE, or when FILE is -, read standard input.
> 
> All arguments to long options are mandatory for short options.
>   -A, --address-radix=RADIX   decide how file offsets are printed
>   -j, --skip-bytes=BYTES      skip BYTES input bytes first
>   -N, --read-bytes=BYTES      limit dump to BYTES input bytes
>   -s, --strings[=BYTES]       output strings of at least BYTES graphic chars
> 
> 
> Please notice the -s (lowercase 's'), short option for --string
> 
> (Be aware also that in the process, the tester warped to Busybox 1.10.3, I
> don't know it that has an effect on the options recognized by 'od')
> 
> Unfortunately that is NOT COMPLIANT.
> The compliant short form is -S (uppercase 'S')

busybox od uses -S, not -s, since 1.3.x

I updated help in git, now it reads:

$ ./busybox od --help
BusyBox v1.19.0.git (2011-05-14 04:11:13 CEST) multi-call binary.

Usage: od [-abcdfhilovxs] [-t TYPE] [-A RADIX] [-N SIZE] [-j SKIP] [-S MINSTR] [-w WIDTH] [FILE...]

Print FILEs (or stdin) unambiguously, as octal bytes by default
Comment 2 Zakhar 2011-05-21 17:58:44 UTC
Thanks for the quick answer.

We must have gotten a very old version of 'textutils' then, as for Synology DS1010+, 'od' is packed with other utilities in the 'textutils' package.

I did also look at the changelog on Busybox before posting, but it didn't got that far back in the past!