[patch] prevent ash executing non-files

Juergen Hennerich juergen at hennerich.eu
Mon Sep 11 12:33:51 UTC 2006


walter harms schrieb:
> my target is to make a test environment like that of bash
> working for ash. therefore i/we need some understanding what
> right. i understand i should discuss that mainly with denis and berhard.
> ok ?
> 
Hi Walter,

the question here is, if it is the business of the shell to check, if it 
is a regular executable. While bash does that and warns if you try to 
execute a directory, it is not necessary, because Linux wont execute a 
directory, but will return an error. So the question is, if it breaks 
something and if yes, where to fix it.

Unfortunately you haven't provided a test case, that shows that 
something breaks.

~ $ if / ; then echo TRUE ; else echo FALSE ; fi
ash: /: Permission denied
FALSE

You can see, there is no problem here.

~ $ if [ -x / ] ; then echo TRUE ; else echo FALSE ; fi
TRUE

This might be surprising, but is also correct. Since / has the 
executable flag set. For "test" a directory is also a FILE. So there is 
no difference between bash and ash.

Juergen

> re,
>  wh
> 
> 
> Rob Landley wrote:
>> On Sunday 10 September 2006 2:47 pm, walter harms wrote:
>>> hi all,
>>> the problem is that while testing ash did not return !0
>>> the size increase is ok when it prevents that this happens.
>> Compared to the enormity that ash currently is most size increases are hard to 
>> notice.  I'm not convinced that's an endorsement.
>>
>> Ask Bernhard or Denis if they feel like applying this.  Right now I'm working 
>> on bbsh and don't want to look at the ash code while doing so to avoid 
>> getting discouraged.  (Looking at ash puts me off the whole topic of shells 
>> in the same way performing an autopsy can kill your appetite.)
>>
>> Rob
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 
> 




More information about the busybox mailing list