httpd: strange behaviour with CGI

Dominik Geyer dominik.geyer at gmx.de
Sun May 18 05:23:03 PDT 2008


Hi all,

I noticed a strange behaviour when using busybox httpd with CGI (interpreter bash).

<snip "Example script">
#!/bin/bash

/bin/true
echo "retval is $?"   # outputs 0, thats ok

/bin/false
echo "retval is $?"   # outputs 0 as well, thats not ok

# but when using bash's internal "false"
false
echo "retval is $?"   # outputs 1, thats right

</snip>

When executing external commands the exit code is always 0.
For now I switched to thttpd which solved this problem, I did no further investigation.

Tested with busybox-1.9.0 and -1.10.1 and bash-3.2.

Can anyone reproduce this?

Regards,
Dominik


More information about the busybox mailing list