[BusyBox 0005864]: Disabling features not disabling corresponding command line options & Busybox not erroring on unknown options

bugs at busybox.net bugs at busybox.net
Sat Nov 1 00:15:59 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=5864 
====================================================================== 
Reported By:                Eero Tamminen
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   5864
Category:                   New Features
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             10-30-2008 06:24 PDT
Last Modified:              10-31-2008 17:15 PDT
====================================================================== 
Summary:                    Disabling features not disabling corresponding
command line options & Busybox not erroring on unknown options
Description: 
Busybox has two related issues:

1. Although Busybox features are configured out, it doesn't disable the
corresponding command line options, it just silently ignores them

2. Busybox doesn't give any errors on unknown options (in "ps" case, it
ignores all options)

This means that when e.g. building software using BB, Busybox can just
silently corrupt the generated data; when installing software,
installation scripts that given Busybox configuration breaks, don't fail
as they should etc.

====================================================================== 

---------------------------------------------------------------------- 
 vda - 10-30-08 16:51  
---------------------------------------------------------------------- 
I don't know what to do with this report.

There are more than 200 applets now, should I go and check all applets and
all options and whether they are accepted but ignored, or implemented not
exactly compatibly? How many days (years?) would that take? 

---------------------------------------------------------------------- 
 Eero Tamminen - 10-31-08 03:25  
---------------------------------------------------------------------- 
> I don't know what to do with this report.
> 
> There are more than 200 applets now, should I go and check all applets
and
> all options and whether they are accepted but ignored, or implemented
not
> exactly compatibly? How many days (years?) would that take?

First step would be adding the "missing option" warning and fatal config
option support for Busbox getopt() style functions.  This should fix half
the issue and be pretty easy to do (default switch case with ifdeffed
printf() & exit(-1)?).

IMHO the warning could be enabled by default as anybody building Busybox
himself can easily switch it off. The message could be: "WARNING: option
'%s' isn't implemented or enabled in Busybox."


I guess second step would be updating the instructions about the applet
development to state that if config option removes handling of options, it
should also change the getopt arguments appropriately.


Third step would be fixing the applets. A quick grep for "option",
"argument" and " -[a-z]" of the Busybox v1.10 config options reveals some
busybox config settings that modify what options are parsed, the list of
them is attached.  This tool probably would need an update too:
          Busybox chat require no options. To make it not fail when used
          in place of original chat (which has a bunch of options) turn
          this on.

First just the applets which are commonly used from scripts (e.g. in
Debian packages) could be fixed.  From the attached list those would be:
echo, head, tail, find, grep, pidof, ps, tar, xargs.

Rest could be fixed when noticed later on and have separate bugs.  Does
this sound reasonable? 

---------------------------------------------------------------------- 
 vda - 10-31-08 17:15  
---------------------------------------------------------------------- 
> adding the "missing option" warning and fatal config option support for
Busbox getopt() style functions. This should fix half the issue and be
pretty easy to do (default switch case with ifdeffed printf() &
exit(-1)?).

Can you demonstrate this in a patch form? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-30-08 06:24  Eero Tamminen  New Issue                                    
10-30-08 06:24  Eero Tamminen  Status                   new => assigned     
10-30-08 06:24  Eero Tamminen  Assigned To               => BusyBox         
10-30-08 16:51  vda            Note Added: 0014704                          
10-31-08 03:25  Eero Tamminen  Note Added: 0014764                          
10-31-08 17:15  vda            Note Added: 0014774                          
======================================================================



More information about the busybox-cvs mailing list