Attached is the most interesting of the 3 patches. It contains (1) an efficiency improvement and (2) a related bug fix. 1. Moves the check for GLOB_MARK directory status (and the append of `/') into glob_in_dir, where it is more efficient than performing a second pass through the data and sometimes calling stat a second time on each file or directory. All calls to stat are avoided when dirent->d_type is available. No call to realloc of the directory name is ever necessary since room for the slash can be allocated in the first pass. 2. Ignores broken links only when GLOB_ONLYDIR is set. With glibc versions 2.3.3 through 2.3.5, the following in an empty directory would return nothing: ln -s doesnt-exist linkname glob ("*", ...) This fix syncs with the comments in the file, syncs with the POSIX 1003.2 spec, syncs with the BSD behavior, restores the pre-glibc-2.3.3 behavior, and simply makes more sense - why should `rm *' fail to remove broken links? This certainly deviates from historical practice and the behavior most likely expected by a user. There is further discussion of this issue and why this is the correct fix here: <http://lists.gnu.org/archive/html/bug-cvs/2005-06/msg00004.html> and here: <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=126460>.
Created attachment 554 [details] sysdeps/generic/glob.c merge from gnulib (part 3 of 3)
The broken link behavior is correct, makes the code consistent with itself, and brings it in line with other implementations. Whatever BSD does is irrelevant. And due to your inability to keep changes separated I cannot look at the other change. Separate out the other patch and I will look at it.
Please separate your changes and submit the internal cleanup or performance improvement changes separately from any changes to semantics (which are always likely to be controversial). The first part of the change sounds worthwhile, but it should not be conflated with the second change. Please send a patch freshly made against the most current glibc cvs posix/glob.c.
Nothing happened in more than a year.
Why in the world would you want to ship a glob that cannot pick up broken symlinks?
The code is correct as siad many times before.
Yes, changes to semantics are likely to be controversial and I am very sorry I missed my chance to say something BEFORE GLIBC's glob was altered to stop matching "*" to broken symlinks, counter to the POSIX specification. Now that it has been changed, I am very interested in participating in a discussion about changing it back. Could you direct me to the correct list and could we have it out in a larger forum before closing this issue again? Would it be an acceptable compromise if I was to alter and resubmit the attached patch such that glob would only exhibit the POSIX behavior when GLOB_POSIX, GLOB_BROKEN_SYMLINKS, or some other such flag is passed in?
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, azanella/glob-fixes has been created at 80aed7ed5a919358c0bce9bfee97c4d8ac533d5e (commit) - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=80aed7ed5a919358c0bce9bfee97c4d8ac533d5e commit 80aed7ed5a919358c0bce9bfee97c4d8ac533d5e Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Wed Jul 26 16:09:26 2017 -0300 posix: Fix glob with GLOB_NOCHECK returning modified patterns (BZ#10246) Acconding to POSIX glob with GLOB_NOCHECK should return a list consisting of only of the input pattern in case of no match. However GLIBC does not honor in case of '//<something'. This is due internally this is handled and special case and prefix_array (responsable to prepend the directory name) does not know if the input already contains a slash or not since either '/<something>' or '//<something>' will be handle in same way. This patch fix it by using a empty directory name for the latter (since prefix_array already adds a slash as default for each entry). Checked on x86_64-linux-gnu. [BZ #10246] * posix/glob.c (glob): Handle pattern that do not match and start with '/' correctly. * posix/globtest.sh: New tests for NOCHECK. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c50dfe79df1b3a3fe3ba3bc1eba3c354a5d122a6 commit c50dfe79df1b3a3fe3ba3bc1eba3c354a5d122a6 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Wed Jul 26 11:39:49 2017 -0300 posix: Use enum for __glob_pattern_type result This patch replaces the internal integer constant from __glob_pattern_type return with a proper enum. Checked on x86_64-linux-gnu. * posix/glob_internal.h (__glob_pat_types): New enumeration. (__glob_pattern_type): Use __glob_pat_types. * posix/glob_pattern_p.c (__glob_pattern_p): Likewise. * posix/glob.c (glob): Likewise. (glob_in_dir): Likewise. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6e05025f557147feec2772f2e65a2f95baae0eee commit 6e05025f557147feec2772f2e65a2f95baae0eee Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Wed Jun 7 09:33:19 2017 -0300 posix: More check for overflow allocation in glob This patch adds and replace the allocation overflow based using malloc internal functions check_add_wrapv_size_t and __libc_reallocarray. Checked on x86_64-linux-gnu. * posix/glob.c (glob_malloc_incr): New function. (glob_malloc_incr2): Likewise. (glob_realloc_incr): Likewise. (glob): Use glob_{realloc,malloc}_incr{2}. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89e7c2b0d336e51968484d187aa67b250bfbc7a2 commit 89e7c2b0d336e51968484d187aa67b250bfbc7a2 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Tue Jun 6 11:38:29 2017 -0300 posix: Add common function to get home directory This patch adds a common function to get the full home directory from a user. No functional changes expected. Checked on x86_64-linux-gnu. * posix/glob.c (get_home_directory): New function. (glob): Use get_home_directory. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f9db2076c77c55d6b81cf38ea2621e7f71f59c1 commit 5f9db2076c77c55d6b81cf38ea2621e7f71f59c1 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Tue Jun 6 10:57:33 2017 -0300 posix: Use char_array for home_dir in glob This patch uses char_array for home directory discovery. It simplifies the buffer management. Checked on x86_64-linux-gnu. * posix/glob.c (glob): Use char_array for home directory. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=44684cd21876bde13fc3bed741f887ebff173d69 commit 44684cd21876bde13fc3bed741f887ebff173d69 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 19:55:48 2017 -0300 posix: Remove all alloca usage in glob With alloca usage removal from glob this patch wraps it up by removing all the alloca defines and macros usage. Checked on x86_64-linux-gnu. posix/glob.c (glob_in_dir): Remove alloca_used argument. (glob): Remove alloca_used. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3a5cee0bfadd7f3b6b1a273570c25daecba731c9 commit 3a5cee0bfadd7f3b6b1a273570c25daecba731c9 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 19:41:58 2017 -0300 posix: Use dynarray for globname in glob This patch uses dynarray at glob internal glob_in_dir function to manage the various matched patterns. It simplify and removes all the boilerplate buffer managements required. It also removes the glob_use_alloca, since it is not used anymore. Checked on x86_64-linux-gnu. * posix/glob.c (glob_use_alloca): Remove. (glob_in_dir): Use dynarray for globnames. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=923c67dea223b7d2f02cbd8ccf7c588aaf439ba6 commit 923c67dea223b7d2f02cbd8ccf7c588aaf439ba6 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 17:20:01 2017 -0300 posix: Remove alloca usage on glob dirname This patch replaces the alloca/malloc usage for dirname creation by the char_array struct. Checked on x86_64-linux-gnu. * posix/glob.c (glob_in_dir): Remove alloca usage for fullname. * malloc/char_array-skeleton.c (char_array_init_str): Remove unused attribute. (char_array_append_str): Likewise. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=34f6a6e813fbb9d15895008157a4c3fe9f6a19d8 commit 34f6a6e813fbb9d15895008157a4c3fe9f6a19d8 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 15:19:22 2017 -0300 posix: Remove alloca usage for GLOB_BRACE on glob GNU GLOB_BRACE internal implementation constructs a new expression and calls glob recursively. It then requires a possible large temporary buffer place the new pattern. This patch removes the alloca/malloc usage and replaces it with char_array. Checked on x86_64-linux-gnu. * posix/glob.c (glob): Remove alloca usage for onealt. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5389d55d0488f71d7dbcda40c24b78d33fd960ec commit 5389d55d0488f71d7dbcda40c24b78d33fd960ec Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 12:31:21 2017 -0300 posix: User LOGIN_NAME_MAX for all user name in glob This patch limits all user name obtained for GLOB_TILDE to max of LOGIN_NAME_MAX (256 on glibc) and remove all stack/malloc buffer handling boilerplate. Checked on x86_64-linux-gnu. * posix/glob.c (glob): Remove alloca usage on user_name for GLOB_TILDE. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=08530e743120416c3efd23e61920afc16e3dc5d7 commit 08530e743120416c3efd23e61920afc16e3dc5d7 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 12:12:38 2017 -0300 posix: Remove glob GET_LOGIN_NAME_MAX usage Current glob implementation allows non limited user name for home directory construction on GLOB_TILDE case. To accomplish it glob either construct a name on stack if size are small enough (based on current alloca_used) value in heap otherwise. There is no actual login to resize the buffer in case of the resizing the buffer in case of ERANGE, so a static buffer using glibc default LOGIN_NAME_MAX is suffice. Checked on x86_64-linux-gnu. * posix/glob.c (LOGIN_NAME_MAX): Define if not defined. (glob): Use static buffer for user_name on getlogin_r. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a192083bb599321a0d16ca31978d6be3f8f857ff commit a192083bb599321a0d16ca31978d6be3f8f857ff Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Sun Jun 4 16:53:20 2017 -0300 posix: Use char_array for internal glob dirname This is the first patch of the set to remove alloca usage on glob implementation. Internal path to search for file might expand to a non static directory derived from pattern for some difference cases (GLOB_NOESCAPE, GNU GLOB_TILDE) and to allow a non-static dirname path glob uses a lot of boilerplate code to manage the buffer (which is either allocated using alloca or malloc depending both to size requested and the total alloca_used). The patch changes to use the char_array struct with the default size (256 bytes). It simplifies all the allocation code by using char_array one and every internal buffer access is done using char_array provided functions. No functional changes are expected. Checked on x86_64-linux-gnu. * posix/globc.c (glob): Use char_array for dirname. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7f028010854a13cecdbea14954ea97a94428bad7 commit 7f028010854a13cecdbea14954ea97a94428bad7 Author: Florian Weimer <fweimer@redhat.com> Date: Sat Jun 3 20:22:24 2017 -0300 posix: Rewrite to use struct scratch_buffer instead of extend_alloca This patch removes a lot of boilerplate code to manager buffers for getpwnam_r. Checked on x86_64-linux-gnu. [BZ #18023] * posix/glob.c (glob): Use struct scratch_buffer instead of extend_alloca. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=782c40918fa3d3a161e4fe3014ea23c2bd170872 commit 782c40918fa3d3a161e4fe3014ea23c2bd170872 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Fri Jun 2 15:38:04 2017 -0300 posix: Consolidate glob implementation This patch consolidates the glob implementation. The main changes are: * Remove specific defines required for multiple compilation in same unit (GLOB_ONLY_P, NO_GLOB_PATTERN_P and GLOB_COMPAT_BUILD). To allow using the same code to build compat version on Linux, extra units are used instead (oldglob.c). * Both globfree and GNU extension glob_pattern_p are now on their files. This simplifies the creation of compat symbol when required. * Also similar to glob/glob64, a new globfree64 is file is added with an empty implementatio as default. * On Linux all implementation now uses a default one with the exception of alpha (which requires a specific versioning) and s390-32 (which different than other 32 bits with support for v2.1 symbol does not add a compat symbol). * Move i386 olddirent.h header to Linux default directory, since it is the only header with this name and it is shared among different architectures (and used on compat glob symbol). Checked on x86_64-linux-gnu and i686-linux-gnu. * posix/Makefile (routines): Add globfree, globfree64, and glob_pattern_p. * posix/glob.c: Remove GLOB_ONLY_P, GLOB_COMPAT_BUILD, and NO_GLOB_PATTERN_P define usage. (globfree): Move to its own file. (__glob_pattern_type): Likewise. (__glob_pattern_p): Likewise. * posix/glob_internal.h: New file. * posix/glob_pattern_p.c: Likewise. * posix/globfree.c: Likewise. * posix/globfree64.c: Likewise. * sysdeps/gnu/glob64.c: Remove file. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add oldglob. * sysdeps/unix/sysv/linux/alpha/Makefile [$(subdir) = posix] (sysdep_routines): Remove rule. * sysdeps/unix/sysv/linux/alpha/glob.c: Remove file. * sysdeps/unix/sysv/linux/arm/glob64.c: Likewise. * sysdeps/wordsize-64/glob.c: Likewise. * sysdeps/unix/sysv/linux/m68k/glob64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/glob64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/glob.c: Likewise. * sysdeps/wordsize-64/glob64.c: Likewise. * sysdeps/unix/sysv/linux/alpha/glob64.c: New file. * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise. * sysdeps/unix/sysv/linux/glob.c: Likewise. * sysdeps/unix/sysv/linux/glob64.c: Likewise. * sysdeps/unix/sysv/linux/globfree.c: Likewise. * sysdeps/unix/sysv/linux/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/i386/alphasort64.c: include olddirent.h using relative path instead of absolute one. * sysdeps/unix/sysv/linux/i386/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise. * sysdeps/unix/sysv/linux/i386/olddirent.h: Move to ... * sysdeps/unix/sysv/linux/olddirent.h: ... here. * sysdeps/unix/sysv/linux/i386/glob64.c: Move to ... * sysdeps/unix/sysv/linux/oldglob.c: ... here. * sysdeps/unix/sysv/linux/i386/glob64.c: Remove file. * sysdeps/unix/sysv/linux/oldglob.c: New file. * sysdeps/unix/sysv/linux/s390/s390-32/glob64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c: Likewise. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e0906fb5e1e3dd4ce487b8dc76e72035c21b9768 commit e0906fb5e1e3dd4ce487b8dc76e72035c21b9768 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Wed May 24 09:41:15 2017 -0300 posix: Adjust glob tests to libsupport This patch adjust glob tests to use libsupport. It also refactor some tests to move to a more meaningful file name and to gather similar tests in a common file: * move bug-glob3.c tests to tst-glob_basic.c. * move bug-glob2.c tests to tst-glob_memory.c * move common definitions to tst-glob_common.c. Checked on x86_64-linux-gnu. * posix/Makefile (tests): Remove bug-glob2 and bug-glob3. Add tst-glob_basic and tst-glob_memory. * posix/bug-glob3.c: Move to ... * posix/tst-glob_basic.c: ... here. * posix/bug-glob2.c: Move to ... * posix/tst-glob_memory.c: ... here. * posix/globtest.c: Use libsupport. * posix/tst-gnuglob.c: Likewise. * posix/tst-glob_common.c: New file. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c1ba9d146a5fd7522fa45f4309922f693e7470f5 commit c1ba9d146a5fd7522fa45f4309922f693e7470f5 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Fri May 19 12:39:47 2017 -0300 posix: Allow glob to match dangling symlinks [BZ #866] This patch makes glob match dangling symlinks. Compared to other glob implementation (*BSD, bash, musl, and other shells as well), GLIBC seems the be the only one that does not match dangling symlinks. As for comment #5 in BZ #866, POSIX does not have any strict specification for dangling symlinks match and it is reasonable that trying to glob everything in a path should return all types of files (such as for a 'rm *'). Also, comment #7 shows even more example where GLIBC current behavior is unexepected. I avoided adding another GNU specific flag to set this behavior and instead make it the default. Although this change the semanthic from previous implementation, I think adding another compat symbol to be really unecessary as from aforementioned reasons (current behavior not defined in any standard, general idea of different implementation is to list dangling symbols). Checked on x86_64-linux-gnu. * posix/Makefile (tests): Add tst-glob_symlinks and remove tst-glob3. * posix/bug-glob1.c: Remove file. * posix/glob.c (glob): Match dangling symlinks. (link_exists2_p): Remove function. (link_exists_p): Likewise. * posix/tst-glob_symlinks.c: New file. * sysdeps/gnu/glob64.c (__stat): Redefine to __lstat. * sysdeps/unix/sysv/linux/i386/glob64.c (__stat): Likewise. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b80fb4bbc472522aeeafa148061a5a480300fb50 commit b80fb4bbc472522aeeafa148061a5a480300fb50 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Wed May 17 17:01:05 2017 -0300 posix: Sync glob with gnulib [BZ #1062] This patch syncs posix/glob.c implementation with gnulib version 1540f34. The main differences to gnulib code: 1. Commit 44c637c (Properly initialize glob structure with GLOB_BRACE|GLOB_DOOFFS) which fixes BZ# 20707. 2. No inclusion of flexmember.h header and its usage on glob. The code is meant to be rewritten and header is unrequired in next patch in this set. 3. An additional define (GLOB_COMPAT_BUILD) to avoid building size_and_wrapv and gblo_use_alloca twice on some configurations (i368 compat code) due multiple inclusion. The main changes are: - Header organization mostly due gnulib requirements. It leads to some simplification and less conditional includes. - Use of glob_use_alloca with wraps up __libc_use_alloca with saturated math for the total size calculation. - Simplify some size allocation overflow calculation. - Some fixed on non supported glibc systems. - Some comments adjustments. The changes does not alter current glob internal semantic. I also added a missing globfree on posix/globtest.c (it helps silence some valgrind or other memory profilers). [BZ #1062] * posix/glob.c: Sync with gnulib. * posix/globtest.c (main): Add final globfree. * sysdeps/unix/sysv/linux/i386/glob64.c (GLOB_COMPAT_BUILD): Define. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=526d45c58ecbd329603c317bc5b80bfcfd6b08a1 commit 526d45c58ecbd329603c317bc5b80bfcfd6b08a1 Author: Florian Weimer <fweimer@redhat.com> Date: Tue Jun 20 10:31:28 2017 -0300 gconv: Replace norm_add_slashes with __gconv_norm_add_slashes 2017-06-19 Florian Weimer <fweimer@redhat.com> Adhemerval Zanella <adhemerval.zanella@linaro.org> * iconv/Makefile (routine): Add norm_add_slashes. * iconv/norm_add_slashes.c: New file, extracted from iconv/gconv_int.h. * iconv/gconv_int.h (norm_add_slashes): Remove. (__gconv_norm_add_slashes): Declare. * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Use __gconv_norm_add_slashes. * intl/dcigettext.c (_nl_find_msg): Likewise. Simplify !_LIBC case. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e7ffd8ee94da45cb3433c29d36f4fd96bbd6b42a commit e7ffd8ee94da45cb3433c29d36f4fd96bbd6b42a Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Jun 5 21:21:46 2017 -0300 malloc: Add specialized dynarray for C strings This patch adds an specialized dynarray to manage C strings using the dynarray internal implementation. It uses some private fields from dynarray and thus it provided specific files to access and manage the internal string buffer. For instance: struct char_array str; // str == "testing" char_array_init_str (&str, "testing"); // c == 's' char c = char_array_pos (&str, 2); // str = "testing2" char_array_set_str (&str, "testing2"); // str = "testi" char_array_erase (&str, 5); // str = "123testi" char_array_prepend_str (&str, "123"); // len = 8 size_t len = char_array_length (&str); // str = "123testi456" char_array_append_str (&str, "456"); // str = "123testi789" char_array_replace_str_pos (&str, 7, "789", 3); The provided function are not extensive and meant mainly to be use in subsequent glob implementation cleanup. For internal object consistency only the function provided by char_array.c should be used, including internal object manipulation. To check for possible overflows in internal size manipulation a new function, check_add_wrapv_size_t, is added on malloc-internal. It basically return whether the addition of two size_t overflows. Checked on x86_64-linux-gnu. * malloc/Makefile (test-internal): Add tst-char_array. (routines): Add dynarray_overflow_failure and char_array-impl. * malloc/Versions [GLIBC_PRIVATE] (libc): Add __libc_dynarray_overflow_failure, __char_array_set_str_size, __char_array_erase, __char_array_prepend_str_size, and __char_array_replace_str_pos. * malloc/char_array-impl.c: New file. * malloc/char_array-skeleton.c: Likewise. * malloc/char_array.h: Likewise. * malloc/tst-char-array.c: Likewise. * malloc/dynarray_overflow_failure.c: Likewise. * malloc/malloc-internal.h (check_add_overflow_size_t): New function. -----------------------------------------------------------------------
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, master has been updated via 07b4f49db285f39594859c58893e3404b33200dd (commit) via 116f1c64d8d84ecbf269ac70a35657aa057f26c3 (commit) via ffca890177bbf0980b66bc3a6d4d25c481957348 (commit) via 5a79f97554af6f2eb0a654f844b3d1f56937064d (commit) via e00f2425996829632de5abff88bc1797558ce92e (commit) via 5554304f0dddf75dc27cc6250fc53355161fd16a (commit) via 686f2ea18374a541d203cfcc0e1dfba1666f49c2 (commit) via c66c908230169c1bab1f83b071eb585baa214b9f (commit) from 78bfa877b36e8f33c99cbe9a16eb73f5a2adc0c8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=07b4f49db285f39594859c58893e3404b33200dd commit 07b4f49db285f39594859c58893e3404b33200dd Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Tue Sep 5 11:02:24 2017 -0300 posix: Use enum for __glob_pattern_type result This patch replaces the internal integer constant from __glob_pattern_type return with a proper enum. Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. * posix/glob_internal.h (glob_pattern_type_t): New enumeration. (__glob_pattern_type): Use __glob_pat_types. * posix/glob_pattern_p.c (__glob_pattern_p): Likewise. * posix/glob.c (glob): Likewise. (glob_in_dir): Likewise. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=116f1c64d8d84ecbf269ac70a35657aa057f26c3 commit 116f1c64d8d84ecbf269ac70a35657aa057f26c3 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 18:07:03 2017 -0300 posix: Consolidate Linux glob implementation This patch consolidates the glob implementation. The main changes are: * On Linux all implementation now uses the default one at sysdeps/unix/sysv/linux/glob{free}{64}.c with the exception of alpha (which requires specific versioning) and s390-32 (which different than other 32 bits ports it does not add a compat one symbol for 2.1 version). * The default implementation uses XSTAT_IS_XSTAT64 to define whether both glob{free} and glob{free}64 should be different implementations. For archictures that define XSTAT_IS_XSTAT64, glob{free} is an alias to glob{free}64. * Move i386 olddirent.h header to Linux default directory, since it is the only header with this name and it is shared among different architectures (and used on compat glob symbol as well). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. * sysdeps/unix/sysv/linux/arm/glob64.c: Remove file. * sysdeps/unix/sysv/linux/i386/glob64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/glob64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/glob64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/glob.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise. * sysdeps/wordsize-64/glob.c: Likewise. * sysdeps/wordsize-64/glob64.c: Likewise. * sysdeps/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/glob.c: New file. * sysdeps/unix/sysv/linux/glob64.c: Likewise. * sysdeps/unix/sysv/linux/globfree.c: Likewise. * sysdeps/unix/sysv/linux/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/glob64.c: Likewise. * sysdeps/unix/sysv/linux/oldglob.c [SHLIB_COMPAT]: Also adds !GLOB_NO_OLD_VERSION as an extra condition. * sysdeps/unix/sysv/linux/i386/alphasort64.c: Include olddirent.h using relative path instead of absolute one. * sysdeps/unix/sysv/linux/i386/getdents64.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise. * sysdeps/unix/sysv/linux/i386/olddirent.h: Move to ... * sysdeps/unix/sysv/linux//olddirent.h: ... here. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ffca890177bbf0980b66bc3a6d4d25c481957348 commit ffca890177bbf0980b66bc3a6d4d25c481957348 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 17:07:16 2017 -0300 posix: fix glob bugs with long login names Current glob implementation allows unlimited user name for home directory construction on GLOB_TILDE case. To accomplish it glob either construct a name on stack if size are small enough (based on current alloca_used) or in heap otherwise. This patch simplifies storage allocation by using the same scratch buffer for both get_rlogin_r and getpwnam_r. This also syncs with gnulib commit 064df0b (glob: fix bugs with long login names). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. * posix/glob.c (GET_LOGIN_NAME_MAX): Remove. (glob): Use the same scratch buffer for both getlogin_r and getpwnam_r. Don’t require preallocation of the login name. This simplifies storage allocation, and corrects the handling of long login names. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5a79f97554af6f2eb0a654f844b3d1f56937064d commit 5a79f97554af6f2eb0a654f844b3d1f56937064d Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 17:00:03 2017 -0300 posix: Fix getpwnam_r usage (BZ #1062) This patch fixes longstanding misuse of errno after getpwnam_r, which returns an error number rather than setting errno. This is sync with gnulib commit 5db9301. Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] * posix/glob.c (glob): Port recent patches to platforms lacking getpwnam_r. (glob): Fix longstanding misuse of errno after getpwnam_r, which returns an error number rather than setting errno. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e00f2425996829632de5abff88bc1797558ce92e commit e00f2425996829632de5abff88bc1797558ce92e Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 16:44:12 2017 -0300 Sync scratch_buffer with gnulib This patch syncs the scratch_buffer grom gnulib commit 3866ef6 with GLIBC code. Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. * include/scratch_buffer.h (scratch_buffer): Use a C99 align method instead of GCC extension. * malloc/scratch_buffer_grow.c [!_LIBC]: Include libc-config.h. * malloc/scratch_buffer_grow_preserve.c [!_LIBC]: Likewise. * malloc/scratch_buffer_set_array_size.c [!_LIBC]: Likewise. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5554304f0dddf75dc27cc6250fc53355161fd16a commit 5554304f0dddf75dc27cc6250fc53355161fd16a Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 16:22:28 2017 -0300 posix: Allow glob to match dangling symlinks [BZ #866] This patch makes glob match dangling symlinks. Compared to other glob implementation (*BSD, bash, musl, and other shells as well), GLIBC seems the be the only one that does not match dangling symlinks. As for comment #5 in BZ #866, POSIX does not have any strict specification for dangling symlinks match and it is reasonable that trying to glob everything in a path should return all types of files (such as for a 'rm *'). Also, comment #7 shows even more example where GLIBC current behavior is unexepected. I avoided adding another GNU specific flag to set this behavior and instead make it the default. Although this change the semanthic from previous implementation, I think adding another compat symbol to be really unecessary as from aforementioned reasons (current behavior not defined in any standard, general idea of different implementation is to list dangling symbols). This also sync glob with gnulib commit fd1daf4 (glob: match dangling symlinks). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #866] [BZ #1062] * posix/Makefile (tests): Remove bug-glob1 and tst-glob_symlinks. * posix/bug-glob1.c: Remove file. * posix/tst-glob_symlinks.c: New file. * posix/glob.c (__lstat64): New macro. (is_dir): New function. (glob, glob_in_dir): Match symlinks even if they are dangling. (link_stat, link_exists_p): Remove. All uses removed. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=686f2ea18374a541d203cfcc0e1dfba1666f49c2 commit 686f2ea18374a541d203cfcc0e1dfba1666f49c2 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 14:55:25 2017 -0300 posix: accept inode 0 is a valid inode number (BZ #19971) According to this kernel commit 2adc376c55194, d_ino 0 is a regular inode number on Linux (which also matches POSIX, as it does not treat the value as special). This patch makes glob accept is a valid inode number. This is also a sync with gnulib commit c8e57c1. Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] [BZ #19971] * posix/glob.c (struct readdir_result): Remove skip_entry member. (readdir_result_skip_entry, D_INO_TO_RESULT): Remove. All uses removed. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c66c908230169c1bab1f83b071eb585baa214b9f commit c66c908230169c1bab1f83b071eb585baa214b9f Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 14:53:38 2017 -0300 posix: Sync glob with gnulib [BZ #1062] This patch syncs posix/glob.c implementation with gnulib version b5ec983 (glob: simplify symlink detection). The only difference to gnulib code is * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there were not already defined. Gnulib code which uses HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE. Instead the patch check for each definition instead. Also, the patch requires additional globfree and globfree64 files for compatibility version on some architectures. Also the code simplification leads to not macro simplification (not need for NO_GLOB_PATTERN_P anymore). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] * posix/Makefile (routines): Add globfree, globfree64, and glob_pattern_p. * posix/flexmember.h: New file. * posix/glob_internal.h: Likewise. * posix/glob_pattern_p.c: Likewise. * posix/globfree.c: Likewise. * posix/globfree64.c: Likewise. * sysdeps/gnu/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/oldglob.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise. * sysdeps/wordsize-64/globfree.c: Likewise. * sysdeps/wordsize-64/globfree64.c: Likewise. * posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead. [NDEBUG): Remove comments. (GLOB_ONLY_P, _AMIGA, VMS): Remove define. (dirent_type): New type. Use uint_fast8_t not uint8_t, as C99 does not require uint8_t. (DT_UNKNOWN, DT_DIR, DT_LNK): New macros. (struct readdir_result): Use dirent_type. Do not define skip_entry unless it is needed; this saves a byte on platforms lacking d_ino. (readdir_result_type, readdir_result_skip_entry): New functions, replacing ... (readdir_result_might_be_symlink, readdir_result_might_be_dir): these functions, which were removed. This makes the callers easier to read. All callers changed. (D_INO_TO_RESULT): Now empty if there is no d_ino. (size_add_wrapv, glob_use_alloca): New static functions. (glob, glob_in_dir): Check for size_t overflow in several places, and fix some size_t checks that were not quite right. Remove old code using SHELL since Bash no longer uses this. (glob, prefix_array): Separate MS code better. (glob_in_dir): Remove old Amiga and VMS code. (globfree, __glob_pattern_type, __glob_pattern_p): Move to separate files. (glob_in_dir): Do not rely on undefined behavior in accessing struct members beyond their bounds. Use a flexible array member instead (link_stat): Rename from link_exists2_p and return -1/0 instead of 0/1. Caller changed. (glob): Fix memory leaks. * posix/glob64 (globfree64): Move to separate file. * sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define. (globfree64): Remove hidden alias. * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add oldglob. * sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to separate file. * sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove define. Move compat code to separate file. * sysdeps/wordsize-64/glob.c (globfree): Move definitions to separate file. ----------------------------------------------------------------------- Summary of changes: ChangeLog | 133 +++ include/scratch_buffer.h | 3 +- malloc/scratch_buffer_grow.c | 6 +- malloc/scratch_buffer_grow_preserve.c | 6 +- malloc/scratch_buffer_set_array_size.c | 6 +- posix/Makefile | 6 +- posix/bug-glob1.c | 88 -- posix/flexmember.h | 45 + posix/glob.c | 982 +++++++------------- posix/glob64.c | 6 - posix/glob_internal.h | 65 ++ posix/glob_pattern_p.c | 33 + posix/globfree.c | 41 + posix/globfree64.c | 31 + posix/tst-glob_symlinks.c | 135 +++ sysdeps/gnu/glob64.c | 3 - sysdeps/gnu/globfree64.c | 10 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/glob.c | 4 - sysdeps/unix/sysv/linux/alpha/globfree.c | 37 + sysdeps/unix/sysv/linux/arm/glob64.c | 1 - sysdeps/unix/sysv/linux/glob.c | 28 + sysdeps/unix/sysv/linux/glob64.c | 51 + sysdeps/unix/sysv/linux/globfree.c | 30 + sysdeps/unix/sysv/linux/globfree64.c | 36 + sysdeps/unix/sysv/linux/i386/alphasort64.c | 2 +- sysdeps/unix/sysv/linux/i386/getdents64.c | 2 +- sysdeps/unix/sysv/linux/i386/glob64.c | 79 -- sysdeps/unix/sysv/linux/i386/readdir64.c | 2 +- sysdeps/unix/sysv/linux/i386/readdir64_r.c | 2 +- sysdeps/unix/sysv/linux/i386/versionsort64.c | 2 +- sysdeps/unix/sysv/linux/m68k/glob64.c | 1 - sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c | 1 - sysdeps/unix/sysv/linux/{i386 => }/olddirent.h | 0 sysdeps/unix/sysv/linux/oldglob.c | 43 + sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c | 1 - sysdeps/unix/sysv/linux/s390/s390-32/glob64.c | 2 + sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c | 1 - sysdeps/unix/sysv/linux/wordsize-64/glob64.c | 2 - sysdeps/unix/sysv/linux/x86_64/x32/glob.c | 1 - sysdeps/wordsize-64/glob.c | 8 - sysdeps/wordsize-64/glob64.c | 1 - 42 files changed, 1103 insertions(+), 835 deletions(-) delete mode 100644 posix/bug-glob1.c create mode 100644 posix/flexmember.h create mode 100644 posix/glob_internal.h create mode 100644 posix/glob_pattern_p.c create mode 100644 posix/globfree.c create mode 100644 posix/globfree64.c create mode 100644 posix/tst-glob_symlinks.c create mode 100644 sysdeps/gnu/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c delete mode 100644 sysdeps/unix/sysv/linux/arm/glob64.c create mode 100644 sysdeps/unix/sysv/linux/glob.c create mode 100644 sysdeps/unix/sysv/linux/glob64.c create mode 100644 sysdeps/unix/sysv/linux/globfree.c create mode 100644 sysdeps/unix/sysv/linux/globfree64.c delete mode 100644 sysdeps/unix/sysv/linux/i386/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/m68k/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c rename sysdeps/unix/sysv/linux/{i386 => }/olddirent.h (100%) create mode 100644 sysdeps/unix/sysv/linux/oldglob.c delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/glob.c delete mode 100644 sysdeps/wordsize-64/glob.c delete mode 100644 sysdeps/wordsize-64/glob64.c
Fixed by c66c908230, 5554304f0d, 5a79f97554, ffca890177, and 07b4f49db2. GLIBC glob should be in sync with gnulib commit 8ffefc19a6d30f3979a13fa9d37007aeaca40fdf .
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, release/2.26/master has been updated via 305f4f057dace256e99e4321e21a23267187d77f (commit) from c96d7a646b52e8d50e7ca98e0a60af5f24e4b441 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=305f4f057dace256e99e4321e21a23267187d77f commit 305f4f057dace256e99e4321e21a23267187d77f Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Fri Oct 20 19:36:33 2017 +0200 posix: Sync glob with gnulib [BZ #1062] This patch syncs posix/glob.c implementation with gnulib version b5ec983 (glob: simplify symlink detection). The only difference to gnulib code is * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there were not already defined. Gnulib code which uses HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE. Instead the patch check for each definition instead. Also, the patch requires additional globfree and globfree64 files for compatibility version on some architectures. Also the code simplification leads to not macro simplification (not need for NO_GLOB_PATTERN_P anymore). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] * posix/Makefile (routines): Add globfree, globfree64, and glob_pattern_p. * posix/flexmember.h: New file. * posix/glob_internal.h: Likewise. * posix/glob_pattern_p.c: Likewise. * posix/globfree.c: Likewise. * posix/globfree64.c: Likewise. * sysdeps/gnu/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/oldglob.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise. * sysdeps/wordsize-64/globfree.c: Likewise. * sysdeps/wordsize-64/globfree64.c: Likewise. * posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead. [NDEBUG): Remove comments. (GLOB_ONLY_P, _AMIGA, VMS): Remove define. (dirent_type): New type. Use uint_fast8_t not uint8_t, as C99 does not require uint8_t. (DT_UNKNOWN, DT_DIR, DT_LNK): New macros. (struct readdir_result): Use dirent_type. Do not define skip_entry unless it is needed; this saves a byte on platforms lacking d_ino. (readdir_result_type, readdir_result_skip_entry): New functions, replacing ... (readdir_result_might_be_symlink, readdir_result_might_be_dir): these functions, which were removed. This makes the callers easier to read. All callers changed. (D_INO_TO_RESULT): Now empty if there is no d_ino. (size_add_wrapv, glob_use_alloca): New static functions. (glob, glob_in_dir): Check for size_t overflow in several places, and fix some size_t checks that were not quite right. Remove old code using SHELL since Bash no longer uses this. (glob, prefix_array): Separate MS code better. (glob_in_dir): Remove old Amiga and VMS code. (globfree, __glob_pattern_type, __glob_pattern_p): Move to separate files. (glob_in_dir): Do not rely on undefined behavior in accessing struct members beyond their bounds. Use a flexible array member instead (link_stat): Rename from link_exists2_p and return -1/0 instead of 0/1. Caller changed. (glob): Fix memory leaks. * posix/glob64 (globfree64): Move to separate file. * sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define. (globfree64): Remove hidden alias. * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add oldglob. * sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to separate file. * sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove define. Move compat code to separate file. * sysdeps/wordsize-64/glob.c (globfree): Move definitions to separate file. (cherry picked from commit c66c908230169c1bab1f83b071eb585baa214b9f) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 62 ++ NEWS | 1 + posix/Makefile | 2 +- posix/flexmember.h | 45 ++ posix/glob.c | 774 ++++++++++---------- posix/glob64.c | 6 - posix/glob_internal.h | 57 ++ posix/glob_pattern_p.c | 33 + posix/globfree.c | 41 + posix/globfree64.c | 31 + sysdeps/gnu/glob64.c | 3 - sysdeps/gnu/globfree64.c | 10 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/glob.c | 4 - sysdeps/unix/sysv/linux/alpha/globfree.c | 37 + sysdeps/unix/sysv/linux/i386/glob64.c | 39 +- .../unix/sysv/linux/mips/mips64/n64/globfree64.c | 1 + sysdeps/unix/sysv/linux/oldglob.c | 42 ++ sysdeps/unix/sysv/linux/wordsize-64/globfree64.c | 2 + sysdeps/unix/sysv/linux/x86_64/x32/globfree.c | 1 + sysdeps/wordsize-64/glob.c | 2 - sysdeps/wordsize-64/globfree.c | 5 + sysdeps/wordsize-64/globfree64.c | 1 + 23 files changed, 742 insertions(+), 459 deletions(-) create mode 100644 posix/flexmember.h create mode 100644 posix/glob_internal.h create mode 100644 posix/glob_pattern_p.c create mode 100644 posix/globfree.c create mode 100644 posix/globfree64.c create mode 100644 sysdeps/gnu/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/oldglob.c create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/globfree.c create mode 100644 sysdeps/wordsize-64/globfree.c create mode 100644 sysdeps/wordsize-64/globfree64.c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, release/2.25/master has been updated via 4444f6a92b83f7e044705b43b11dcdb0dbe97fe1 (commit) via b2b39e667143a921eeec01517c9c99ea25eaafae (commit) via ee68a4419a7c4473e48b16a55c50689a11f9b725 (commit) via 3b587362bd54a81528b36ff8e13ba9f7c233e995 (commit) via a06cc8caa7f4c0fcfdc7580cbc5c21be63637353 (commit) via 717743bb07471f95bef6ea63d9b12848ad91aaf6 (commit) via ea54198514e1a4f4abd8727acac0890bc95b4bdc (commit) via 2b54f16a8a237a1f3e6f8b974cafda09ed75d292 (commit) from 7bd7ddfab138f67a1d8c10d4d70f16240a1c6796 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4444f6a92b83f7e044705b43b11dcdb0dbe97fe1 commit 4444f6a92b83f7e044705b43b11dcdb0dbe97fe1 Author: Aurelien Jarno <aurelien@aurel32.net> Date: Fri Dec 1 21:53:51 2017 +0100 Update NEWS to add CVE-2017-15804 entry (cherry picked from commit 15e84c63c05e0652047ba5e738c54d79d62ba74b) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b2b39e667143a921eeec01517c9c99ea25eaafae commit b2b39e667143a921eeec01517c9c99ea25eaafae Author: Florian Weimer <fweimer@redhat.com> Date: Thu Nov 2 11:06:45 2017 +0100 posix/tst-glob-tilde.c: Add test for bug 22332 (cherry picked from commit 2fac6a6cd50c22ac28c97d0864306594807ade3e) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ee68a4419a7c4473e48b16a55c50689a11f9b725 commit ee68a4419a7c4473e48b16a55c50689a11f9b725 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Sun Oct 22 10:00:57 2017 +0200 glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332] (cherry picked from commit a159b53fa059947cc2548e3b0d5bdcf7b9630ba8) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3b587362bd54a81528b36ff8e13ba9f7c233e995 commit 3b587362bd54a81528b36ff8e13ba9f7c233e995 Author: Florian Weimer <fweimer@redhat.com> Date: Sun Oct 22 09:29:52 2017 +0200 Update NEWS and ChangeLog for CVE-2017-15671 (cherry picked from commit 914c9994d27b80bc3b71c483e801a4f04e269ba6) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a06cc8caa7f4c0fcfdc7580cbc5c21be63637353 commit a06cc8caa7f4c0fcfdc7580cbc5c21be63637353 Author: Florian Weimer <fweimer@redhat.com> Date: Sat Oct 21 18:03:30 2017 +0200 glob: Add new test tst-glob-tilde The new test checks for memory leaks (see bug 22325) and attempts to trigger the buffer overflow in bug 22320. (cherry picked from commit e80fc1fc98bf614eb01cf8325503df3a1451a99c) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=717743bb07471f95bef6ea63d9b12848ad91aaf6 commit 717743bb07471f95bef6ea63d9b12848ad91aaf6 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Fri Oct 20 18:41:14 2017 +0200 CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320] (cherry picked from commit c369d66e5426a30e4725b100d5cd28e372754f90) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ea54198514e1a4f4abd8727acac0890bc95b4bdc commit ea54198514e1a4f4abd8727acac0890bc95b4bdc Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 14:53:38 2017 -0300 posix: Sync glob with gnulib [BZ #1062] This patch syncs posix/glob.c implementation with gnulib version b5ec983 (glob: simplify symlink detection). The only difference to gnulib code is * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there were not already defined. Gnulib code which uses HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE. Instead the patch check for each definition instead. Also, the patch requires additional globfree and globfree64 files for compatibility version on some architectures. Also the code simplification leads to not macro simplification (not need for NO_GLOB_PATTERN_P anymore). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] * posix/Makefile (routines): Add globfree, globfree64, and glob_pattern_p. * posix/flexmember.h: New file. * posix/glob_internal.h: Likewise. * posix/glob_pattern_p.c: Likewise. * posix/globfree.c: Likewise. * posix/globfree64.c: Likewise. * sysdeps/gnu/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/oldglob.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise. * sysdeps/wordsize-64/globfree.c: Likewise. * sysdeps/wordsize-64/globfree64.c: Likewise. * posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead. [NDEBUG): Remove comments. (GLOB_ONLY_P, _AMIGA, VMS): Remove define. (dirent_type): New type. Use uint_fast8_t not uint8_t, as C99 does not require uint8_t. (DT_UNKNOWN, DT_DIR, DT_LNK): New macros. (struct readdir_result): Use dirent_type. Do not define skip_entry unless it is needed; this saves a byte on platforms lacking d_ino. (readdir_result_type, readdir_result_skip_entry): New functions, replacing ... (readdir_result_might_be_symlink, readdir_result_might_be_dir): these functions, which were removed. This makes the callers easier to read. All callers changed. (D_INO_TO_RESULT): Now empty if there is no d_ino. (size_add_wrapv, glob_use_alloca): New static functions. (glob, glob_in_dir): Check for size_t overflow in several places, and fix some size_t checks that were not quite right. Remove old code using SHELL since Bash no longer uses this. (glob, prefix_array): Separate MS code better. (glob_in_dir): Remove old Amiga and VMS code. (globfree, __glob_pattern_type, __glob_pattern_p): Move to separate files. (glob_in_dir): Do not rely on undefined behavior in accessing struct members beyond their bounds. Use a flexible array member instead (link_stat): Rename from link_exists2_p and return -1/0 instead of 0/1. Caller changed. (glob): Fix memory leaks. * posix/glob64 (globfree64): Move to separate file. * sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define. (globfree64): Remove hidden alias. * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add oldglob. * sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to separate file. * sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove define. Move compat code to separate file. * sysdeps/wordsize-64/glob.c (globfree): Move definitions to separate file. (cherry picked from commit c66c908230169c1bab1f83b071eb585baa214b9f) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b54f16a8a237a1f3e6f8b974cafda09ed75d292 commit 2b54f16a8a237a1f3e6f8b974cafda09ed75d292 Author: H.J. Lu <hjl.tools@gmail.com> Date: Sun Aug 20 10:46:47 2017 -0700 i386: Hide __old_glob64 [BZ #18822] Hide internal __old_glob64 function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add libc_hidden_proto and libc_hidden_def. (cherry picked from commit 2585d7b839559e665d5723734862fbe62264b25d) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 94 +++ NEWS | 16 + posix/Makefile | 14 +- posix/flexmember.h | 45 ++ posix/glob.c | 780 ++++++++++---------- posix/glob64.c | 6 - posix/glob_internal.h | 57 ++ posix/glob_pattern_p.c | 33 + posix/globfree.c | 41 + posix/globfree64.c | 31 + posix/tst-glob-tilde.c | 143 ++++ sysdeps/gnu/glob64.c | 3 - sysdeps/gnu/globfree64.c | 10 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/glob.c | 4 - sysdeps/unix/sysv/linux/alpha/globfree.c | 37 + sysdeps/unix/sysv/linux/i386/glob64.c | 36 +- .../unix/sysv/linux/mips/mips64/n64/globfree64.c | 1 + sysdeps/unix/sysv/linux/oldglob.c | 42 ++ sysdeps/unix/sysv/linux/wordsize-64/globfree64.c | 2 + sysdeps/unix/sysv/linux/x86_64/x32/globfree.c | 1 + sysdeps/wordsize-64/glob.c | 2 - sysdeps/wordsize-64/globfree.c | 5 + sysdeps/wordsize-64/globfree64.c | 1 + 24 files changed, 945 insertions(+), 461 deletions(-) create mode 100644 posix/flexmember.h create mode 100644 posix/glob_internal.h create mode 100644 posix/glob_pattern_p.c create mode 100644 posix/globfree.c create mode 100644 posix/globfree64.c create mode 100644 posix/tst-glob-tilde.c create mode 100644 sysdeps/gnu/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/oldglob.c create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/globfree.c create mode 100644 sysdeps/wordsize-64/globfree.c create mode 100644 sysdeps/wordsize-64/globfree64.c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, release/2.24/master has been updated via d81254d2efcb839fd11df2960df5bba579193808 (commit) via bddc5728810859952a2acaec6302308361e828cc (commit) via 94825c8924b80518214ad9e3ca1f6589f209592c (commit) via 1e53b88296dc95d325d6073910a33dca851b6bc4 (commit) via 5ff2eb52b236ca3d77f92272e8711b3c2b98140b (commit) via 1f523e3c6efd673bdd05cbec85ff6ba178ba6e08 (commit) via 832e2ec56701f85b892b782b8b749bc5a33899fb (commit) via 89bf8ef2dba93e19385bf922fdcee87a97db768f (commit) from bea3f92405f705684275bffee954cafe84ffb09d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d81254d2efcb839fd11df2960df5bba579193808 commit d81254d2efcb839fd11df2960df5bba579193808 Author: Aurelien Jarno <aurelien@aurel32.net> Date: Fri Dec 1 21:53:51 2017 +0100 Update NEWS to add CVE-2017-15804 entry (cherry picked from commit 15e84c63c05e0652047ba5e738c54d79d62ba74b) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bddc5728810859952a2acaec6302308361e828cc commit bddc5728810859952a2acaec6302308361e828cc Author: Florian Weimer <fweimer@redhat.com> Date: Thu Nov 2 11:06:45 2017 +0100 posix/tst-glob-tilde.c: Add test for bug 22332 (cherry picked from commit 2fac6a6cd50c22ac28c97d0864306594807ade3e) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=94825c8924b80518214ad9e3ca1f6589f209592c commit 94825c8924b80518214ad9e3ca1f6589f209592c Author: Paul Eggert <eggert@cs.ucla.edu> Date: Sun Oct 22 10:00:57 2017 +0200 glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332] (cherry picked from commit a159b53fa059947cc2548e3b0d5bdcf7b9630ba8) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1e53b88296dc95d325d6073910a33dca851b6bc4 commit 1e53b88296dc95d325d6073910a33dca851b6bc4 Author: Florian Weimer <fweimer@redhat.com> Date: Sun Oct 22 09:29:52 2017 +0200 Update NEWS and ChangeLog for CVE-2017-15671 (cherry picked from commit 914c9994d27b80bc3b71c483e801a4f04e269ba6) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5ff2eb52b236ca3d77f92272e8711b3c2b98140b commit 5ff2eb52b236ca3d77f92272e8711b3c2b98140b Author: Florian Weimer <fweimer@redhat.com> Date: Sat Oct 21 18:03:30 2017 +0200 glob: Add new test tst-glob-tilde The new test checks for memory leaks (see bug 22325) and attempts to trigger the buffer overflow in bug 22320. (cherry picked from commit e80fc1fc98bf614eb01cf8325503df3a1451a99c) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1f523e3c6efd673bdd05cbec85ff6ba178ba6e08 commit 1f523e3c6efd673bdd05cbec85ff6ba178ba6e08 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Fri Oct 20 18:41:14 2017 +0200 CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320] (cherry picked from commit c369d66e5426a30e4725b100d5cd28e372754f90) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=832e2ec56701f85b892b782b8b749bc5a33899fb commit 832e2ec56701f85b892b782b8b749bc5a33899fb Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 14:53:38 2017 -0300 posix: Sync glob with gnulib [BZ #1062] This patch syncs posix/glob.c implementation with gnulib version b5ec983 (glob: simplify symlink detection). The only difference to gnulib code is * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there were not already defined. Gnulib code which uses HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE. Instead the patch check for each definition instead. Also, the patch requires additional globfree and globfree64 files for compatibility version on some architectures. Also the code simplification leads to not macro simplification (not need for NO_GLOB_PATTERN_P anymore). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] * posix/Makefile (routines): Add globfree, globfree64, and glob_pattern_p. * posix/flexmember.h: New file. * posix/glob_internal.h: Likewise. * posix/glob_pattern_p.c: Likewise. * posix/globfree.c: Likewise. * posix/globfree64.c: Likewise. * sysdeps/gnu/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/oldglob.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise. * sysdeps/wordsize-64/globfree.c: Likewise. * sysdeps/wordsize-64/globfree64.c: Likewise. * posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead. [NDEBUG): Remove comments. (GLOB_ONLY_P, _AMIGA, VMS): Remove define. (dirent_type): New type. Use uint_fast8_t not uint8_t, as C99 does not require uint8_t. (DT_UNKNOWN, DT_DIR, DT_LNK): New macros. (struct readdir_result): Use dirent_type. Do not define skip_entry unless it is needed; this saves a byte on platforms lacking d_ino. (readdir_result_type, readdir_result_skip_entry): New functions, replacing ... (readdir_result_might_be_symlink, readdir_result_might_be_dir): these functions, which were removed. This makes the callers easier to read. All callers changed. (D_INO_TO_RESULT): Now empty if there is no d_ino. (size_add_wrapv, glob_use_alloca): New static functions. (glob, glob_in_dir): Check for size_t overflow in several places, and fix some size_t checks that were not quite right. Remove old code using SHELL since Bash no longer uses this. (glob, prefix_array): Separate MS code better. (glob_in_dir): Remove old Amiga and VMS code. (globfree, __glob_pattern_type, __glob_pattern_p): Move to separate files. (glob_in_dir): Do not rely on undefined behavior in accessing struct members beyond their bounds. Use a flexible array member instead (link_stat): Rename from link_exists2_p and return -1/0 instead of 0/1. Caller changed. (glob): Fix memory leaks. * posix/glob64 (globfree64): Move to separate file. * sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define. (globfree64): Remove hidden alias. * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add oldglob. * sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to separate file. * sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove define. Move compat code to separate file. * sysdeps/wordsize-64/glob.c (globfree): Move definitions to separate file. (cherry picked from commit c66c908230169c1bab1f83b071eb585baa214b9f) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89bf8ef2dba93e19385bf922fdcee87a97db768f commit 89bf8ef2dba93e19385bf922fdcee87a97db768f Author: H.J. Lu <hjl.tools@gmail.com> Date: Sun Aug 20 10:46:47 2017 -0700 i386: Hide __old_glob64 [BZ #18822] Hide internal __old_glob64 function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add libc_hidden_proto and libc_hidden_def. (cherry picked from commit 2585d7b839559e665d5723734862fbe62264b25d) (cherry picked from commit 2b54f16a8a237a1f3e6f8b974cafda09ed75d292) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 94 +++ NEWS | 13 + posix/Makefile | 13 +- posix/flexmember.h | 45 ++ posix/glob.c | 780 ++++++++++---------- posix/glob64.c | 6 - posix/glob_internal.h | 57 ++ posix/glob_pattern_p.c | 33 + posix/globfree.c | 41 + posix/globfree64.c | 31 + posix/tst-glob-tilde.c | 143 ++++ sysdeps/gnu/glob64.c | 3 - sysdeps/gnu/globfree64.c | 10 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/glob.c | 4 - sysdeps/unix/sysv/linux/alpha/globfree.c | 37 + sysdeps/unix/sysv/linux/i386/glob64.c | 36 +- .../unix/sysv/linux/mips/mips64/n64/globfree64.c | 1 + sysdeps/unix/sysv/linux/oldglob.c | 42 ++ sysdeps/unix/sysv/linux/wordsize-64/globfree64.c | 2 + sysdeps/unix/sysv/linux/x86_64/x32/globfree.c | 1 + sysdeps/wordsize-64/glob.c | 2 - sysdeps/wordsize-64/globfree.c | 5 + sysdeps/wordsize-64/globfree64.c | 1 + 24 files changed, 941 insertions(+), 461 deletions(-) create mode 100644 posix/flexmember.h create mode 100644 posix/glob_internal.h create mode 100644 posix/glob_pattern_p.c create mode 100644 posix/globfree.c create mode 100644 posix/globfree64.c create mode 100644 posix/tst-glob-tilde.c create mode 100644 sysdeps/gnu/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/oldglob.c create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/globfree.c create mode 100644 sysdeps/wordsize-64/globfree.c create mode 100644 sysdeps/wordsize-64/globfree64.c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, release/2.22/master has been updated via 49a0c33ead1b1eea5b414e9e2574a4fd96291203 (commit) via d8b6b33f1d08642961aff14825c1fa6a0276ad49 (commit) via 42a2c81226c4fd4037aa90cbebf26bafc07b7072 (commit) via 3790ec0ca5b8cf5d317cd8d43f132ef88c52e824 (commit) from 017d97cd2ec0f626f8afb8c73ea3d612d8e844c3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=49a0c33ead1b1eea5b414e9e2574a4fd96291203 commit 49a0c33ead1b1eea5b414e9e2574a4fd96291203 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Sun Oct 22 10:00:57 2017 +0200 glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332] (cherry picked from commit a159b53fa059947cc2548e3b0d5bdcf7b9630ba8) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d8b6b33f1d08642961aff14825c1fa6a0276ad49 commit d8b6b33f1d08642961aff14825c1fa6a0276ad49 Author: Florian Weimer <fweimer@redhat.com> Date: Sat Oct 21 18:03:30 2017 +0200 glob: Add new test tst-glob-tilde The new test checks for memory leaks (see bug 22325) and attempts to trigger the buffer overflow in bug 22320. (cherry picked from commit e80fc1fc98bf614eb01cf8325503df3a1451a99c) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=42a2c81226c4fd4037aa90cbebf26bafc07b7072 commit 42a2c81226c4fd4037aa90cbebf26bafc07b7072 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Fri Oct 20 18:41:14 2017 +0200 CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320] (cherry picked from commit c369d66e5426a30e4725b100d5cd28e372754f90) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3790ec0ca5b8cf5d317cd8d43f132ef88c52e824 commit 3790ec0ca5b8cf5d317cd8d43f132ef88c52e824 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Sep 4 14:53:38 2017 -0300 posix: Sync glob with gnulib [BZ #1062] This patch syncs posix/glob.c implementation with gnulib version b5ec983 (glob: simplify symlink detection). The only difference to gnulib code is * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there were not already defined. Gnulib code which uses HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE. Instead the patch check for each definition instead. Also, the patch requires additional globfree and globfree64 files for compatibility version on some architectures. Also the code simplification leads to not macro simplification (not need for NO_GLOB_PATTERN_P anymore). Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] * posix/Makefile (routines): Add globfree, globfree64, and glob_pattern_p. * posix/flexmember.h: New file. * posix/glob_internal.h: Likewise. * posix/glob_pattern_p.c: Likewise. * posix/globfree.c: Likewise. * posix/globfree64.c: Likewise. * sysdeps/gnu/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/oldglob.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise. * sysdeps/wordsize-64/globfree.c: Likewise. * sysdeps/wordsize-64/globfree64.c: Likewise. * posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead. [NDEBUG): Remove comments. (GLOB_ONLY_P, _AMIGA, VMS): Remove define. (dirent_type): New type. Use uint_fast8_t not uint8_t, as C99 does not require uint8_t. (DT_UNKNOWN, DT_DIR, DT_LNK): New macros. (struct readdir_result): Use dirent_type. Do not define skip_entry unless it is needed; this saves a byte on platforms lacking d_ino. (readdir_result_type, readdir_result_skip_entry): New functions, replacing ... (readdir_result_might_be_symlink, readdir_result_might_be_dir): these functions, which were removed. This makes the callers easier to read. All callers changed. (D_INO_TO_RESULT): Now empty if there is no d_ino. (size_add_wrapv, glob_use_alloca): New static functions. (glob, glob_in_dir): Check for size_t overflow in several places, and fix some size_t checks that were not quite right. Remove old code using SHELL since Bash no longer uses this. (glob, prefix_array): Separate MS code better. (glob_in_dir): Remove old Amiga and VMS code. (globfree, __glob_pattern_type, __glob_pattern_p): Move to separate files. (glob_in_dir): Do not rely on undefined behavior in accessing struct members beyond their bounds. Use a flexible array member instead (link_stat): Rename from link_exists2_p and return -1/0 instead of 0/1. Caller changed. (glob): Fix memory leaks. * posix/glob64 (globfree64): Move to separate file. * sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define. (globfree64): Remove hidden alias. * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add oldglob. * sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to separate file. * sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove define. Move compat code to separate file. * sysdeps/wordsize-64/glob.c (globfree): Move definitions to separate file. (cherry picked from commit c66c908230169c1bab1f83b071eb585baa214b9f) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 80 ++ NEWS | 9 + posix/Makefile | 14 +- posix/flexmember.h | 45 ++ posix/glob.c | 785 ++++++++++---------- posix/glob64.c | 6 - posix/glob_internal.h | 57 ++ posix/glob_pattern_p.c | 33 + posix/globfree.c | 41 + posix/globfree64.c | 31 + posix/tst-glob-tilde.c | 136 ++++ sysdeps/gnu/glob64.c | 3 - sysdeps/gnu/globfree64.c | 10 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/glob.c | 4 - sysdeps/unix/sysv/linux/alpha/globfree.c | 37 + sysdeps/unix/sysv/linux/i386/glob64.c | 36 +- .../unix/sysv/linux/mips/mips64/n64/globfree64.c | 1 + sysdeps/unix/sysv/linux/oldglob.c | 42 + sysdeps/unix/sysv/linux/wordsize-64/globfree64.c | 2 + sysdeps/unix/sysv/linux/x86_64/x32/globfree.c | 1 + sysdeps/wordsize-64/glob.c | 2 - sysdeps/wordsize-64/globfree.c | 5 + sysdeps/wordsize-64/globfree64.c | 1 + 24 files changed, 917 insertions(+), 466 deletions(-) create mode 100644 posix/flexmember.h create mode 100644 posix/glob_internal.h create mode 100644 posix/glob_pattern_p.c create mode 100644 posix/globfree.c create mode 100644 posix/globfree64.c create mode 100644 posix/tst-glob-tilde.c create mode 100644 sysdeps/gnu/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/oldglob.c create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/globfree64.c create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/globfree.c create mode 100644 sysdeps/wordsize-64/globfree.c create mode 100644 sysdeps/wordsize-64/globfree64.c