From 742b1c14418dd3085c2e49aa05300399fb791360 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Sep 2017 02:00:40 -0700 Subject: [PATCH 2/3] glob: don't assume getpwnam_r * lib/glob.c (glob): Port recent patches to platforms lacking getpwnam_r. --- ChangeLog | 4 ++++ lib/glob.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1159480..4314e91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2017-09-02 Paul Eggert + glob: don't assume getpwnam_r + * lib/glob.c (glob): Port recent patches to platforms + lacking getpwnam_r. + scratch_buffer: don’t use private glibc API Suggested by Florian Weimer in: http://lists.gnu.org/archive/html/bug-gnulib/2017-09/msg00004.html diff --git a/lib/glob.c b/lib/glob.c index 596ae6c..e9cf775 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -637,11 +637,11 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int), if (success) { struct passwd *p; -# if defined HAVE_GETPWNAM_R || defined _LIBC - struct passwd pwbuf; int save = errno; struct scratch_buffer pwtmpbuf; scratch_buffer_init (&pwtmpbuf); +# if defined HAVE_GETPWNAM_R || defined _LIBC + struct passwd pwbuf; while (getpwnam_r (name, &pwbuf, pwtmpbuf.data, pwtmpbuf.length, &p) -- 2.7.4