Bug in ampersand handling in 1.13.0's ash

Denys Vlasenko vda.linux at googlemail.com
Tue Nov 25 01:33:09 UTC 2008


On Monday 24 November 2008 23:53, Wilmer van der Gaast wrote:
> After lots of experimenting, I finally found the bug that was
> bothering me for ages: I'm replacing components of a Netgear router
> root filesystem with newer stuff (adding IPv6 support, upgrading to a
> newer BusyBox with more applets, etc.), but whenever I tried to boot
> it with a newer Busybox shell, it doesn't boot properly.
> 
> Now I know what's going on. Some of the closed source apps that I have
> to stick to do things like:
> 
> system("start_some_broken_daemon arg1 arg2&");
> 
> to start something in the background. This ampersand isn't properly
> noticed by ash, unless there's whitespace around it (either before or
> after). As it turns out, the tokenizer sees an end of file and
> completely forget there was an &. More interesting, it will instead
> see the last token twice! See this example:
> 
> /tmp # ./ash -c '/bin/echo 1&'
> 1 1
> /tmp # ./ash -c '/bin/echo 1 &'
> 1
> /tmp # ./ash -c '/bin/echo 1& '
> 1
> 
> My knowledge on how parsers work is very weak, so I decided I'd just
> report this as a bug instead of trying to fix it myself. :-/ I saw the
> bug tracker is currently down, so I'm trying the mailing list instead.
> If there's a more suitable list to report this at, please do tell.
> Meanwhile I'll try 1.12.2, so far I didn't notice 1.13.0 was marked
> unstable...
> 
> Thanks for the awesome piece of software,

Try attached patch
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7.patch
Type: text/x-diff
Size: 398 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20081125/49c07163/attachment.bin 


More information about the busybox mailing list