| Anonymous | Login | Signup for a new account | 11-10-2008 11:04 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0000973 | [BusyBox] Other | minor | always | 07-27-06 06:12 | 02-14-08 09:14 | ||||
| Reporter | Keith Young | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | 1.01 | ||||||
| Summary | 0000973: msh grave substitution does not work if stdin/stdout are not already open | ||||||||
| Description |
I tried using busybox sh as the script processor /sbin/hotplug (Linux 2.6.16) Substitutions such as: d=`date` return empty. |
||||||||
| Additional Information |
Using strace I could see what was happening. The hotplug executable is invoked from the kernel (somehow) and has no stdin/stdout attached. Consequently when the pipe is created for communication with the sub-shell it has fd's [0,1]. After the vfork() (see msh.c, grave()) the child process does: dup2(pf[1], 1); closepipe(pf); Fd 1 gets successfully duplicated to 1 and then closed. Hence no more output is possible on stdout from the sub-shell. A fix that works for me is: if (pf[1] != 1) { dup2(pf[1], 1); closepipe(pf); } else close(pf[0]); |
||||||||
| Attached Files | |||||||||
|
|
|||||||||
Notes |
|
|
(0004744) vda 02-14-08 09:14 |
Fixed sometime ago in svn: xmove_fd(pf[1], 1); if (pf[0] != 1) close(pf[0]); |
| Copyright © 2000 - 2006 Mantis Group |