]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames
authorTim Kientzle <kientzle@acm.org>
Mon, 22 Aug 2016 00:11:45 +0000 (17:11 -0700)
committerTim Kientzle <kientzle@acm.org>
Mon, 22 Aug 2016 00:11:45 +0000 (17:11 -0700)
commit1fa9c7bf90f0862036a99896b0501c381584451a
tree11edc8996325b0a27e84d6d0e468d0813b5b221f
parentda3b3c19d02591161bf53cbe4e520dde14557247
Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames

Because check_symlinks is handled separately from the deep-directory
support, very long pathnames cause problems.  Previously, the code
ignored most failures to lstat() a path component.  In particular,
this led to check_symlinks always passing for very long paths, which
in turn provides a way to evade the symlink checks in the sandboxing
code.

We now fail on unrecognized lstat() failures, which plugs this
hole at the cost of disabling deep directory support when the
user requests sandboxing.

TODO:  This probably cannot be completely fixed without
entirely reimplementing the deep directory support to
integrate the symlink checks.  I want to reimplement the
deep directory hanlding someday anyway; openat() and
related system calls now provide a much cleaner way to
handle deep directories than the chdir approach used by this
code.
libarchive/archive_write_disk_posix.c