Hi,
When ls -l is run on a directory which has no execute permissions, ls
fails but the return value is 0.
bash-4.2$ ls -ld /tmp/foo/
drw-r-xr-x 3 sac wheel 512 Mar 6 18:11 /tmp/foo/
bash-4.2$ ls -l /tmp/foo/
bash-4.2$ echo $?
0
bash-4.2$
I see in the traverse function:
chp = fts_children(ftsp, ch_options);
saved_errno = errno;
display(p, chp);
/*
* On fts_children() returning error do recurse to see
* the error.
*/
if (!f_recursive && !(chp == NULL && saved_errno != 0))
(void)fts_set(ftsp, p, FTS_SKIP);
break;
On the failure of fts_children function shouldn't we be setting rval =
1 and break?
Since we do not anyway want to continue on a directory without execute
permission as we do not get the stat information to long list the
contents?
Let me know if the understanding is right, I will send a patch.
-sac