[Toybox] Bug at rm toy.

luckboy at vp.pl luckboy at vp.pl
Sun Sep 14 04:49:09 PDT 2014


W dniu 14.09.2014 o 05:04, Rob Landley pisze:
> On 09/11/14 13:55, luckboy at vp.pl wrote:
>> I found some bug at the rm toy. The rm toy can't remove link to
>> non-existent file with the -f option. Patch fixes this bug:
>> https://github.com/luckboy/toyroot/blob/master/patch/toybox-0.4.9-fixed-rm-bug.patch
> Thanks. I checked in a fix, does this work for you?
>
> http://landley.net/hg/toybox/rev/b748127e092e
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>

I didn't check in this fix but I think that replacement of access() is 
bad idea.
The unlink function can remove directory in some systems for superuser.
It will be better if these check whether the file isn't symbolic link. 
If this file is symbolic
link, these remove this symbolic link (no reference), otherwise these 
invoke the dirtree_read function.

On the other hand, why did you check use the access function at the 
rm_main function?
Is it related to race at the rm toy? If you must use access(), you can 
use my patch or check whether the file is symbolic link after access().

Łukasz Szpakowski.


 1410695349.0


More information about the Toybox mailing list