Date: Sun, 4 Dec 2016 00:00:56 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r309519 - in projects/clang391-import: . cddl/contrib/opensolaris/tools/ctf/cvt contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/ta... Message-ID: <201612040000.uB400uxA087619@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Dec 4 00:00:56 2016 New Revision: 309519 URL: https://svnweb.freebsd.org/changeset/base/309519 Log: Merge ^/head r309263 through r309518. Added: projects/clang391-import/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu - copied unchanged from r309518, head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu projects/clang391-import/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c - copied unchanged from r309518, head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c projects/clang391-import/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu - copied unchanged from r309518, head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu projects/clang391-import/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c - copied unchanged from r309518, head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c projects/clang391-import/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu - copied unchanged from r309518, head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu projects/clang391-import/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu - copied unchanged from r309518, head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu projects/clang391-import/lib/libc/tests/sys/mlock_helper.c - copied unchanged from r309518, head/lib/libc/tests/sys/mlock_helper.c projects/clang391-import/sbin/camcontrol/timestamp.c - copied unchanged from r309518, head/sbin/camcontrol/timestamp.c projects/clang391-import/sys/contrib/ck/ - copied from r309518, head/sys/contrib/ck/ projects/clang391-import/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu - copied unchanged from r309518, head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu projects/clang391-import/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu - copied unchanged from r309518, head/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu projects/clang391-import/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu - copied unchanged from r309518, head/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu projects/clang391-import/sys/dev/cxgbe/firmware/t6fw_cfg.txt - copied unchanged from r309518, head/sys/dev/cxgbe/firmware/t6fw_cfg.txt projects/clang391-import/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt - copied unchanged from r309518, head/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt projects/clang391-import/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt - copied unchanged from r309518, head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt projects/clang391-import/sys/modules/cxgbe/t6_firmware/ - copied from r309518, head/sys/modules/cxgbe/t6_firmware/ Deleted: projects/clang391-import/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu projects/clang391-import/sys/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu Modified: projects/clang391-import/Makefile.inc1 projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c projects/clang391-import/contrib/libarchive/NEWS projects/clang391-import/contrib/libarchive/libarchive/archive.h projects/clang391-import/contrib/libarchive/libarchive/archive_acl.c projects/clang391-import/contrib/libarchive/libarchive/archive_entry.c projects/clang391-import/contrib/libarchive/libarchive/archive_entry.h projects/clang391-import/contrib/libarchive/libarchive/archive_entry_acl.3 projects/clang391-import/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_uu.c projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_xz.c projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_cab.c projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_mtree.c projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_tar.c projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_xar.c projects/clang391-import/contrib/libarchive/libarchive/archive_write_disk_posix.c projects/clang391-import/contrib/libarchive/libarchive/test/test_compat_gtar.c projects/clang391-import/contrib/libarchive/libarchive/test/test_read_format_raw.c projects/clang391-import/contrib/libarchive/libarchive/test/test_sparse_basic.c projects/clang391-import/contrib/libarchive/tar/creation_set.c projects/clang391-import/contrib/libarchive/tar/test/main.c projects/clang391-import/contrib/libarchive/tar/test/test_copy.c projects/clang391-import/contrib/libarchive/tar/test/test_symlink_dir.c projects/clang391-import/contrib/libarchive/tar/write.c projects/clang391-import/contrib/netbsd-tests/games/t_factor.sh projects/clang391-import/contrib/netbsd-tests/lib/libc/gen/t_vis.c projects/clang391-import/contrib/netbsd-tests/lib/libc/sys/t_mlock.c projects/clang391-import/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c projects/clang391-import/contrib/subversion/CHANGES projects/clang391-import/contrib/subversion/README projects/clang391-import/contrib/subversion/build-outputs.mk projects/clang391-import/contrib/subversion/configure projects/clang391-import/contrib/subversion/configure.ac projects/clang391-import/contrib/subversion/get-deps.sh projects/clang391-import/contrib/subversion/subversion/include/private/svn_sqlite.h projects/clang391-import/contrib/subversion/subversion/include/svn_version.h projects/clang391-import/contrib/subversion/subversion/libsvn_client/merge.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/caching.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/fs.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/low_level.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/pack.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/pack.h projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/transaction.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_fs/tree.c projects/clang391-import/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h projects/clang391-import/contrib/subversion/subversion/libsvn_ra_serf/xml.c projects/clang391-import/contrib/subversion/subversion/libsvn_repos/reporter.c projects/clang391-import/contrib/subversion/subversion/libsvn_repos/repos.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/config_file.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/deprecated.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/gpg_agent.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/internal_statements.h projects/clang391-import/contrib/subversion/subversion/libsvn_subr/sqlite.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/sysinfo.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c projects/clang391-import/contrib/subversion/subversion/libsvn_subr/xml.c projects/clang391-import/contrib/subversion/subversion/libsvn_wc/conflicts.c projects/clang391-import/contrib/subversion/subversion/libsvn_wc/update_editor.c projects/clang391-import/contrib/subversion/subversion/libsvn_wc/wc-checks.h projects/clang391-import/contrib/subversion/subversion/libsvn_wc/wc-metadata.h projects/clang391-import/contrib/subversion/subversion/libsvn_wc/wc-queries.h projects/clang391-import/contrib/subversion/subversion/svn/info-cmd.c projects/clang391-import/contrib/subversion/subversion/svn/merge-cmd.c projects/clang391-import/contrib/subversion/subversion/svnserve/serve.c projects/clang391-import/etc/defaults/rc.conf projects/clang391-import/etc/rc.subr projects/clang391-import/include/Makefile projects/clang391-import/include/stddef.h projects/clang391-import/lib/libarchive/tests/Makefile projects/clang391-import/lib/libc/sys/thr_set_name.2 projects/clang391-import/lib/libc/tests/sys/Makefile projects/clang391-import/lib/libcapsicum/capsicum_helpers.h projects/clang391-import/lib/libstand/dosfs.c projects/clang391-import/lib/libutil/flopen.c projects/clang391-import/lib/libutil/gr_util.c projects/clang391-import/lib/libutil/pw_util.c projects/clang391-import/lib/msun/arm/Symbol.map projects/clang391-import/lib/msun/mips/Symbol.map projects/clang391-import/lib/msun/riscv/Symbol.map projects/clang391-import/libexec/rtld-elf/aarch64/rtld_machdep.h projects/clang391-import/libexec/rtld-elf/riscv/rtld_machdep.h projects/clang391-import/libexec/rtld-elf/rtld.c projects/clang391-import/libexec/rtld-elf/sparc64/rtld_machdep.h projects/clang391-import/sbin/camcontrol/Makefile projects/clang391-import/sbin/camcontrol/camcontrol.8 projects/clang391-import/sbin/camcontrol/camcontrol.c projects/clang391-import/sbin/camcontrol/camcontrol.h projects/clang391-import/sbin/devd/devd.cc projects/clang391-import/sbin/geom/class/mirror/geom_mirror.c projects/clang391-import/sbin/geom/class/mirror/gmirror.8 projects/clang391-import/sbin/ipfw/ipfw2.c projects/clang391-import/sbin/nvmecontrol/logpage.c projects/clang391-import/share/man/man3/pthread_set_name_np.3 projects/clang391-import/share/man/man4/iic.4 projects/clang391-import/share/man/man4/ng_checksum.4 projects/clang391-import/share/man/man4/ng_patch.4 projects/clang391-import/share/mk/bsd.confs.mk projects/clang391-import/share/mk/bsd.files.mk projects/clang391-import/share/mk/bsd.incs.mk projects/clang391-import/sys/arm/arm/gic.c projects/clang391-import/sys/arm/arm/gic.h projects/clang391-import/sys/arm/arm/gic_fdt.c projects/clang391-import/sys/arm/ti/cpsw/if_cpsw.c projects/clang391-import/sys/arm/ti/cpsw/if_cpswvar.h projects/clang391-import/sys/arm64/arm64/mp_machdep.c projects/clang391-import/sys/arm64/cavium/thunder_pcie_common.c projects/clang391-import/sys/boot/Makefile.inc projects/clang391-import/sys/boot/common/self_reloc.c projects/clang391-import/sys/boot/efi/boot1/Makefile projects/clang391-import/sys/boot/i386/boot2/Makefile projects/clang391-import/sys/boot/i386/pxeldr/Makefile projects/clang391-import/sys/boot/i386/zfsboot/Makefile projects/clang391-import/sys/boot/pc98/boot0.5/Makefile projects/clang391-import/sys/boot/pc98/boot2/Makefile projects/clang391-import/sys/boot/pc98/pc98boot/Makefile projects/clang391-import/sys/boot/powerpc/boot1.chrp/Makefile projects/clang391-import/sys/boot/sparc64/boot1/Makefile projects/clang391-import/sys/cam/cam_xpt.c projects/clang391-import/sys/cam/scsi/scsi_all.c projects/clang391-import/sys/cam/scsi/scsi_all.h projects/clang391-import/sys/cam/scsi/scsi_enc_ses.c projects/clang391-import/sys/conf/files projects/clang391-import/sys/conf/files.arm64 projects/clang391-import/sys/conf/options projects/clang391-import/sys/dev/acpica/acpi_ec.c projects/clang391-import/sys/dev/ath/if_ath_tx_ht.c projects/clang391-import/sys/dev/cxgbe/common/common.h projects/clang391-import/sys/dev/cxgbe/common/t4_hw.c projects/clang391-import/sys/dev/cxgbe/firmware/t4fw_interface.h projects/clang391-import/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt projects/clang391-import/sys/dev/cxgbe/t4_main.c projects/clang391-import/sys/dev/etherswitch/etherswitch.c projects/clang391-import/sys/dev/hyperv/netvsc/if_hn.c projects/clang391-import/sys/dev/hyperv/netvsc/if_hnvar.h projects/clang391-import/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c projects/clang391-import/sys/dev/hyperv/vmbus/vmbus.c projects/clang391-import/sys/dev/hyperv/vmbus/vmbus_chan.c projects/clang391-import/sys/dev/hyperv/vmbus/vmbus_if.m projects/clang391-import/sys/dev/ioat/ioat.c projects/clang391-import/sys/dev/ioat/ioat_internal.h projects/clang391-import/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c projects/clang391-import/sys/dev/mlx5/mlx5_en/mlx5_en_main.c projects/clang391-import/sys/dev/mrsas/mrsas.c projects/clang391-import/sys/dev/mrsas/mrsas.h projects/clang391-import/sys/dev/mrsas/mrsas_cam.c projects/clang391-import/sys/dev/mrsas/mrsas_fp.c projects/clang391-import/sys/dev/netmap/netmap_freebsd.c projects/clang391-import/sys/dev/pci/pci_host_generic_fdt.c projects/clang391-import/sys/dev/rtwn/if_rtwnvar.h projects/clang391-import/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c projects/clang391-import/sys/dev/uart/uart_dev_pl011.c projects/clang391-import/sys/dev/usb/wlan/if_rsu.c projects/clang391-import/sys/dev/usb/wlan/if_rsureg.h projects/clang391-import/sys/fs/ext2fs/ext2_alloc.c projects/clang391-import/sys/fs/ext2fs/ext2_balloc.c projects/clang391-import/sys/fs/ext2fs/ext2_bmap.c projects/clang391-import/sys/fs/ext2fs/ext2_extern.h projects/clang391-import/sys/fs/ext2fs/ext2_inode.c projects/clang391-import/sys/fs/ext2fs/ext2_lookup.c projects/clang391-import/sys/fs/ext2fs/ext2_mount.h projects/clang391-import/sys/fs/ext2fs/ext2_subr.c projects/clang391-import/sys/fs/ext2fs/ext2_vfsops.c projects/clang391-import/sys/fs/ext2fs/ext2_vnops.c projects/clang391-import/sys/fs/ext2fs/fs.h projects/clang391-import/sys/fs/ext2fs/inode.h projects/clang391-import/sys/geom/mirror/g_mirror.c projects/clang391-import/sys/geom/mirror/g_mirror.h projects/clang391-import/sys/geom/mirror/g_mirror_ctl.c projects/clang391-import/sys/kern/kern_thr.c projects/clang391-import/sys/kern/vfs_lookup.c projects/clang391-import/sys/modules/Makefile projects/clang391-import/sys/modules/bios/Makefile projects/clang391-import/sys/modules/cxgbe/Makefile projects/clang391-import/sys/modules/cxgbe/t4_firmware/Makefile projects/clang391-import/sys/modules/cxgbe/t5_firmware/Makefile projects/clang391-import/sys/modules/hyperv/netvsc/Makefile projects/clang391-import/sys/net80211/ieee80211.c projects/clang391-import/sys/net80211/ieee80211_var.h projects/clang391-import/sys/netgraph/ng_base.c projects/clang391-import/sys/netgraph/ng_patch.c projects/clang391-import/sys/netgraph/ng_patch.h projects/clang391-import/sys/netinet/tcp_input.c projects/clang391-import/sys/netpfil/pf/if_pfsync.c projects/clang391-import/sys/powerpc/powerpc/db_disasm.c projects/clang391-import/sys/vm/_vm_radix.h projects/clang391-import/sys/vm/vm_object.c projects/clang391-import/sys/vm/vm_radix.c projects/clang391-import/sys/x86/cpufreq/hwpstate.c projects/clang391-import/tests/sys/acl/01.sh projects/clang391-import/tests/sys/kern/coredump_phnum_test.sh projects/clang391-import/tools/tools/nanobsd/nanobsd.sh projects/clang391-import/usr.bin/indent/indent.1 projects/clang391-import/usr.bin/indent/indent.c projects/clang391-import/usr.bin/indent/indent_codes.h projects/clang391-import/usr.bin/indent/io.c projects/clang391-import/usr.bin/indent/lexi.c projects/clang391-import/usr.bin/indent/parse.c projects/clang391-import/usr.bin/indent/pr_comment.c projects/clang391-import/usr.bin/locale/Makefile projects/clang391-import/usr.bin/locale/locale.c projects/clang391-import/usr.bin/login/login_audit.c projects/clang391-import/usr.sbin/bhyve/dbgport.c projects/clang391-import/usr.sbin/i2c/i2c.c projects/clang391-import/usr.sbin/ypldap/aldap.c projects/clang391-import/usr.sbin/ypldap/ldapclient.c projects/clang391-import/usr.sbin/ypldap/yp.c projects/clang391-import/usr.sbin/ypldap/ypldap.c projects/clang391-import/usr.sbin/ypldap/ypldap_dns.c Directory Properties: projects/clang391-import/ (props changed) projects/clang391-import/cddl/ (props changed) projects/clang391-import/cddl/contrib/opensolaris/ (props changed) projects/clang391-import/contrib/libarchive/ (props changed) projects/clang391-import/contrib/netbsd-tests/ (props changed) projects/clang391-import/contrib/subversion/ (props changed) Modified: projects/clang391-import/Makefile.inc1 ============================================================================== --- projects/clang391-import/Makefile.inc1 Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/Makefile.inc1 Sun Dec 4 00:00:56 2016 (r309519) @@ -1631,11 +1631,6 @@ ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libne _cat= bin/cat .endif -# r264059 support for status= -.if ${BOOTSTRAPPING} < 1100017 -_dd= bin/dd -.endif - # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support .if ${BOOTSTRAPPING} < 1100078 @@ -1718,7 +1713,6 @@ bootstrap-tools: .PHONY ${_groff} \ ${_dtc} \ ${_cat} \ - ${_dd} \ ${_kbdcontrol} \ usr.bin/lorder \ ${_libopenbsd} \ @@ -2403,6 +2397,11 @@ delete-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done @echo ">>> Old directories removed" @@ -2417,6 +2416,11 @@ check-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done delete-old: delete-old-files delete-old-dirs .PHONY Modified: projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sun Dec 4 00:00:56 2016 (r309519) @@ -52,8 +52,6 @@ static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) -static int ntypes = 0; /* The number of types. */ - struct ctf_buf { strtab_t ctb_strtab; /* string table */ caddr_t ctb_base; /* pointer to base of buffer */ @@ -1145,10 +1143,6 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_type = tdarr[ctm->ctm_type]; (*mpp)->ml_offset = ctm->ctm_offset; (*mpp)->ml_size = 0; - if (ctm->ctm_type > ntypes) { - parseterminate("Invalid member type ctm_type=%d", - ctm->ctm_type); - } } } else { for (i = 0, mpp = &tdp->t_members; i < vlen; @@ -1165,10 +1159,6 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_offset = (int)CTF_LMEM_OFFSET(ctlm); (*mpp)->ml_size = 0; - if (ctlm->ctlm_type > ntypes) { - parseterminate("Invalid lmember type ctlm_type=%d", - ctlm->ctlm_type); - } } } @@ -1282,10 +1272,9 @@ ctf_parse(ctf_header_t *h, caddr_t buf, { tdata_t *td = tdata_new(); tdesc_t **tdarr; + int ntypes = count_types(h, buf); int idx, i; - ntypes = count_types(h, buf); - /* shudder */ tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1)); tdarr[0] = NULL; Modified: projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sun Dec 4 00:00:56 2016 (r309519) @@ -159,7 +159,7 @@ typedef struct ardef { /* Auxiliary structure for structure/union tdesc_t */ typedef struct mlist { int ml_offset; /* Offset from start of structure (in bits) */ - uint_t ml_size; /* Member size (in bits) */ + int ml_size; /* Member size (in bits) */ char *ml_name; /* Member name */ struct tdesc *ml_type; /* Member type */ struct mlist *ml_next; /* Next member */ Modified: projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sun Dec 4 00:00:56 2016 (r309519) @@ -727,13 +727,6 @@ die_array_create(dwarf_t *dw, Dwarf_Die tdesc_t *dimtdp; int flags; - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (uval == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - uval = 0; - } - tdp->t_size = uval; /* @@ -826,12 +819,6 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d tdp->t_type = ENUM; (void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ); - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (uval == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - uval = 0; - } tdp->t_size = uval; if ((mem = die_child(dw, die)) != NULL) { @@ -945,7 +932,7 @@ static void die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, int type, const char *typename) { - Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0; + Dwarf_Unsigned sz, bitsz, bitoff; #if BYTE_ORDER == _LITTLE_ENDIAN Dwarf_Unsigned bysz; #endif @@ -1004,8 +991,6 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st ml->ml_name = NULL; ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type); - debug(3, "die_sou_create(): ml_type = %p t_id = %d\n", - ml->ml_type, ml->ml_type->t_id); if (die_mem_offset(dw, mem, DW_AT_data_member_location, &mloff, 0)) { @@ -1051,24 +1036,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st *mlastp = ml; mlastp = &ml->ml_next; - - /* Find the size of the largest member to work around a gcc - * bug. See GCC Bugzilla 35998. - */ - if (maxsz < ml->ml_size) - maxsz = ml->ml_size; - } while ((mem = die_sibling(dw, mem)) != NULL); - /* See if we got a bogus DW_AT_byte_size. GCC will sometimes - * emit this. - */ - if (sz == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */ - } - /* * GCC will attempt to eliminate unused types, thus decreasing the * size of the emitted dwarf. That is, if you declare a foo_t in your @@ -1170,7 +1139,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t ** } if (ml->ml_size != 0 && mt->t_type == INTRINSIC && - mt->t_intr->intr_nbits != (int)ml->ml_size) { + mt->t_intr->intr_nbits != ml->ml_size) { /* * This member is a bitfield, and needs to reference * an intrinsic type with the same width. If the @@ -1486,13 +1455,6 @@ die_base_create(dwarf_t *dw, Dwarf_Die b */ (void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ); - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (sz == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - sz = 0; - } - if (tdp->t_name == NULL) terminate("die %llu: base type without name\n", off); Modified: projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c ============================================================================== --- projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Sun Dec 4 00:00:56 2016 (r309519) @@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_ itdp = find_intrinsic(tdp); if (itdp->t_type == INTRINSIC) { - if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) { + if (mlp->ml_size != itdp->t_intr->intr_nbits) { parse_debug(4, cp, "making %d bit intrinsic " "from %s", mlp->ml_size, tdesc_name(itdp)); mlp->ml_type = bitintrinsic(itdp, mlp->ml_size); @@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, vo while (tdp) { switch (tdp->t_type) { case INTRINSIC: - if ((int)ml->ml_size != tdp->t_intr->intr_nbits) { + if (ml->ml_size != tdp->t_intr->intr_nbits) { debug(3, "making %d bit intrinsic from %s", ml->ml_size, tdesc_name(tdp)); ml->ml_type = bitintrinsic(tdp, ml->ml_size); Modified: projects/clang391-import/contrib/libarchive/NEWS ============================================================================== --- projects/clang391-import/contrib/libarchive/NEWS Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/NEWS Sun Dec 4 00:00:56 2016 (r309519) @@ -1,3 +1,5 @@ +Oct 26, 2016: Remove liblzmadec support + Oct 23, 2016: libarchive 3.2.2 released Security release Modified: projects/clang391-import/contrib/libarchive/libarchive/archive.h ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive.h Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive.h Sun Dec 4 00:00:56 2016 (r309519) @@ -562,7 +562,7 @@ __LA_DECL la_int64_t archive_read_head * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. @@ -984,12 +984,12 @@ __LA_DECL int archive_read_disk_can_desc __LA_DECL int archive_read_disk_current_filesystem(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *); -/* Request that the access time of the entry visited by travesal be restored. */ +/* Request that the access time of the entry visited by traversal be restored. */ __LA_DECL int archive_read_disk_set_atime_restored(struct archive *); /* * Set behavior. The "flags" argument selects optional behavior. */ -/* Request that the access time of the entry visited by travesal be restored. +/* Request that the access time of the entry visited by traversal be restored. * This is the same as archive_read_disk_set_atime_restored. */ #define ARCHIVE_READDISK_RESTORE_ATIME (0x0001) /* Default: Do not skip an entry which has nodump flags. */ @@ -1124,7 +1124,7 @@ __LA_DECL int archive_match_time_exclude /* * Flags to tell a matching type of time stamps. These are used for - * following functinos. + * following functions. */ /* Time flag: mtime to be tested. */ #define ARCHIVE_MATCH_MTIME (0x0100) @@ -1144,7 +1144,7 @@ __LA_DECL int archive_match_include_date const char *_datestr); __LA_DECL int archive_match_include_date_w(struct archive *, int _flag, const wchar_t *_datestr); -/* Set inclusion time by a particluar file. */ +/* Set inclusion time by a particular file. */ __LA_DECL int archive_match_include_file_time(struct archive *, int _flag, const char *_pathname); __LA_DECL int archive_match_include_file_time_w(struct archive *, Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_acl.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_acl.c Sun Dec 4 00:00:56 2016 (r309519) @@ -94,6 +94,7 @@ archive_acl_clear(struct archive_acl *ac acl->acl_text = NULL; } acl->acl_p = NULL; + acl->acl_types = 0; acl->acl_state = 0; /* Not counting. */ } @@ -284,8 +285,11 @@ acl_new_entry(struct archive_acl *acl, aq = NULL; while (ap != NULL) { if (ap->type == type && ap->tag == tag && ap->id == id) { - ap->permset = permset; - return (ap); + if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER && + tag != ARCHIVE_ENTRY_ACL_GROUP)) { + ap->permset = permset; + return (ap); + } } aq = ap; ap = ap->next; Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_entry.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_entry.c Sun Dec 4 00:00:56 2016 (r309519) @@ -1442,6 +1442,15 @@ archive_entry_acl_add_entry_w(struct arc } /* + * Return a bitmask of ACL types in an archive entry ACL list + */ +int +archive_entry_acl_types(struct archive_entry *entry) +{ + return ((&entry->acl)->acl_types); +} + +/* * Return a count of entries matching "want_type". */ int Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_entry.h Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_entry.h Sun Dec 4 00:00:56 2016 (r309519) @@ -508,6 +508,9 @@ __LA_DECL const wchar_t *archive_entry_a __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, int /* flags */); +/* Return bitmask of ACL types in an archive entry */ +__LA_DECL int archive_entry_acl_types(struct archive_entry *); + /* Return a count of entries matching 'want_type' */ __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */); Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_entry_acl.3 Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_entry_acl.3 Sun Dec 4 00:00:56 2016 (r309519) @@ -33,7 +33,8 @@ .Nm archive_entry_acl_next , .Nm archive_entry_acl_next_w , .Nm archive_entry_acl_reset , -.Nm archive_entry_acl_text_w +.Nm archive_entry_acl_text_w , +.Nm archive_entry_acl_types .Nd functions for manipulating Access Control Lists in archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -85,6 +86,8 @@ Streaming Archive Library (libarchive, - .Fn archive_entry_acl_reset "struct archive_entry *a" "int type" .Ft const wchar_t * .Fn archive_entry_acl_text_w "struct archive_entry *a" "int flags" +.Ft int +.Fn archive_entry_acl_types "struct archive_entry *a" .\" enum? .Sh DESCRIPTION An @@ -192,6 +195,11 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4 +ACL entries cannot be mixed, this function is a very efficient way to detect if +an ACL already contains POSIX.1e or NFSv4 ACL entries. .Sh RETURN VALUES .Fn archive_entry_acl_count and @@ -225,6 +233,9 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries. .Sh SEE ALSO .Xr archive_entry 3 .Xr libarchive 3 , Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Dec 4 00:00:56 2016 (r309519) @@ -125,6 +125,10 @@ static int setup_xattrs(struct archive_r struct archive_entry *, int *fd); static int setup_sparse(struct archive_read_disk *, struct archive_entry *, int *fd); +#if defined(HAVE_LINUX_FIEMAP_H) +static int setup_sparse_fiemap(struct archive_read_disk *, + struct archive_entry *, int *fd); +#endif int archive_read_disk_entry_from_file(struct archive *_a, @@ -1124,7 +1128,7 @@ setup_xattrs(struct archive_read_disk *a #if defined(HAVE_LINUX_FIEMAP_H) /* - * Linux sparse interface. + * Linux FIEMAP sparse interface. * * The FIEMAP ioctl returns an "extent" for each physical allocation * on disk. We need to process those to generate a more compact list @@ -1139,7 +1143,7 @@ setup_xattrs(struct archive_read_disk *a */ static int -setup_sparse(struct archive_read_disk *a, +setup_sparse_fiemap(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { char buff[4096]; @@ -1191,7 +1195,7 @@ setup_sparse(struct archive_read_disk *a /* When something error happens, it is better we * should return ARCHIVE_OK because an earlier * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */ - goto exit_setup_sparse; + goto exit_setup_sparse_fiemap; } if (fm->fm_mapped_extents == 0) { if (iters == 0) { @@ -1226,14 +1230,24 @@ setup_sparse(struct archive_read_disk *a } else break; } -exit_setup_sparse: +exit_setup_sparse_fiemap: return (exit_sts); } -#elif defined(SEEK_HOLE) && defined(SEEK_DATA) && defined(_PC_MIN_HOLE_SIZE) +#if !defined(SEEK_HOLE) || !defined(SEEK_DATA) +static int +setup_sparse(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + return setup_sparse_fiemap(a, entry, fd); +} +#endif +#endif /* defined(HAVE_LINUX_FIEMAP_H) */ + +#if defined(SEEK_HOLE) && defined(SEEK_DATA) /* - * FreeBSD and Solaris sparse interface. + * SEEK_HOLE sparse interface (FreeBSD, Linux, Solaris) */ static int @@ -1241,8 +1255,8 @@ setup_sparse(struct archive_read_disk *a struct archive_entry *entry, int *fd) { int64_t size; - off_t initial_off; /* FreeBSD/Solaris only, so off_t okay here */ - off_t off_s, off_e; /* FreeBSD/Solaris only, so off_t okay here */ + off_t initial_off; + off_t off_s, off_e; int exit_sts = ARCHIVE_OK; int check_fully_sparse = 0; @@ -1268,8 +1282,10 @@ setup_sparse(struct archive_read_disk *a } if (*fd >= 0) { +#ifdef _PC_MIN_HOLE_SIZE if (fpathconf(*fd, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif initial_off = lseek(*fd, 0, SEEK_CUR); if (initial_off != 0) lseek(*fd, 0, SEEK_SET); @@ -1280,8 +1296,10 @@ setup_sparse(struct archive_read_disk *a if (path == NULL) path = archive_entry_pathname(entry); +#ifdef _PC_MIN_HOLE_SIZE if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif *fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (*fd < 0) { archive_set_error(&a->archive, errno, @@ -1292,6 +1310,19 @@ setup_sparse(struct archive_read_disk *a initial_off = 0; } +#ifndef _PC_MIN_HOLE_SIZE + /* Check if the underlying filesystem supports seek hole */ + off_s = lseek(*fd, 0, SEEK_HOLE); + if (off_s < 0) +#if defined(HAVE_LINUX_FIEMAP_H) + return setup_sparse_fiemap(a, entry, fd); +#else + goto exit_setup_sparse; +#endif + else if (off_s > 0) + lseek(*fd, 0, SEEK_SET); +#endif + off_s = 0; size = archive_entry_size(entry); while (off_s < size) { @@ -1341,7 +1372,7 @@ exit_setup_sparse: return (exit_sts); } -#else +#elif !defined(HAVE_LINUX_FIEMAP_H) /* * Generic (stub) sparse support. Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_uu.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Sun Dec 4 00:00:56 2016 (r309519) @@ -312,6 +312,7 @@ uudecode_bidder_bid(struct archive_read_ avail -= len; if (l == 6) { + /* "begin " */ if (!uuchar[*b]) return (0); /* Get a length of decoded bytes. */ @@ -352,8 +353,8 @@ uudecode_bidder_bid(struct archive_read_ b += nl; if (avail && uuchar[*b]) return (firstline+30); - } - if (l == 13) { + } else if (l == 13) { + /* "begin-base64 " */ while (len-nl > 0) { if (!base64[*b++]) return (0); Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_xz.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Sun Dec 4 00:00:56 2016 (r309519) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include <lzma.h> -#elif HAVE_LZMADEC_H -#include <lzmadec.h> #endif #include "archive.h" @@ -82,19 +80,6 @@ static ssize_t xz_filter_read(struct arc static int xz_filter_close(struct archive_read_filter *); static int xz_lzma_bidder_init(struct archive_read_filter *); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -struct private_data { - lzmadec_stream stream; - unsigned char *out_block; - size_t out_block_size; - int64_t total_out; - char eof; /* True = found end of compressed data. */ -}; - -/* Lzma-only filter */ -static ssize_t lzma_filter_read(struct archive_read_filter *, const void **); -static int lzma_filter_close(struct archive_read_filter *); #endif /* @@ -178,8 +163,6 @@ archive_read_support_filter_lzma(struct bidder->free = NULL; #if HAVE_LZMA_H && HAVE_LIBLZMA return (ARCHIVE_OK); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, "Using external lzma program for lzma decompression"); @@ -763,175 +746,6 @@ xz_filter_close(struct archive_read_filt #else -#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -/* - * If we have the older liblzmadec library, then we can handle - * LZMA streams but not XZ streams. - */ - -/* - * Setup the callbacks. - */ -static int -lzma_bidder_init(struct archive_read_filter *self) -{ - static const size_t out_block_size = 64 * 1024; - void *out_block; - struct private_data *state; - ssize_t ret, avail_in; - - self->code = ARCHIVE_FILTER_LZMA; - self->name = "lzma"; - - state = (struct private_data *)calloc(sizeof(*state), 1); - out_block = (unsigned char *)malloc(out_block_size); - if (state == NULL || out_block == NULL) { - archive_set_error(&self->archive->archive, ENOMEM, - "Can't allocate data for lzma decompression"); - free(out_block); - free(state); - return (ARCHIVE_FATAL); - } - - self->data = state; - state->out_block_size = out_block_size; - state->out_block = out_block; - self->read = lzma_filter_read; - self->skip = NULL; /* not supported */ - self->close = lzma_filter_close; - - /* Prime the lzma library with 18 bytes of input. */ - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 18, &avail_in); - if (state->stream.next_in == NULL) - return (ARCHIVE_FATAL); - state->stream.avail_in = avail_in; - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Initialize compression library. */ - ret = lzmadec_init(&(state->stream)); - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - if (ret == LZMADEC_OK) - return (ARCHIVE_OK); - - /* Library setup failed: Clean up. */ - archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, - "Internal error initializing lzma library"); - - /* Override the error message if we know what really went wrong. */ - switch (ret) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&self->archive->archive, ENOMEM, - "Internal error initializing compression library: " - "out of memory"); - break; - } - - free(state->out_block); - free(state); - self->data = NULL; - return (ARCHIVE_FATAL); -} - -/* - * Return the next block of decompressed data. - */ -static ssize_t -lzma_filter_read(struct archive_read_filter *self, const void **p) -{ - struct private_data *state; - size_t decompressed; - ssize_t avail_in, ret; - - state = (struct private_data *)self->data; - - /* Empty our output buffer. */ - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Try to fill the output buffer. */ - while (state->stream.avail_out > 0 && !state->eof) { - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 1, &avail_in); - if (state->stream.next_in == NULL && avail_in < 0) { - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "truncated lzma input"); - return (ARCHIVE_FATAL); - } - state->stream.avail_in = avail_in; - - /* Decompress as much as we can in one pass. */ - ret = lzmadec_decode(&(state->stream), avail_in == 0); - switch (ret) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - state->eof = 1; - /* FALL THROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - break; - case LZMADEC_BUF_ERROR: /* Insufficient input data? */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Insufficient compressed data"); - return (ARCHIVE_FATAL); - default: - /* Return an error. */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Lzma decompression failed"); - return (ARCHIVE_FATAL); - } - } - - decompressed = state->stream.next_out - state->out_block; - state->total_out += decompressed; - if (decompressed == 0) - *p = NULL; - else - *p = state->out_block; - return (decompressed); -} - -/* - * Clean up the decompressor. - */ -static int -lzma_filter_close(struct archive_read_filter *self) -{ - struct private_data *state; - int ret; - - state = (struct private_data *)self->data; - ret = ARCHIVE_OK; - switch (lzmadec_end(&(state->stream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(self->archive->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up %s compressor", - self->archive->archive.compression_name); - ret = ARCHIVE_FATAL; - } - - free(state->out_block); - free(state); - return (ret); -} - -#else - /* * * If we have no suitable library on this system, we can't actually do @@ -953,9 +767,6 @@ lzma_bidder_init(struct archive_read_fil return (r); } -#endif /* HAVE_LZMADEC_H */ - - static int xz_bidder_init(struct archive_read_filter *self) { @@ -984,5 +795,4 @@ lzip_bidder_init(struct archive_read_fil return (r); } - #endif /* HAVE_LZMA_H */ Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_cab.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_cab.c Sun Dec 4 00:00:56 2016 (r309519) @@ -645,12 +645,13 @@ cab_read_header(struct archive_read *a) cab = (struct cab *)(a->format->data); if (cab->found_header == 0 && p[0] == 'M' && p[1] == 'Z') { - /* This is an executable? Must be self-extracting... */ + /* This is an executable? Must be self-extracting... */ err = cab_skip_sfx(a); if (err < ARCHIVE_WARN) return (err); - if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL) + /* Re-read header after processing the SFX. */ + if ((p = __archive_read_ahead(a, 42, NULL)) == NULL) return (truncated_error(a)); } Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Dec 4 00:00:56 2016 (r309519) @@ -75,6 +75,8 @@ __FBSDID("$FreeBSD$"); #define MTREE_HAS_OPTIONAL 0x0800 #define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ +#define MTREE_HASHTABLE_SIZE 1024 + struct mtree_option { struct mtree_option *next; char *value; @@ -86,6 +88,8 @@ struct mtree_entry { char *name; char full; char used; + unsigned int name_hash; + struct mtree_entry *hashtable_next; }; struct mtree { @@ -98,6 +102,7 @@ struct mtree { const char *archive_format_name; struct mtree_entry *entries; struct mtree_entry *this_entry; + struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE]; struct archive_string current_dir; struct archive_string contents_name; @@ -110,6 +115,7 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int detect_form(struct archive_read *, int *); +static unsigned int hash(const char *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -862,11 +868,12 @@ process_add_entry(struct archive_read *a struct mtree_option **global, const char *line, ssize_t line_len, struct mtree_entry **last_entry, int is_form_d) { - struct mtree_entry *entry; + struct mtree_entry *entry, *ht_iter; struct mtree_option *iter; const char *next, *eq, *name, *end; size_t name_len, len; int r, i; + unsigned int ht_idx; if ((entry = malloc(sizeof(*entry))) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); @@ -877,6 +884,8 @@ process_add_entry(struct archive_read *a entry->name = NULL; entry->used = 0; entry->full = 0; + entry->name_hash = 0; + entry->hashtable_next = NULL; /* Add this entry to list. */ if (*last_entry == NULL) @@ -929,6 +938,16 @@ process_add_entry(struct archive_read *a memcpy(entry->name, name, name_len); entry->name[name_len] = '\0'; parse_escapes(entry->name, entry); + entry->name_hash = hash(entry->name); + + ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE; + if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) { + while (ht_iter->hashtable_next) + ht_iter = ht_iter->hashtable_next; + ht_iter->hashtable_next = entry; + } else { + mtree->entry_hashtable[ht_idx] = entry; + } for (iter = *global; iter != NULL; iter = iter->next) { r = add_option(a, &entry->options, iter->value, @@ -1122,9 +1141,10 @@ parse_file(struct archive_read *a, struc * with pathname canonicalization, which is a very * tricky subject.) */ - for (mp = mentry->next; mp != NULL; mp = mp->next) { + for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) { if (mp->full && !mp->used - && strcmp(mentry->name, mp->name) == 0) { + && mentry->name_hash == mp->name_hash + && strcmp(mentry->name, mp->name) == 0) { /* Later lines override earlier ones. */ mp->used = 1; r1 = parse_line(a, entry, mtree, mp, @@ -2000,3 +2020,19 @@ readline(struct archive_read *a, struct find_off = u - mtree->line.s; } } + +static unsigned int +hash(const char *p) +{ + /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm, + as used by ELF for hashing function names. */ + unsigned g, h = 0; + while (*p != '\0') { + h = (h << 4) + *p++; + if ((g = h & 0xF0000000) != 0) { + h ^= g >> 24; + h &= 0x0FFFFFFF; + } + } + return h; +} Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Dec 4 00:00:56 2016 (r309519) @@ -294,6 +294,54 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +/* + * Validate number field + * + * This has to be pretty lenient in order to accomodate the enormous + * variety of tar writers in the world: + * = POSIX ustar requires octal values with leading zeros and + * specific termination on fields + * = Many writers use different termination (in particular, libarchive + * omits terminator bytes to squeeze one or two more digits) + * = Many writers pad with space and omit leading zeros + * = GNU tar and star write base-256 values if numbers are too + * big to be represented in octal + * + * This should tolerate all variants in use. It will reject a field + * where the writer just left garbage after a trailing NUL. + */ +static int +validate_number_field(const char* p_field, size_t i_size) +{ + unsigned char marker = (unsigned char)p_field[0]; + if (marker == 128 || marker == 255 || marker == 0) { + /* Base-256 marker, there's nothing we can check. */ + return 1; + } else { + /* Must be octal */ + size_t i = 0; + /* Skip any leading spaces */ + while (i < i_size && p_field[i] == ' ') { + ++i; + } + /* Must be at least one octal digit. */ + if (i >= i_size || p_field[i] < '0' || p_field[i] > '7') { + return 0; + } + /* Skip remaining octal digits. */ + while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') { + ++i; + } + /* Any remaining characters must be space or NUL padding. */ + while (i < i_size) { + if (p_field[i] != ' ' && p_field[i] != 0) { + return 0; + } + ++i; + } + return 1; + } +} static int archive_read_format_tar_bid(struct archive_read *a, int best_bid) @@ -346,23 +394,19 @@ archive_read_format_tar_bid(struct archi return (0); bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ - /* Sanity check: Look at first byte of mode field. */ - switch (255 & (unsigned)header->mode[0]) { - case 0: case 255: - /* Base-256 value: No further verification possible! */ - break; - case ' ': /* Not recommended, but not illegal, either. */ - break; - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - /* Octal Value. */ - /* TODO: Check format of remainder of this field. */ - break; - default: - /* Not a valid mode; bail out here. */ - return (0); + /* + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. + */ + if (bid > 0 && ( + validate_number_field(header->mode, sizeof(header->mode)) == 0 + || validate_number_field(header->uid, sizeof(header->uid)) == 0 + || validate_number_field(header->gid, sizeof(header->gid)) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime)) == 0 + || validate_number_field(header->size, sizeof(header->size)) == 0 + || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 + || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { + bid = 0; } - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ return (bid); } Modified: projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_xar.c ============================================================================== --- projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sat Dec 3 21:56:46 2016 (r309518) +++ projects/clang391-import/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Dec 4 00:00:56 2016 (r309519) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include <lzma.h> -#elif HAVE_LZMADEC_H -#include <lzmadec.h> #endif #ifdef HAVE_ZLIB_H #include <zlib.h> @@ -334,9 +332,6 @@ struct xar { #if HAVE_LZMA_H && HAVE_LIBLZMA lzma_stream lzstream; int lzstream_valid; -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - lzmadec_stream lzstream; - int lzstream_valid; #endif /* * For Checksum data. @@ -1526,34 +1521,6 @@ decompression_init(struct archive_read * xar->lzstream.total_in = 0; xar->lzstream.total_out = 0; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - if (xar->lzstream_valid) - lzmadec_end(&(xar->lzstream)); - r = lzmadec_init(&(xar->lzstream)); - if (r != LZMADEC_OK) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612040000.uB400uxA087619>