[Toybox] Fixes to mkdir, chown, env

Felix Janda felix.janda at posteo.de
Thu Sep 5 12:20:10 PDT 2013


Just commenting to selected passages.

Rob Landley wrote:
> On 08/30/2013 09:01:30 AM, Jacek Bukarewicz wrote:
[...]
> 
> >      - I believe that in mkdir.c line 60 the intent was to check if  
> > flag "p" is not set.

I believe Jacek was talking about line 57, my bug from commit 763 you
noticed below. See his patch.

[...]
> Heh, this code also predates teh automatic generation of FLAG_x macros,  
> so
> it was using hardwired constants and it looks like the conversion gave  
> us
> "toys.optflags&~FLAG_p" which is just another way of saying
> toys.optflags&FLAG_m. Now the question is, SHOULD it be saying that?
> FLAG_p allows failure, so I think it should be saying !(flag&FLAG_p) I
> guess? (Rummage, rummage: ah, I didn't write commit 763, which added  
> this.
> Ok, that would explain why I don't remember doing something subtle here.
> Not that I caught it before now, either... :)

Jacek came to the same conclusion. (And of course I agree.)

> And the existing mkdir tests are failing. Why...?
> 
>    VERBOSE=1 scripts/test.sh mkdir
> 
> Becuase we've implemented stat and are no longer using the host's  
> version, and our stat -a is saying 0775 where the host one was saying  
> 775.
> 
> Sigh. And of course there's no spec for stat. Ok, try it on gentoo,  
> ubuntu 8.04, and Red Hat 9 from a decade ago... not padding. We're  
> padding to 4 digits, and should stop that.

Maybe you have already fixed this. It is a matter of changing a 4 to
a 3 in the corresponding format string.

Felix

 1378408810.0


More information about the Toybox mailing list