This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/9] posix: Allow glob to match dangling symlinks [BZ #866]
On 11/09/2017 15:03, Paul Eggert wrote:
> On 09/11/2017 10:56 AM, Zack Weinberg wrote:
>> So here's an alternative, less thorough but perhaps also less costly
>> approach: when GLOB_ALTDIRFUNCS is set, call both gl_stat and gl_lstat
>> on the first name that's going to be returned, even if we have no
>> other reason to do this.
> Something like that would be better, yes. Still not sure it's worth the trouble. We don't know how expensive gl_stat and gl_lstat will be, in general.
Another approach that does not involve adding compat symbols (which adds
a lot of code complexity inside glibc build and do not solve 'make' builds
against new glibc) would to make GLOB_ALTDIRFUNCS to follow the old semantic
of using gl_stat instead of gl_lstat while making glob without GLOB_ALTDIRFUNCS
works as intended. And add another flag, GLOB_ALTDIRFUNCS2, which actually
uses gl_lstat.
It will solve make compat issue even for build against newer glibcs with
the cost of making GLOB_ALTDIRFUNCS with a slight different semantic than
default glob (which given the current situation is a feasible cost).