This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/9] posix: Allow glob to match dangling symlinks [BZ #866]


On Sat, Sep 9, 2017 at 1:01 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> How about the following idea instead: establish two new flags GLOB_FOLLOW
> and GLOB_NOFOLLOW, where the caller specifies whether symlinks should be
> followed. The default is system-dependent. For glibc the default is
> GLOB_FOLLOW (we can even make GLOB_FOLLOW zero). For FreeBSD the default
> would be GLOB_NOFOLLOW, assuming they like the idea of supporting these
> flags. This maintains backward-compatibility for both kinds of platforms.
> For application code preferring GLOB_NOFOLLOW semantics if available, a
> simple:
>
> #include <glob.h>
> #ifndef GLOB_NOFOLLOW
> # define GLOB_NOFOLLOW 0
> #endif
>
> will do, as long as all calls go glob specify 'GLOB_NOFOLLOW'. We can
> implement this idea first in Gnulib and then propose it for glibc.

This also sounds like a lot of complexity.  With the bug in Make, is
gl_lstat garbage or is it NULL?  We could have the glob implementation
check for NULL.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]