[BusyBox 0001201]: Misuses "#ifdef ENABLE_FEATURE_EXEC_PREFER_APPLETS" (with patches)

bugs at busybox.net bugs at busybox.net
Wed Feb 7 20:27:21 UTC 2007


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=1201 
====================================================================== 
Reported By:                rockeychu
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1201
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             02-06-2007 20:11 PST
Last Modified:              02-07-2007 12:27 PST
====================================================================== 
Summary:                    Misuses "#ifdef ENABLE_FEATURE_EXEC_PREFER_APPLETS"
(with patches)
Description: 
Since SVN r17733, it introduced a micro of
ENABLE_FEATURE_EXEC_PREFER_APPLETS, but misused it.
ENABLE_FEATURE_EXEC_PREFER_APPLETS is always defined, but value just as 0
or 1, so you should use "if" instead of "#ifdef".

BTW, I got it while new Busybox_SVN can't boot my puppy linux (it use
pivot_root & chroot in init script, and chroot can't exec sh -c
"/bin/busybox init").


Patches as following:

Index: include/libbb.h
===================================================================
--- include/libbb.h     (revision 17803)
+++ include/libbb.h     (working copy)
@@ -561,7 +561,7 @@
 char *find_execable(const char *filename);
 int exists_execable(const char *filename);

-#ifdef ENABLE_FEATURE_EXEC_PREFER_APPLETS
+#if ENABLE_FEATURE_EXEC_PREFER_APPLETS
 int bb_execvp(const char *file, char *const argv[]);
 #define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd)
 #define BB_EXECLP(prog,cmd,...) \

Index: libbb/execable.c
===================================================================
--- libbb/execable.c    (revision 17803)
+++ libbb/execable.c    (working copy)
@@ -60,7 +60,7 @@
        return 0;
 }

-#ifdef ENABLE_FEATURE_EXEC_PREFER_APPLETS
+#if ENABLE_FEATURE_EXEC_PREFER_APPLETS
 /* just like the real execvp, but try to launch an applet named 'file'
first
  */
 int bb_execvp(const char *file, char *const argv[])

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

---------------------------------------------------------------------- 
 vda - 02-07-07 12:27  
---------------------------------------------------------------------- 
Fixed in rev 17807, thanks 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-06-07 20:11  rockeychu      New Issue                                    
02-06-07 20:11  rockeychu      Status                   new => assigned     
02-06-07 20:11  rockeychu      Assigned To               => BusyBox         
02-07-07 12:27  vda            Status                   assigned => closed  
02-07-07 12:27  vda            Note Added: 0002134                          
======================================================================




More information about the busybox-cvs mailing list