| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* lib/canonicalize-lgpl.c, lib/canonicalize.c (NARROW_ADDRESSES):
Remove, and remove all uses, as the optimization is arguably not
worth the extra complexity. Suggested by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121203.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This also has some minor cleanups.
* lib/canonicalize-lgpl.c, lib/canonicalize.c: No need to include
stddef.h, since the code no longer refers directly to ptrdiff_t.
* lib/canonicalize-lgpl.c (realpath_stk):
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Treat size overflow like other out-of-memory.
* lib/canonicalize.c: No need to include stdlib.h, since
the code no longer refers to stdlib.h functions (other
than those that canonicalize.h must declare).
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Do not bother terminating the string result on error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Adhemerval Zanella in:
https://lists.gnu.org/r/bug-gnulib/2020-12/msg00155.html
* lib/canonicalize-lgpl.c, lib/canonicalize.c:
(suffix_requires_dir_check, dir_check): New functions.
(GCC_BOGUS_WRETURN_LOCAL_ADDR): New macro, to put the diagnostic
closer to the related GCC diagnostics.
* lib/canonicalize-lgpl.c (realpath_stk):
* lib/canonicalize.c (canonicalize_file_mode_stk):
Use them to fix a bug with .../symlink-to-regular-file/ etc.
* lib/canonicalize-lgpl.c (__stat) [!_LIBC]: New macro.
(realpath_stk): New function,
with the contents of the old __realpath and a new scratch buffer arg.
This is needed to pacify GCC 10.1, as canonicalize.c is already doing.
(__realpath): Use it.
* tests/test-canonicalize-lgpl.c, tests/test-canonicalize.c:
Add test cases for the bugs.
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Omit second readlink when (can_exist != CAN_MISSING
&& startlen != 0 && !logical). Simplify.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove canonicalize.c’s arbitrary 8192-byte limit on platforms
like GNU Hurd that do not define the PATH_MAX macro, and similarly
for canonicalize-lgpl.c’s arbitrary 1024-byte limit. Do this by
using scratch buffers. Lessen the number of differences between
the two source files, to simplify this and future maintenance.
* lib/canonicalize-lgpl.c (__realpath):
* lib/canonicalize.c (canonicalize_filename_mode_stk):
Use scratch buffers instead of malloc and malloca. This avoids
the need for alloca, and avoids the need for malloc in most cases.
* lib/canonicalize-lgpl.c, lib/canonicalize.c: Make these files
easier to compare, e.g., by sorting include files and by switching
to the GNU convention of calling file names "file names", not
"path names". Include stdbool.h, scratch_buffer.h.
* lib/canonicalize-lgpl.c (IDX_MAX) [_LIBC]: New macro.
(malloca) [_LIBC]: Remove.
[!_LIBC]: Do not include malloca.h.
(get_path_max): New function, so that pathconf is called only in
the rare and dubious case when when RESOLVED is not null and
PATH_MAX is not defined. Invoke pathconf on "/" not the input
file name, as we care about the longest file name starting from
"/" (not from the input file name), and POSIX does not specify
what pathconf does on a non-directory file anyway. If PATH_MAX is
not defined, do not worry about overriding a path_max of 0, and do
not let path_max exceed IDX_MAX.
(__realpath): Remove an assumption that file name components
cannot exceed 1024 bytes when PATH_MAX is not defined (wrong for
the Hurd, presumably).
When allocating the result, allocate it to just the right size;
this costs nothing when the result is smaller than 1023 bytes,
and for larger results it's probably worth the CPU to call realloc,
as canonicalize.c already does.
* lib/canonicalize.c: Include attribute.h.
Do not include pathmax.h or xgetcwd.h.
(PATH_MAX): Do not define, so file names longer than 8192 bytes
work on platforms with no fixed limit.
(canonicalize_filename_mode_stk): New function, with
the content of the old canonicalize_filename_mode.
Use getcwd instead of xgetcwd, and readlink instead of areadlink,
since the scratch buffers now do memory management for us.
Use rawmemchr instead of adding strlen.
Use mempcpy instead of mempcpy + size.
Assume free preserves errno.
(canonicalize_filename_mode): Use it.
* modules/canonicalize (Depends-on): Remove areadlink, pathmax,
xgetcwd. Add attribute, free, getcwd, mempcpy, rawmemchr,
scratch_buffer, stdbool, xalloc-die.
* modules/canonicalize-lgpl (Depends-on): Remove alloca-opt,
malloca, realloc-posix. Add scratch_buffer, stdbool.
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-12/msg00109.html
* lib/canonicalize.c (canonicalize_filename_mode):
When testing a file name ending in '/', use stat rather than
readlink, so that it does the right thing on AIX.
* modules/canonicalize (Depends-on): Add readlink, to pull in the
recent changes in the Gnulib readlink module.
|
|
|
|
|
|
|
|
|
|
| |
* lib/idx.h: New file.
* modules/idx: New file.
* lib/canonicalize-lgpl.c: Include idx.h. Use idx_t instead of
ptrdiff_t.
* lib/canonicalize.c: Likewise.
* modules/canonicalize-lgpl (Depends-on): Add idx.
* modules/canonicalize (Depends-on): Likewise.
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (MULTIPLE_BITS_SET): Remove, replacing with ...
(multiple_bits_set): ... this new static function. Uses changed.
(canonicalize_filename_mode): Refactor for clarity to avoid
modifying the CAN_MODE argument.
|
|
|
|
|
|
|
| |
* lib/canonicalize.c: Include stddef.h, for ptrdiff_t.
(seen_triple, canonicalize_filename_mode): Prefer signed to
unsigned types where either will do, as they avoid some glitches
in comparisons and can trap on overflow when debugging.
|
|
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode):
Do not call stat if fewer than 20 symlinks have been traversed.
This avoids EOVERFLOW failure in the common case where there
are not that many symlinks, while continuing to catch loops
(or fail due to EOVERFLOW) in the unusual case when there
are many symlinks to traverse.
|
|
|
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode):
When checking for loops, use st_dev and st_ino from the parent
directory not from the symlink, as pre-2017 POSIX says these
members are not reliable for symlinks. Couple this with START
(the remaining file name to be resolved), not NAME (the whole file
name with START as its suffix).
* modules/canonicalize (Depends-on): Depend on stat, not lstat.
|
|
|
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode):
When testing whether a directory entry is a symbolic link, or a
directory or other, do not use lstat or stat or
areadlink_with_size. Just use areadlink, as this suffices and it
avoids the EOVERFLOW problem that lstat and stat have.
* modules/canonicalize (Depends-on): Depend on areadlink instead
of areadlink-with-size and stat.
|
|
|
|
|
|
|
|
| |
Reported and initial patch by Vaclav Slavik <vaclav@slavik.io> in
<https://savannah.gnu.org/bugs/?59079>.
* lib/canonicalize.c (canonicalize_filename_mode): For UNC file names,
extend the prefix to include the server.
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Florian Weimer in:
https://lists.gnu.org/r/bug-gnulib/2020-09/msg00025.html
* lib/canonicalize-lgpl.c (__realpath):
* lib/canonicalize.c (canonicalize_filename_mode):
Do not generate a pointer past the end of the array.
* lib/canonicalize.c (canonicalize_filename_mode):
Do not use a pointer after passing it to realloc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/at-func.c: Include filename.h instead of dosname.h.
* lib/unlinkat.c: Likewise.
* modules/areadlinkat (Depends-on): Add filename. Remove dosname.
* modules/areadlinkat-with-size (Depends-on): Likewise.
* modules/faccessat (Depends-on): Likewise.
* modules/fchmodat (Depends-on): Likewise.
* modules/fchownat (Depends-on): Likewise.
* modules/fstatat (Depends-on): Likewise.
* modules/mkdirat (Depends-on): Likewise.
* modules/mkfifoat (Depends-on): Likewise.
* modules/readlinkat (Depends-on): Likewise.
* modules/selinux-at (Depends-on): Likewise.
* modules/symlinkat (Depends-on): Likewise.
* modules/unlinkat (Depends-on): Likewise.
* modules/utimensat (Depends-on): Likewise.
* lib/at-func2.c: Include filename.h instead of dosname.h.
* modules/linkat (Depends-on): Add filename. Remove dosname.
* modules/renameatu (Depends-on): Likewise.
* lib/canonicalize.c: Include filename.h instead of dosname.h.
* lib/canonicalize-lgpl.c: Likewise.
* modules/canonicalize (Depends-on): Add filename.
* modules/canonicalize-lgpl (Depends-on): Likewise.
* lib/dirname.h: Include filename.h instead of dosname.h.
* modules/dirname-lgpl (Depends-on): Add filename. Remove dosname.
* lib/fchdir.c: Include filename.h instead of dosname.h.
* modules/fchdir (Depends-on): Add filename. Remove dosname.
* lib/openat.c: Include filename.h instead of dosname.h.
* modules/openat (Depends-on): Add filename. Remove dosname.
* lib/rmdir.c: Include filename.h instead of dosname.h.
* modules/rmdir (Depends-on): Add filename. Remove dosname.
* lib/savewd.c: Include filename.h instead of dosname.h.
* modules/savewd (Depends-on): Add filename. Remove dosname.
* lib/unlink.c: Include filename.h instead of dosname.h.
* modules/unlink (Depends-on): Add filename. Remove dosname.
* modules/relocatable-prog-wrapper (Depends-on): Add filename.
* lib/relocwrapper.c: Update comments.
* modules/lstat (Depends-on): Remove dosname.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00147.html
* lib/canonicalize.c (canonicalize_filename_mode):
* lib/canonicalize-lgpl.c (__realpath): Fix comments.
|
|
|
|
|
|
|
|
|
|
| |
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
|
|
|
|
|
|
|
|
|
|
| |
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
|
|
|
|
|
|
| |
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
|
|
|
|
|
|
| |
I ran 'make update-copyright'.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
| |
Run "make update-copyright". Compare to commit 1602f0a from last year.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode):
* lib/canonicalize-lgpl.c (__realpath): Recompute prefix_len after
fetching the current directory. Don't overrun the beginning of
rpath if there's no slashes after the MS-Windows drive letter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See <http://lists.gnu.org/archive/html/bug-gnulib/2012-11/msg00074.html>
for test cases, which it'd be nice to add at some point.
* lib/canonicalize.c, lib/canonicalize-lgpl.c: Include dosname.h.
* lib/canonicalize.c (canonicalize_filename_mode):
* lib/canonicalize-lgpl.c (__realpath):
Use FILE_SYSTEM_PREFIX_LEN instead of assuming that the first
slash is at the beginning of the file name. Use ISSLASH, instead
of a literal '/'. Use IS_ABSOLUTE_FILE_NAME instead of comparing
the first character with '/'. Test for
DOUBLE_SLASH_IS_DISTINCT_ROOT only if the file name does not begin
with a drive letter.
* lib/canonicalize.c (SLASHES): New macro.
(canonicalize_filename_mode): Use SLASHES instead of a literal "/".
|
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode): Swap order of
declarations so C89 is supported. Also remove the comment
referencing mem allocation as the suggested feature could
not be implemented as suggested.
Reported by Michael Goffioul
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When DOUBLE_SLASH_IS_DISTINCT_ROOT is non-zero, then we were
reading the contents of rpath[1] even when we had never written
anything there, which meant that "///" would usually canonicalize
to "/" but sometimes to "//" if a '/' was leftover in the heap.
This condition could also occur via 'ln -s / //some/path' and
canonicalizing //some/path, where we rewind rpath but do not
clear out the previous round. Platforms where "//" and "/" are
equivalent do not suffer from this read-beyond-written bounds.
* lib/canonicalize-lgpl.c (__realpath): Avoid possibility of
random '/' left in dest.
* lib/canonicalize.c (canonicalize_filename_mode): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Cygwin, and other platforms where // is detected as distinct
from / at configure time, the canonicalize routines were incorrectly
treating all instances of multiple leading slashes as //.
See also coreutils bug http://debbugs.gnu.org/10472
* lib/canonicalize.c (canonicalize_filename_mode): Don't convert
/// to //, since only // is special.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
| |
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode): Fix typo in comment.
* lib/canonicalize.h (canonicalize_filename_mode): Update specification.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode):
Avoid calling l?stat() when both CAN_MISSING,
and CAN_NOLINKS are set, as then we neither need
to resolve symlinks or test component existence.
|
|
|
|
|
|
|
|
|
| |
* lib/canonicalize.c (canonicalize_filename_mode):
Ensure references always resolve to a replacement
function if required (even via a macro).
The issue was spotted by Eric Blake and is
adequately documented in the docs for stat and lstat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will initially be used by a new coreutils realpath command.
* lib/canonicalize.h: Add the CAN_NOLINKS flag to
indicate we don't want to follow symlinks. Also
provide CAN_MODE_MASK to aid setting these existing
mutually exclusive values.
* lib/canonicalize.c (canonicalize_filename_mode):
Extract the flags from can_mode parameter, which
are currently just used to select between stat()
and lstat(). Also ensure that mutually exclusive
values are flagged immediately as invalid.
* tests/test-canonicalize.c: Verify symlinks are
not followed, and that invalid flag combinations
are diagnosed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/pathmax.h (PATH_MAX): Leave it undefined on GNU/Hurd.
* lib/chdir-long.h: Include pathmax.h.
* lib/clean-temp.c (PATH_MAX): Remove code that is done by pathmax.h.
* lib/getcwd.c: Include pathmax.h instead of <limits.h>.
(PATH_MAX): Remove code that is done by pathmax.h.
* lib/canonicalize.c (PATH_MAX): Provide a fallback value.
* lib/tmpfile.c: Add a comment.
* m4/pathmax.m4 (gl_PATHMAX): Don't test for pathconf.
* modules/chdir-long (Depends-on): Add pathmax.
* modules/getcwd (Depends-on): Add pathmax.
* tests/test-getcwd.c (test_abort_bug): Avoid syntax error when PATH_MAX
is not defined.
* doc/posix-headers/limits.texi: Mention the pathmax module.
* NEWS: Mention the change.
|
|
|
|
| |
Run the new "make update-copyright" rule.
|
|
|
|
|
| |
Use the same procedure as for 2009, outlined in
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
canonicalize was returning a 4k buffer for everything, even though
the majority of canonical path names are much shorter. This
resulted in a lot of unused memory, which in turn made tar run
out of memory when tracking a lot of files:
http://lists.gnu.org/archive/html/bug-tar/2009-12/msg00011.html
* lib/canonicalize.c (canonicalize_filename_mode): Trim the
allocation to size.
Reported by Solar Designer <solar@openwall.com>.
Signed-off-by: Eric Blake <ebb9@byu.net>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Coreutils' `readlink -f foo/' should not fail if lstat("foo")
gives ENOENT.
* lib/canonicalize.c (canonicalize_filename_mode): Skip trailing
slashes when checking if last component is missing.
* tests/test-canonicalize.c (main): Test this.
Signed-off-by: Eric Blake <ebb9@byu.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* modules/canonicalize (Files): Add double-slash-root.m4.
* modules/canonicalize-lgpl (Files): Likewise.
* m4/canonicalize.m4 (gl_FUNC_CANONICALIZE_FILENAME_MODE)
(gl_CANONICALIZE_LGPL_SEPARATE): Add dependency.
* lib/canonicalize.c (DOUBLE_SLASH_IS_DISTINCT_ROOT): Provide
fallback definition.
(canonicalize_filename_mode): Use it to protect //.
* lib/canonicalize-lgpl.c (DOUBLE_SLASH_IS_DISTINCT_ROOT)
(__realpath): Likewise.
* tests/test-canonicalize.c (main): Test this.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* modules/canonicalize-tests (Depends-on): Add same-inode.
* modules/canonicalize-lgpl-tests (Depends-on): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consolidate the m4 macros into a single file, since both modules
now have to worry about replacing canonicalize_file_name on
buggy glibc.
* m4/canonicalize-lgpl.m4: Move contents...
* m4/canonicalize.m4: ...here.
(gl_CANONICALIZE_LGPL): Factor realpath check...
(gl_FUNC_REALPATH_WORKS): ...into new macro. Enhance to catch
glibc 2.3.5 bug, fixed 2005-04-27.
(gl_FUNC_CANONICALIZE_FILENAME_MODE): Use it.
(gl_PREREQ_CANONICALIZE_LGPL): Inline...
(gl_CANONICALIZE_LGPL_SEPARATE): ...into this macro.
* modules/canonicalize-lgpl (Files): Manage file rename.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Provide default.
* modules/stdlib (Makefile.am): Substitute witness.
* lib/stdlib.in.h (canonicalize_file_name): Declare if replacement
is needed.
* lib/canonicalize-lgpl.c: Also compile if canonicalize_file_name
replacement is required.
* lib/canonicalize.c (canonicalize_file_name): Likewise.
* doc/glibc-functions/canonicalize_file_name.texi
(canonicalize_file_name): Document this.
* doc/posix-functions/realpath.texi (realpath): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
|