[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] Possible Bug in BB Init
From:       Gene Cumm <greenpuddy () stny ! rr ! com>
Date:       2003-03-22 12:21:02
[Download RAW message or body]

OK, found the lines in init that cause me to have a problem. While 
reading /etc/inittab,  it checks for the terminal before adding it to 
the linked list of actions to perform.

The attached patch moves the check from new_init_action to run and since 
the action is in the list, the patch also removes it if the terminal is 
invalid.  This would allow the sysinit directive to create the devices 
and let a shell be attached with a different directive to a device 
created by the sysinit script/binary.

This patch should work perfectly on the stable tree and move easily into 
the unstable tree.

["init.diff" (text/plain)]

--- busybox-0.60.5/init_orig.c	Sat Mar 22 14:11:02 2003
+++ busybox-0.60.5/init.c	Sat Mar 22 14:12:28 2003
@@ -456,6 +456,11 @@
 	(void) &tmp_pid;
 #endif
 
+	if (access(a->terminal, R_OK|W_OK)){
+		delete_init_action(a);
+		return;
+	}
+
 	/* inherit environment to the child, merging our values -andy */
 	for (i=0; environ[i]; i++) {
 		for (j=0; environment[j]; j++) {
@@ -847,8 +852,6 @@
 		cons = console;
 
 	/* do not run entries if console device is not available */
-	if (access(cons, R_OK|W_OK))
-		return;
 	if (strcmp(cons, "/dev/null") == 0 && (action & ASKFIRST))
 		return;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic