[BusyBox 0000884]: Msh "job control" fix breaks system() function

bugs at busybox.net bugs at busybox.net
Fri May 26 02:17:45 UTC 2006


The following issue has been UPDATED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=884 
====================================================================== 
Reported By:                Alain137
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   884
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             05-25-2006 09:42 PDT
Last Modified:              05-25-2006 19:17 PDT
====================================================================== 
Summary:                    Msh "job control" fix breaks system() function
Description: 
>From 1.1.2 to 1.1.3, the following change was done:

--- busybox-1.1.2.orig/shell/msh.c      2006-03-22 22:16:21.000000000
+0100
+++ busybox-1.1.3.orig/shell/msh.c      2006-05-17 20:51:46.000000000
+0200
@@ -3026,6 +3026,10 @@
        if (resetsig) {
                signal(SIGINT, SIG_DFL);
                signal(SIGQUIT, SIG_DFL);
+       } else {
+               /* put non-interactive processes into a different process
group.
+                * we don't support jobs, but this is at least sane: see
Bug 659 */
+               setpgrp();
        }

        if (t->type == TPAREN)


Ok, so this may fix jobs, but it certainly breaks the system() function
that is used by various programs to spawn children via the shell. The
problem is that when msh invoked as sh -c "command", it also goes into
non-interactive mode, and changes the process group... with the result
that the spawned command may not read from the terminal!
====================================================================== 

---------------------------------------------------------------------- 
 vapier - 05-25-06 19:17  
---------------------------------------------------------------------- 
yeah we noticed this while doing some testing ourselves

http://blackfin.uclinux.org/tracker/?func=detail&atid=141&aid=1313&group_id=17 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-25-06 09:42  Alain137       New Issue                                    
05-25-06 09:42  Alain137       Status                   new => assigned     
05-25-06 09:42  Alain137       Assigned To               => BusyBox         
05-25-06 19:17  vapier         Note Added: 0001385                          
05-25-06 19:17  vapier         Summary                  Msh "job control" "fix"
breaks system() function => Msh "job control" fix breaks system() function
======================================================================




More information about the busybox-cvs mailing list