[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EMC Celerra: opendir bug? [Re: in ls.c, should check errno after readdir

From: Jim Meyering
Subject: EMC Celerra: opendir bug? [Re: in ls.c, should check errno after readdir
Date: Sun, 25 Aug 2002 20:55:34 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Mike Coleman <address@hidden> 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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]