]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Check if root before operations. 1023/head
authorEric Borisch <eborisch@gmail.com>
Tue, 5 Jun 2018 03:13:43 +0000 (22:13 -0500)
committerEric Borisch <eborisch@gmail.com>
Tue, 5 Jun 2018 03:13:43 +0000 (22:13 -0500)
commitd30a8faa42b36651194de4dc8dfebac99718db28
treefe740fca38bd6a20e4d85ff2a931c74624d779ab
parent5a796cc6960b935e9162b98b035dfca7d4777dfb
Check if root before operations.

No overall change to the code path when root; when not root, ensure
created files are initially user writable if we need to do XATTRs or HFS
compression. Mode is fixed later to the desired final mode in this case.

Net of one extra syscall per file to fix the mode at the end only when
all of these are true:
 * Not root
 * Final mode is not owner-writable
 * XATTRs or HFS compression are needed.

These changes make it unexpectedly pass the xattr test on freebsd.
libarchive/archive_write_disk_posix.c