struct dirtree {
...
int data; // dirfd for directory, linklen for symlink
but:
int dirtree_parentfd(struct dirtree *node)
{
return node->parent ? node->parent->data : AT_FDCWD;
}
this shows up in ls if you "ls -Z some-symlink", because of this:
int fd = openat(dirtree_parentfd(new), new->name,
O_PATH|(O_NOFOLLOW*!!(toys.optflags&FLAG_L)));
which means we end up trying to openat relative to an int that's the
length of the symlink target, not actually an fd.
--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net