[Setup-tool-hackers] Compatibility considerations.




Backend hackers: if you are going to call a program by any means different
from xst_run, please run /bin/sh explicitly.

As an exmple, I had this code to get ifconfig's output:

$tool_ifconfig = &xst_locate_tool ("ifconfig");
open IFCONFIG, "$tool_ifconfig 2>&1 |";

Now, 2>&1 is a shell directive, which may not work with the user's, or
root user's shell. So, I have to call /bin/sh explicitly:

$tool_ifconfig = &xst_locate_tool ("ifconfig");
open IFCONFIG, "/bin/sh -c \"$tool_ifconfig 2>&1\" |";

Same for any system() calls, although you should be using xst_run for that
case, in the first place. I'm modifying xst_run to call /bin/sh right now.

Greetings,
Arturo








_______________________________________________
setup-tool-hackers maillist  -  setup-tool-hackers@helixcode.com
http://lists.helixcode.com/mailman/listinfo/setup-tool-hackers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]