[BusyBox-cvs] busybox/include libbb.h,1.106,1.107

Erik Andersen andersen at busybox.net
Tue Jul 29 07:06:10 UTC 2003


Update of /var/cvs/busybox/include
In directory winder:/tmp/cvs-serv8695/include

Modified Files:
	libbb.h 
Log Message:
Bruno Randolf writes:

this patch fixes run_parts when it's called by ifupdown. 1) argv has to be a
NULL terminated char* array, not just a string. 2) run_parts now explicitly
sets the environment. this environment is populated from the
/etc/network/interfaces config file and is needed by the scripts in
/etc/network/if-pre-up.d/. when run-parts is called from the command line the
environment is taken from the current process.


Vladimir Oleynik then wrote:

You can simplify this if use:

+       bb_xasprintf(&buf[0], "/etc/network/if-%s.d", opt);
+       buf[1] = NULL;
+
+       run_parts(&buf, 2, environ);
+       free(buf[0]);

--w
vodz



Index: libbb.h
===================================================================
RCS file: /var/cvs/busybox/include/libbb.h,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- libbb.h	28 Jul 2003 07:40:34 -0000	1.106
+++ libbb.h	29 Jul 2003 07:05:36 -0000	1.107
@@ -405,7 +405,7 @@
 	, security_id_t sid
 #endif
 );
-extern int run_parts(char **args, const unsigned char test_mode);
+extern int run_parts(char **args, const unsigned char test_mode, char **env);
 extern int restricted_shell ( const char *shell );
 extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw );
 extern int correct_password ( const struct passwd *pw );




More information about the busybox-cvs mailing list