Issue with top corrupting data from post when being used in CGI.

Denys Vlasenko vda.linux at googlemail.com
Wed Sep 26 14:58:09 UTC 2012


On Wed, Sep 26, 2012 at 4:41 PM, James Ronald <james.ronald at gmail.com> wrote:
> There is an issue where top is corrupting stdin (consuming the first
> byte or two) when being used in a CGI script and executed before
> reading POST data being passed via standard in. Of course, executing
> top after the read works just fine.  The issue exists in the recent
> releases (1.20.x, 1.19.4) but did not exist in 1.18.5.
>
> #!/bin/sh
> echo "Content-type: text/plain"
> top -n1 -b

You can do </dev/null to work around it.

> [ "$REQUEST_METHOD" = "POST" ] && read QUERY_STRING
> echo "QUERY_STRING=$QUERY_STRING"
> env
> echo ""


Try this patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5.patch
Type: application/octet-stream
Size: 1936 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20120926/9ee9293e/attachment.obj>


More information about the busybox mailing list