summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* canonicalize: fix ptrdiff_t overflow bugPaul Eggert2020-12-295-2/+39
| | | | | | | | | | | | | | Problem reported by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2020-December/121182.html * lib/canonicalize-lgpl.c, lib/canonicalize.c: Include intprops.h. (NARROW_ADDRESSES): New constant. * lib/canonicalize-lgpl.c (realpath_stk):m * lib/canonicalize.c (canonicalize_filename_mode_stk): Work even if strlen (END) does not fit in idx_t, or if adding N to it overflows. * modules/canonicalize, modules/canonicalize-lgpl (Depends-on): Add intprops.
* havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS.Bruno Haible2020-12-292-3/+12
| | | | | * m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): In acl_is_expected_elfclass, use 'expr', not 'test'.
* ptsname_r: Fix a compiler warning on Solaris.Bruno Haible2020-12-292-2/+6
| | | | * lib/ptsname_r.c (__ptsname_r): Reduce the scope of variable 'err'.
* gnulib-tool: Fix logic whether to add a dummy.c.Bruno Haible2020-12-292-1/+24
| | | | | | * gnulib-tool (func_remove_if_blocks): New function. (func_modules_add_dummy): Use it to eliminate all conditional statements from the automake snippet.
* faccessat: revert recent EOVERFLOW changePaul Eggert2020-12-289-81/+26
| | | | | | | | | | | | | | | I misunderstood the glibc source code. Deduced from Adhemerval Zanella’s proposed glibc patch in: https://sourceware.org/pipermail/libc-alpha/2020-December/121131.html * doc/posix-functions/faccessat.texi: It is not a problem. * lib/canonicalize-lgpl.c, lib/canonicalize.c, lib/faccessat.c: (FACCESSAT_NEVER_OVERFLOWS): Remove. All uses removed. * lib/faccessat.c: Revert to simpler version now that LSTAT_FOLLOWS_SLASHED_SYMLINK must be false. * m4/faccessat.m4 (gl_FUNC_FACCESSAT_EOVERFLOW): Remove. All uses removed. * modules/canonicalize, modules/canonicalize-lgpl (Files): Remove m4/faccessat.m4.
* canonicalize-lgpl: accommodate picky cppPaul Eggert2020-12-282-1/+6
| | | | | | * lib/canonicalize-lgpl.c: Use "defined FUNC_REALPATH_WORKS" in case preprocessor is picky. Reported by Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2020-December/121130.html
* canonicalize: simplify via scratch_buffer_dupfreePaul Eggert2020-12-287-22/+83
| | | | | | | | | | | * config/srclist.txt: Adjust accordingly. * lib/canonicalize-lgpl.c (realpath_stk): * lib/canonicalize.c (canonicalize_filename_mode_stk): Simplify by using scratch_buffer_dupfree. * lib/malloc/scratch_buffer.h (scratch_buffer_dupfree): New function. * lib/malloc/scratch_buffer_dupfree.c: New file. * modules/scratch_buffer (Files, Depends-on): Add malloc/scratch_buffer_dupfree.c.
* regex: remove glibc21.m4Paul Eggert2020-12-274-38/+10
| | | | | | | It doesn’t seem to be needed any more; at least, I couldn’t reproduce the circa-2013 problem. Perhaps the recent --conditional-dependencies fixes have removed the need for it. * m4/glibc21.m4: Remove. All uses removed.
* gnulib-tool: Make --conditional-dependencies work with --with-tests.Bruno Haible2020-12-272-7/+37
| | | | | | | | Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00236.html>. * gnulib-tool (func_emit_tests_Makefile_am): Handle conditional dependencies like func_emit_lib_Makefile_am.
* execvpe: Make dependency to stdbool explicit.Bruno Haible2020-12-263-0/+6
| | | | | * lib/execvpe.c: Include <stdbool.h>. * modules/execvpe (Depends-on): Add stdbool.
* execlp: Add tests.Bruno Haible2020-12-264-0/+115
| | | | | | * tests/test-execlp-main.c: New file. * tests/test-execlp.sh: New file. * modules/execlp-tests: New file.
* execlp: New module.Bruno Haible2020-12-265-5/+146
| | | | | | | | * lib/execlp.c: New file. * m4/execlp.m4: New file. * modules/execlp: New file. * doc/posix-functions/execlp.texi: Mention more Windows problems and the new module.
* execle: Add tests.Bruno Haible2020-12-264-0/+115
| | | | | | * tests/test-execle-main.c: New file. * tests/test-execle.sh: New file. * modules/execle-tests: New file.
* execle: New module.Bruno Haible2020-12-265-5/+150
| | | | | | | | * lib/execle.c: New file. * m4/execle.m4: New file. * modules/execle: New file. * doc/posix-functions/execle.texi: Mention more Windows problems and the new module.
* execl: Add tests.Bruno Haible2020-12-264-0/+112
| | | | | | * tests/test-execl-main.c: New file. * tests/test-execl.sh: New file. * modules/execl-tests: New file.
* execl: New module.Bruno Haible2020-12-265-5/+149
| | | | | | | | * lib/execl.c: New file. * m4/execl.m4: New file. * modules/execl: New file. * doc/posix-functions/execl.texi: Mention more Windows problems and the new module.
* execv: Add tests.Bruno Haible2020-12-264-0/+115
| | | | | | * tests/test-execv-main.c: New file. * tests/test-execv.sh: New file. * modules/execv-tests: New file.
* execv: New module.Bruno Haible2020-12-265-5/+102
| | | | | | | | * lib/execv.c: New file. * m4/execv.m4: New file. * modules/execv: New file. * doc/posix-functions/execv.texi: Mention more Windows problems and the new module.
* execvp: Add tests.Bruno Haible2020-12-264-0/+118
| | | | | | * tests/test-execvp-main.c: New file. * tests/test-execvp.sh: New file. * modules/execvp-tests: New file.
* execvp: New module.Bruno Haible2020-12-265-5/+99
| | | | | | | | * lib/execvp.c: New file. * m4/execvp.m4: New file. * modules/execvp: New file. * doc/posix-functions/execvp.texi: Mention more Windows problems and the new module.
* execvpe: Add tests.Bruno Haible2020-12-264-0/+120
| | | | | | * tests/test-execvpe-main.c: New file. * tests/test-execvpe.sh: New file. * modules/execvpe-tests: New file.
* execvpe: New module.Bruno Haible2020-12-265-5/+140
| | | | | | | | * lib/execvpe.c: New file. * m4/execvpe.m4: New file. * modules/execvpe: New file. * doc/glibc-functions/execvpe.texi: Mention the Windows problems and the new module.
* execve: Add tests.Bruno Haible2020-12-265-0/+159
| | | | | | | * tests/test-exec-child.c: New file. * tests/test-execve-main.c: New file. * tests/test-execve.sh: New file. * modules/execve-tests: New file.
* execve: New module.Bruno Haible2020-12-265-5/+148
| | | | | | | | * lib/execve.c: New file. * m4/execve.m4: New file. * modules/execve: New file. * doc/posix-functions/execve.texi: Mention more Windows problems and the new module.
* execve, execvpe, execvp, execv, execl, execle, execlp: Prepare modules.Bruno Haible2020-12-265-24/+253
| | | | | | | | | | | | | * lib/unistd.in.h (execl, execle, execlp, execv, execve, execvp, execvpe): Add declarations for the new modules. * m4/unistd_h.m4 (gl_UNISTD_H): Test whether execl, execle, execlp, execv, execve, execvp, execvpe are declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_EXEC*, HAVE_EXECVPE, REPLACE_EXEC*. * modules/unistd (Makefile.am): Substitute GNULIB_EXEC*, HAVE_EXECVPE, REPLACE_EXEC*. * tests/test-unistd-c++.cc: Check the signature of execl, execle, execlp, execv, execve, execvp, execvpe.
* stack: Fix typo in comments.Bruno Haible2020-12-262-2/+7
| | | | * lib/stack.h: Fix typo in comments.
* bitset: Fix conflict with 'free-posix' module.Bruno Haible2020-12-262-0/+6
| | | | * lib/bitset/base.h: Include <stdlib.h>.
* idx: change idx.h comment to LGPLv2.1+Paul Eggert2020-12-252-10/+18
| | | | | | * lib/idx.h: Change license notice to match what should be in glibc. gnulib-tool will change it as appropriate anyway, so this is just to simplify syncing with glibc.
* MODULES.html.sh: Update after 2020-12-19 change.Thien-Thi Nguyen2020-12-262-1/+6
| | | | * MODULES.html.sh (func_all_modules): Do s/free/free-posix/.
* Make it possible to turn off the mkdir override on Windows.Bruno Haible2020-12-256-20/+66
| | | | | | | | | | | * lib/sys_stat.in.h (mkdir): Conditionalize through GNULIB_MKDIR and GNULIB_MDA_MKDIR. Also support GNULIB_POSIXCHECK. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_MKDIR, GNULIB_MDA_MKDIR. * modules/sys_stat (Makefile.am): Substitute GNULIB_MKDIR, GNULIB_MDA_MKDIR. * modules/mkdir (configure.ac): Invoke gl_SYS_STAT_MODULE_INDICATOR. * doc/posix-functions/mkdir.texi: Mention also the 'sys_stat' module.
* Make it possible to turn off each of the Windows oldnames workarounds.Bruno Haible2020-12-2534-246/+456
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/fcntl.in.h (creat, open): Conditionalize each of the Windows oldnames workarounds through a GNULIB_MDA_<func> symbol. * lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise. * lib/search.in.h (lfind, lsearch): Likewise. * lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam): Likewise. * lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise. * lib/string.in.h (memccpy, strdup): Likewise. * lib/sys_stat.in.h (chmod, umask): Likewise. * lib/time.in.h (tzset): Likewise. * lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle, execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek, read, rmdir, swab, unlink, write): Likewise. * lib/utime.in.h (utime): Likewise. * lib/wchar.in.h (wcsdup): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these GNULIB_MDA_<func> symbols. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise. * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise. * modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func> symbols. * modules/math (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/sys_stat (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/utime-h (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise.
* canonicalize, canonicalize-lgpl: remove lintPaul Eggert2020-12-243-8/+38
| | | | | | | | | | | | | | Pacify GCC. Some of these problems were reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2020-12/msg00217.html * lib/canonicalize-lgpl.c, lib/canonicalize.c: Sort shared include directives, for consistency. (IF_LINT): New macro. (suffix_requires_dir_check): Mark with _GL_ATTRIBUTE_PURE. * lib/canonicalize-lgpl.c (GCC_LINT, _GL_ATTRIBUTE_PURE) [_LIBC]: New macros. (realpath_stk): Suppress bogus -Wmaybe-uninitialized warning. * lib/canonicalize.c (canonicalize_filename_mode_stk): Omit unused local. Suppress bogus -Wmaybe-uninitialized warning.
* spawn-pipe: Use posix_spawn by default on native Windows.Bruno Haible2020-12-253-5/+34
| | | | | | * lib/spawn-pipe.c (SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN): New macro. (create_pipe): Use it to decide among the two possible implementations. * modules/spawn-pipe (Depends-on): Add posix_spawnattr_setpgroup.
* unistd-safer: Implement pipe_safer on native Windows.Bruno Haible2020-12-253-6/+9
| | | | | * lib/pipe-safer.c (pipe_safer): Don't test HAVE_PIPE. * modules/unistd-safer (Depends-on): Add pipe-posix.
* execute: Use posix_spawn by default on native Windows.Bruno Haible2020-12-252-3/+24
| | | | | * lib/execute.c (EXECUTE_IMPL_AVOID_POSIX_SPAWN): New macro. (execute): Use it to decide among the two possible implementations.
* canonicalize-lgpl: merge proposed libc changesPaul Eggert2020-12-242-7/+13
| | | | | | | | | | This merges the changes proposed for glibc in: https://sourceware.org/pipermail/libc-alpha/2020-December/121085.html https://sourceware.org/pipermail/libc-alpha/2020-December/121086.html * lib/canonicalize-lgpl.c: Include idx.h and filename.h unconditionally. (idx_t, IDX_MAX, FILE_SYSTEM_PREFIX_LEN, IS_ABSOLUTE_FILE_NAME) (ISSLASH) [_LIBC]: Remove.
* autoupdatePaul Eggert2020-12-243-30/+38
|
* posix_spawn-internal: Implement for native Windows.Bruno Haible2020-12-245-7/+645
| | | | | | | | | | | * lib/spawni.c (grow_inheritable_handles, shrink_inheritable_handles, close_inheritable_handles, memiszero, sigisempty, open_handle, do_open, do_dup2, do_close): New functions. (__spawni): Implement on native Windows. * modules/posix_spawn-internal (Depends-on): Add filename, concat-filename, findprog-in, malloca, windows-spawn. * doc/posix-functions/posix_spawn.texi: Update. * doc/posix-functions/posix_spawnp.texi: Likewise.
* windows-spawn: Export another auxiliary function.Bruno Haible2020-12-243-36/+54
| | | | | | | * lib/windows-spawn.h (convert_CreateProcess_error): New declaration. * lib/windows-spawn.c (convert_CreateProcess_error): New function, extracted from spawnpvech. (spawnpvech): Use it.
* windows-spawn: Export some more auxiliary functions.Bruno Haible2020-12-243-138/+311
| | | | | | | | | | | * lib/windows-spawn.h: Include <stdbool.h>. (struct inheritable_handles): New type. (init_inheritable_handles, compose_handles_block, free_inheritable_handles): New declarations. * lib/windows-spawn.c (init_inheritable_handles, compose_handles_block): New functions, based on spawnvech. (free_inheritable_handles): New function. (spawnpvech): Use them.
* windows-spawn: Export another auxiliary function.Bruno Haible2020-12-243-36/+75
| | | | | | | * lib/windows-spawn.h (compose_envblock): New declaration. * lib/windows-spawn.c (compose_envblock): New function, extracted from spawnpvech. (spawnpvech): Use it.
* windows-spawn: Export an auxiliary function.Bruno Haible2020-12-243-29/+60
| | | | | | | * lib/windows-spawn.h (compose_command): New declaration. * lib/windows-spawn.c (compose_command): New function, extracted from spawnpvech. (spawnpvech): Use it.
* posix_spawn* tests: Add support for native Windows.Bruno Haible2020-12-2412-42/+120
| | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-posix_spawn-open1.c (DATA_FILENAME): Treat native Windows like Cygwin. * tests/test-posix_spawn-dup2-stdin.c (main): Don't assume the signals SIGHUP and SIGPIPE. On native Windows, don't call posix_spawnattr_setsigmask. * tests/test-posix_spawn-dup2-stdout.c (main): Likewise. * tests/test-posix_spawn-fchdir.c (main): Likewise. * tests/test-posix_spawn-chdir.c (test): Likewise. Accept the child output from Cygwin's 'pwd' program. * tests/test-posix_spawn-script.c (main): On native Windows, skip the executable-shell-script part of the test. * tests/test-posix_spawnp-script.c (main): Likewise. * modules/posix_spawn-tests (Depends-on): Add freopen, waitpid. (configure.ac): Don't define the POSIX_SPAWN_PORTED conditional. (Makefile.am): Don't test the POSIX_SPAWN_PORTED conditional. * modules/posix_spawnp-tests (Depends-on): Add waitpid. (configure.ac): Don't define the POSIX_SPAWN_PORTED conditional. (Makefile.am): Don't test the POSIX_SPAWN_PORTED conditional. * modules/posix_spawn_file_actions_addchdir-tests (Makefile.am): Don't test the POSIX_SPAWN_PORTED conditional. * modules/posix_spawn_file_actions_addfchdir-tests (configure.ac): Define the POSIX_SPAWN_PORTED conditional here.
* sh-filename: Add support for native Windows.Bruno Haible2020-12-242-2/+9
| | | | * m4/sh-filename.m4 (gl_SH_FILENAME): Treat native Windows like Cygwin.
* careadlinkat: improve warning line numberPaul Eggert2020-12-242-6/+12
| | | | | | | This propagates an idea first used in canonicalize-lgpl. * lib/careadlinkat.c (GCC_BOGUS_WRETURN_LOCAL_ADDR): New macro. (careadlinkat): Use it.
* * canonicalize-lgpl.c: Space after paren.Paul Eggert2020-12-241-1/+1
|
* linkat: use eloop-thresholdPaul Eggert2020-12-244-20/+19
| | | | | | | | | | * lib/linkat.c: Include eloop-threshold.h. Do not include sys/param.h. (MAXSYMLINKS): Remove. (link_follow, linkat_follow): Use __eloop_threshold instead of MAXSYMLINKS. * m4/linkat.m4 (gl_FUNC_LINKAT): Omit sys/param.h check. * modules/linkat (Depends-on): Add eloop-threshold. Sort.
* canonicalize-lgpl: use eloop-thresholdPaul Eggert2020-12-243-9/+7
| | | | | | * lib/canonicalize-lgpl.c [!_LIBC]: Include eloop-threshold.h. (MAXSYMLINKS, __eloop_threshold): Remove. * modules/canonicalize-lgpl (Depends-on): Add eloop-threshold.
* eloop-threshold: new modulePaul Eggert2020-12-244-0/+110
| | | | | * config/srclist.txt: Add a comment about it. * lib/eloop-threshold.h, modules/eloop-threshold: New files.
* canonicalize: prefer faccessat to statPaul Eggert2020-12-246-25/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A proper faccessat doesn't have the EOVERFLOW problem, and can be more efficient as it needn't gather data from the filesystem to fill in struct stat. So use stat only if faccessat is absent, or when checking for symlink loops in canonicalize.c. * lib/canonicalize-lgpl.c, lib/canonicalize.c: Include fcntl.h, for AT_EACCESS. (FACCESSAT_NEVER_EOVERFLOWS): Default to false. (file_accessible): New function, based on faccessat but with a fallback to stat and with an EOVERFLOW workaround. (dir_check): Use it. (dir_suffix): New static constant. * lib/canonicalize-lgpl.c (FACCESSAT_NEVER_EOVERFLOWS) [_LIBC]: Use __ASSUME_FACCESSAT2 to set FACCESSAT_NEVER_EOVERFLOWS (__faccessat) [!_LIBC]: Define. (realpath_stk): Use dir_suffix now. * lib/canonicalize.c (canonicalize_filename_mode_stk): If logical, don't check each component's existence; just check at the end, as that's enough. * m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE) (gl_CANONICALIZE_LGPL_SEPARATE): Require gl_FUNC_FACCESSAT_EOVERFLOW, gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, and check for faccessat. (gl_CANONICALIZE_LGPL_SEPARATE): Do not check for readlink, as the code does not use HAVE_READLINK. * modules/canonicalize, modules/canonicalize-lgpl (Files): Add m4/faccessat.m4, m4/lstat.m4. (Depends-on): Add fcntl-lh.