[BusyBox 0001336]: [BUG] msh: wrong handling of backticks if stdout is closed in shell

bugs at busybox.net bugs at busybox.net
Mon May 7 07:09:18 UTC 2007


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1336 
====================================================================== 
Reported By:                landau
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1336
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             05-07-2007 00:09 PDT
Last Modified:              05-07-2007 00:09 PDT
====================================================================== 
Summary:                    [BUG] msh: wrong handling of backticks if stdout is
closed in shell
Description: 
When running a script like "files=`ls`", when the script's file descriptor
1 is closed, the command is executed, but its output is discarded and the
files variable stays empty.
What happens is that the pipe msh creates gets fd 1, and then msh dups it
to 1 (a no-op in this case), and closes the pipe (which is 1) without
checking.
The patch, instead of thoughtlessly closing pipefd[0] and pipefd[1] checks
whether any of them is 1 and does not close in this case.

Patch applies to trunk rev 18581.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-07-07 00:09  landau         New Issue                                    
05-07-07 00:09  landau         Status                   new => assigned     
05-07-07 00:09  landau         Assigned To               => BusyBox         
05-07-07 00:09  landau         File Added: msh.diff                         
======================================================================




More information about the busybox-cvs mailing list