A while back Josh Gao pointed out that dirtree_notdotdot() has an
implicit "!this->parent || notdotdot()" that was being checked by the
individual callers, so I'm going through and auditing the users, and
lsattr is just insane.



Here's the start of the output of the ubuntu version doing
"lsattr -la .":

-------------e-- ./bin2

./bin2:
-------------e-- ./bin2/.
-------------e-- ./bin2/fallback-1

./bin2/fallback-1:
-------------e-- ./bin2/fallback-1/.
-------------e-- ./bin2/fallback-1/..

-------------e-- ./bin2/..
-------------e-- ./bin2/toybox

-------------e-- ./hello.c
-------------e-- ./.

It doesn't show the top directory (for no obvious reason), then it shows
"." in th subdirectory (but not sub/.. because that would match the
original directory which it's ONLY showing contents of), then down in
lower sudirs it shows .. because it's not matching that top directory.
Meaning each one is shown more than once, in case you want to trace
symlink topology in an extremely inefficient way?

Oh, hang on. I meant -Ra. (Muscle memory with ls -l.) So what does
lsattr -l do?

$ lsattr --help
lsattr: invalid option -- '-'
Usage: lsattr [-RVadlv] [files...]

It's -there_... but not in the ubuntu 14.04 man page!

Bravo.

$ lsattr -a .
-------------e-- ./bin2
-------------e-- ./hello.c
-------------e-- ./.

Right, _that_ is showing ./. (but not ".") and... Right. Toybox's help
says -l is list long flag names. Ok then.

I don't feel hugely compelled to match the old lsattr's behavior
exactly, but wanted to point it out since there's no standard for this.
the toybox test suite for lsattr still passes.

Rob
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to