Mike Coleman <[EMAIL PROTECTED]> wrote: > In ls.c, errno should be checked after a NULL result from readdir, to see if > there was an error. It may be that in a "normal" posix system, no error can > happen here, but my NAS box (an EMC Celerra) is reporting EACCES here, so a > defensive check, rather than ignoring the error, would be helpful. > > I suppose this applies to all readdir's.
Thanks for the report. IMHO, this is not a bug, and no program should check errno after readdir. Does EMC's opendir succeed for a directory even though one has insufficient permission? POSIX requires that opendir fail with EACCES if ``Search permission is denied for the component of the path prefix of dirname or read permission is denied for dirname.'' If so, I suggest that you file a bug report with EMC. Maybe they've already fixed it in a newer release. The only way I would even consider adding code to handle such a case would be if someone wrote an opendir wrapper (to be used only on such losing systems) that made opendir work properly for the case(s) that EMC's implementation gets wrong. Of course, to go along with the wrapper, there'd have to be an autoconf macro (probably using AC_RUN_IFELSE) to detect whether to use the wrapper. How motivated are you? _______________________________________________ Bug-fileutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-fileutils