aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2016-09-01 12:01:23 +0000
committerMartin Matuska <mm@FreeBSD.org>2016-09-01 12:01:23 +0000
commit100a82d820616af597bfe271258d90eacebe2694 (patch)
tree997d75073036327a3797a49754e91e2abda26556 /contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
parent60c28d7a1ba7eb7113f0da10933b9ff1895e2aa3 (diff)
downloadsrc-100a82d820616af597bfe271258d90eacebe2694.tar.gz
src-100a82d820616af597bfe271258d90eacebe2694.zip
MFC r304075,r304989:
Sync libarchive with vendor including security fixes Vendor issues fixed: Issue #731: Reject tar entries >= INT64_MAX Issue #744: Very long pathnames evade symlink checks Issue #748: libarchive can compress, but cannot decompress zip some files PR #750: ustar: fix out of bounds read on empty string ("") filename PR #755: fix use of acl_get_flagset_np() on FreeBSD Issue #767: Buffer overflow printing a filename Issue #770: Zip read: be more careful about extra_length MFC r304874: Temporarily disable two libarchive tests that have not yet been fixed by vendor. Tests will be re-enabled after a fix has been merged.
Notes
Notes: svn path=/stable/10/; revision=305192
Diffstat (limited to 'contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c')
-rw-r--r--contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c b/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
index cf8ea2ef2a10..29b4b6cb0869 100644
--- a/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
+++ b/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
@@ -641,13 +641,16 @@ translate_acl(struct archive_read_disk *a,
* Libarchive stores "flag" (NFSv4 inheritance bits)
* in the ae_perm bitmap.
*/
- acl_get_flagset_np(acl_entry, &acl_flagset);
- for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
- if (acl_get_flag_np(acl_flagset,
- acl_inherit_map[i].platform_inherit))
- ae_perm |= acl_inherit_map[i].archive_inherit;
-
- }
+ // XXX acl_get_flagset_np on FreeBSD returns EINVAL for
+ // non-NFSv4 ACLs
+ r = acl_get_flagset_np(acl_entry, &acl_flagset);
+ if (r == 0) {
+ for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
+ if (acl_get_flag_np(acl_flagset,
+ acl_inherit_map[i].platform_inherit))
+ ae_perm |= acl_inherit_map[i].archive_inherit;
+ }
+ }
#endif
acl_get_permset(acl_entry, &acl_permset);