[BusyBox] run-parts bug report

Nick Fedchik fnm at fusion.ukrsat.com
Thu Nov 21 10:02:03 UTC 2002


On Thu, 21 Nov 2002, Vladimir N. Oleynik wrote:

> Nick,
> I can`t test it, I don`t use run_part applet ;)
It's fixed.
Tests has successful results on patched code.
Also I changed one line - see the attached patch.

Spasibo, Volodya! ;)

-- 
Nick Fedchik <fnm at fusion.ukrsat.com>
FNM3-RIPE (-UANIC), UkrSat ISP
-------------- next part --------------
--- busybox.orig/libbb/run_parts.c	Thu Nov 21 18:37:40 2002
+++ busybox/libbb/run_parts.c	Thu Nov 21 18:41:44 2002
@@ -50,6 +50,7 @@
 	struct dirent **namelist = 0;
 	struct stat st;
 	char *filename;
+	char *arg0 = args[0];
 	int entries;
 	int i;
 	int exitstatus = 0;
@@ -60,15 +61,15 @@
 	(void) &exitstatus;
 #endif
 	/* scandir() isn't POSIX, but it makes things easy. */
-	entries = scandir(args[0], &namelist, valid_name, alphasort);
+	entries = scandir(arg0, &namelist, valid_name, alphasort);
 
 	if (entries == -1) {
-		perror_msg_and_die("failed to open directory %s", args[0]);
+		perror_msg_and_die("failed to open directory %s", arg0);
 	}
 
 	for (i = 0; i < entries; i++) {
 
-		filename = concat_path_file(args[0], namelist[i]->d_name);
+		filename = concat_path_file(arg0, namelist[i]->d_name);
 
 		if (stat(filename, &st) < 0) {
 			perror_msg_and_die("failed to stat component %s", filename);


More information about the busybox mailing list