]> 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>
Mon, 7 Feb 2022 23:30:43 +0000 (00:30 +0100)
commit4f8ad2f107be6bf64ecc085ea049df70b5ff2956
tree3666026554d8b82d36f6740be7e733216262fa67
parent518bb6ee8aa7e7c1618c5c331e740b19f44166cb
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