[Toybox] one last find thing...

Rob Landley rob at landley.net
Tue Jun 11 13:12:45 PDT 2019


On 6/10/19 4:54 PM, enh via Toybox wrote:
> okay, so with the -true/-false patch i can build AOSP with toybox
> find. but i still get those warnings i mentioned years (?) ago but
> only this morning actually have chance to dig into...
> 
> add something like this to tests/find.test:
> 
> +ln -s does-not-exist dir/dangler
> +ln -s looper dir/looper
> +testing "-L dangling symlink" "find -L dir -name file 2>&1" "dir/file\n" "" ""
> 
> basically, TEST_HOST will warn about looper but not about dangler.
> toybox will warn about both. presumably a new DIRTREE_ flag needed?
> possibly related to the existing issue with ls warnings when it can't
> stat?
> 
> sounds like something i should leave to you...

I added a DIRTREE_STATLESS flag and made ->again = 2 mean we couldn't stat it
(in which case ->st is memset to zero), but now I'm trying to work out how to
test it. If I mkdir sub, cd into that and touch some files, and then chmod -r .
or chmod -x r and "ls" with the debian one I get:

  $ ls
  ls: cannot open directory '.': Permission denied

I'm trying to reproduce the ??? state here, but I've only ever seen it on things
like floppy disks with bad sectors and truncated loopback mount images. Kinda
want one in the test suite. Hmmm...

Rob



More information about the Toybox mailing list