[BusyBox 0001425]: switch_root steals args meant for the new init

bugs at busybox.net bugs at busybox.net
Wed Feb 13 17:25:48 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=1425 
====================================================================== 
Reported By:                owen
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1425
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             07-08-2007 23:18 PDT
Last Modified:              02-13-2008 09:25 PST
====================================================================== 
Summary:                    switch_root steals args meant for the new init
Description: 
The format for a call to switch_root is:
switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGUMENTS_TO_INIT]

The init man page includes:
-z xxx
            The  argument  to  -z is ignored. You can use this to expand
the command line a bit, so that it takes some more space on the stack.
Init can then manipulate the  command  line so that ps(1) shows the
current runlevel.

But, the getopt32() function notices the flag at the end, and bails with a
"switch_root: illegal option -- z"
I'm not a C guru; is there a way to make getopt32() stop parsing at the
first non-option? Or maybe at least exclude the last one?
====================================================================== 

---------------------------------------------------------------------- 
 vda - 02-13-08 09:25  
---------------------------------------------------------------------- 
Fixed in rev 21008. Thanks. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-08-07 23:18  owen           New Issue                                    
07-08-07 23:18  owen           Status                   new => assigned     
07-08-07 23:18  owen           Assigned To               => BusyBox         
02-13-08 09:25  vda            Status                   assigned => closed  
02-13-08 09:25  vda            Note Added: 0004494                          
======================================================================




More information about the busybox-cvs mailing list