]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fix following symlinks when processing the fixup list
authorMartin Matuska <martin@matuska.org>
Fri, 27 Aug 2021 08:56:28 +0000 (10:56 +0200)
committerMartin Matuska <martin@matuska.org>
Fri, 27 Aug 2021 10:20:39 +0000 (12:20 +0200)
commit8a1bd5c18e896f0411a991240ce0d772bb02c840
tree2c192e48488a2d470f73da046b1102ff474b0cc5
parentb9f4955025efe63115a426343513d1b28ebf6da8
Fix following symlinks when processing the fixup list

The previous fix in b41daecb5 was incomplete. Fixup entries are
given the original path without calling cleanup_pathname().
To make sure we don't follow a symlink, we must strip trailing
slashes from the path.

The fixup entries are always directories. Make sure we try to modify
only directories by providing O_DIRECTORY to open() (if supported)
and if it fails to check directory via lstat().

Fixes #1566
libarchive/archive_write_disk_posix.c
libarchive/test/test_write_disk_fixup.c