]> Savannah Git Hosting - gnulib.git/commit
canonicalize: do not assume symlinks have st_ino
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Dec 2020 22:25:42 +0000 (14:25 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Dec 2020 22:39:29 +0000 (14:39 -0800)
commita5c3b6cba6b0fe57bfeddc9e0fa56b25736e2eef
treec80b560b4a866da03f6a239f77fb449ece758127
parent47f74ead5c1cb72d489ea06a8a716eb0f65a430c
canonicalize: do not assume symlinks have st_ino

* 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.
ChangeLog
lib/canonicalize.c
modules/canonicalize