Bug in busybox base applet?

Denis Vlasenko vda at ilport.com.ua
Thu Sep 1 05:34:45 UTC 2005


On Thursday 01 September 2005 00:59, Rob Landley wrote:
> > >>This means "./sort file" gives you an error message "file: applet not
> > >> found" which is confusing.
> > >
> > > Yay, this is dangerous.
> >
> > No. You can have new version busybox, for example as /bin/busybox-new.
> > with more applets or without any apllets.
> >
> > Example two (non busybox host):
> >
> > $ ln -s /bin/bash ./aaa
> > $ ls ./bbb
> > /usr/bin/ls: ./bbb: No such file or directory
> > $ ./aaa bbb
> > bbb: bbb: No such file or directory
> >
> > Absolutely equivalent ;-)
> 
> Not absolutely, no.  I just tried it:
> 
> $ ln -s /bin/bash aaa
> $ ./aaa bbb
> ./aaa: bbb: No such file or directory
> 
> It announced that I tried to run aaa, and it couldn't find bbb.
> 
> $ rm aaa
> $ ln -s ../busybox aaa
> $ ./aaa bbb
> bbb: applet not found
> 
> That implied I tried to run bbb, which I didn't.
> 
> Dangerous, I don't know about, but it's wrong.

Imagine you accidentally have symlink:
ls -> busybox_compiled_without_ls_applet
and you decided to look at a dir named 'rm'
and at your root dir, reversing the sort order:

ls rm -r /

I bet you wouldn't like the result.
--
vda



More information about the busybox mailing list