in reply to IPC::Open3 and Real PID
When you launch a child process, Perl has no way of knowing what that process does once it starts. Specifically, if you launch a shell, it has no way of knowing what processes (if any) it will later launch.
If you want an certain application to be the child, don't launch a shell instead. This can be achieved using the multiple argument form of open3.
my $pid = open3( local *TO_CHLD, local *FR_CHLD, local *FR_CHLD_ERR, 'prog', $arg1, $arg2 );
It's also less work to use the multiple argument form since it saves from converting $arg1 and $arg2 from text into shell literals.
(I bet you didn't do that, so you probably have a bug and a security vulnerability in your code.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IPC::Open3 and Real PID
by nusoff (Initiate) on Nov 19, 2009 at 17:39 UTC | |
by ikegami (Patriarch) on Nov 19, 2009 at 17:52 UTC | |
by nusoff (Initiate) on Nov 19, 2009 at 18:12 UTC | |
by ikegami (Patriarch) on Nov 19, 2009 at 18:30 UTC | |
by nusoff (Initiate) on Nov 19, 2009 at 22:53 UTC | |
by ikegami (Patriarch) on Nov 19, 2009 at 23:20 UTC | |
by nusoff (Initiate) on Nov 19, 2009 at 20:25 UTC | |
by ikegami (Patriarch) on Nov 19, 2009 at 20:48 UTC | |
|
Re^2: IPC::Open3 and Real PID
by Anonymous Monk on Nov 20, 2009 at 16:41 UTC | |
by ikegami (Patriarch) on Nov 20, 2009 at 18:04 UTC |