From owner-svn-src-user@freebsd.org Sun Dec 20 05:21:00 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C02A4DFE9 for ; Sun, 20 Dec 2015 05:21:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E00121725; Sun, 20 Dec 2015 05:20:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK5Kxeb095596; Sun, 20 Dec 2015 05:20:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK5Krq8095533; Sun, 20 Dec 2015 05:20:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200520.tBK5Krq8095533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 05:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292498 - in user/ngie/make_check: bin/ed contrib/openbsm contrib/openbsm/bin contrib/openbsm/bin/audit contrib/openbsm/bin/auditd contrib/openbsm/bin/auditdistd contrib/openbsm/bin/aud... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:21:00 -0000 Author: ngie Date: Sun Dec 20 05:20:52 2015 New Revision: 292498 URL: https://svnweb.freebsd.org/changeset/base/292498 Log: MFhead @ r292497 Added: user/ngie/make_check/contrib/openbsm/.travis.yml - copied unchanged from r292497, head/contrib/openbsm/.travis.yml user/ngie/make_check/contrib/openbsm/libbsm/au_notify.3 - copied unchanged from r292497, head/contrib/openbsm/libbsm/au_notify.3 user/ngie/make_check/lib/libstand/uuid_from_string.c - copied unchanged from r292497, head/lib/libstand/uuid_from_string.c user/ngie/make_check/lib/libstand/uuid_to_string.c - copied unchanged from r292497, head/lib/libstand/uuid_to_string.c user/ngie/make_check/lib/msun/tests/ctrig_test.c - copied unchanged from r292497, head/lib/msun/tests/ctrig_test.c user/ngie/make_check/lib/msun/tests/exponential_test.c - copied unchanged from r292497, head/lib/msun/tests/exponential_test.c user/ngie/make_check/lib/msun/tests/fma_test.c - copied unchanged from r292497, head/lib/msun/tests/fma_test.c user/ngie/make_check/lib/msun/tests/invtrig_test.c - copied unchanged from r292497, head/lib/msun/tests/invtrig_test.c user/ngie/make_check/lib/msun/tests/lround_test.c - copied unchanged from r292497, head/lib/msun/tests/lround_test.c user/ngie/make_check/lib/msun/tests/lround_test.t - copied unchanged from r292497, head/lib/msun/tests/lround_test.t user/ngie/make_check/lib/msun/tests/test-utils.h - copied unchanged from r292497, head/lib/msun/tests/test-utils.h user/ngie/make_check/sys/arm/arm/machdep_intr.c - copied unchanged from r292497, head/sys/arm/arm/machdep_intr.c user/ngie/make_check/sys/geom/sched/gs_delay.c - copied unchanged from r292497, head/sys/geom/sched/gs_delay.c user/ngie/make_check/sys/kern/pic_if.m - copied unchanged from r292497, head/sys/kern/pic_if.m user/ngie/make_check/sys/kern/subr_intr.c - copied unchanged from r292497, head/sys/kern/subr_intr.c user/ngie/make_check/sys/modules/geom/geom_sched/gsched_delay/ - copied from r292497, head/sys/modules/geom/geom_sched/gsched_delay/ user/ngie/make_check/sys/riscv/ - copied from r292497, head/sys/riscv/ Deleted: user/ngie/make_check/sys/arm/arm/intrng.c user/ngie/make_check/sys/arm/arm/pic_if.m user/ngie/make_check/tools/regression/lib/msun/ Modified: user/ngie/make_check/bin/ed/main.c user/ngie/make_check/contrib/openbsm/INSTALL user/ngie/make_check/contrib/openbsm/LICENSE user/ngie/make_check/contrib/openbsm/Makefile.am user/ngie/make_check/contrib/openbsm/Makefile.in user/ngie/make_check/contrib/openbsm/NEWS user/ngie/make_check/contrib/openbsm/README user/ngie/make_check/contrib/openbsm/TODO user/ngie/make_check/contrib/openbsm/VERSION user/ngie/make_check/contrib/openbsm/autogen.sh user/ngie/make_check/contrib/openbsm/bin/Makefile.am user/ngie/make_check/contrib/openbsm/bin/audit/Makefile.am user/ngie/make_check/contrib/openbsm/bin/audit/audit.8 user/ngie/make_check/contrib/openbsm/bin/audit/audit.c user/ngie/make_check/contrib/openbsm/bin/auditd/Makefile.am user/ngie/make_check/contrib/openbsm/bin/auditd/audit_triggers.defs user/ngie/make_check/contrib/openbsm/bin/auditd/audit_warn.c user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.8 user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.c user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.h user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_control.defs user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_darwin.c user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_fbsd.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/Makefile.am user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.8 user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/faccessat.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/fstatat.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/openat.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/parse.y user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_common.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_impl.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_socketpair.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tcp.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tls.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_uds.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/receiver.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/renameat.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/sender.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/sigtimedwait.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/strndup.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/synch.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/token.l user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.c user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.h user/ngie/make_check/contrib/openbsm/bin/auditdistd/unlinkat.h user/ngie/make_check/contrib/openbsm/bin/auditfilterd/Makefile.am user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd.8 user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd.c user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd.h user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c user/ngie/make_check/contrib/openbsm/bin/auditreduce/Makefile.am user/ngie/make_check/contrib/openbsm/bin/auditreduce/auditreduce.1 user/ngie/make_check/contrib/openbsm/bin/auditreduce/auditreduce.c user/ngie/make_check/contrib/openbsm/bin/auditreduce/auditreduce.h user/ngie/make_check/contrib/openbsm/bin/praudit/Makefile.am user/ngie/make_check/contrib/openbsm/bin/praudit/praudit.1 user/ngie/make_check/contrib/openbsm/bin/praudit/praudit.c user/ngie/make_check/contrib/openbsm/bsm/Makefile.am user/ngie/make_check/contrib/openbsm/bsm/audit_filter.h user/ngie/make_check/contrib/openbsm/bsm/audit_uevents.h user/ngie/make_check/contrib/openbsm/bsm/auditd_lib.h user/ngie/make_check/contrib/openbsm/bsm/libbsm.h user/ngie/make_check/contrib/openbsm/compat/clock_gettime.h user/ngie/make_check/contrib/openbsm/compat/closefrom.h user/ngie/make_check/contrib/openbsm/compat/compat.h user/ngie/make_check/contrib/openbsm/compat/endian.h user/ngie/make_check/contrib/openbsm/compat/endian_enc.h user/ngie/make_check/contrib/openbsm/compat/flopen.h user/ngie/make_check/contrib/openbsm/compat/pidfile.h user/ngie/make_check/contrib/openbsm/compat/queue.h user/ngie/make_check/contrib/openbsm/compat/strlcat.h user/ngie/make_check/contrib/openbsm/compat/strlcpy.h user/ngie/make_check/contrib/openbsm/config/config.h user/ngie/make_check/contrib/openbsm/configure user/ngie/make_check/contrib/openbsm/configure.ac user/ngie/make_check/contrib/openbsm/etc/audit_class user/ngie/make_check/contrib/openbsm/etc/audit_control user/ngie/make_check/contrib/openbsm/etc/audit_event user/ngie/make_check/contrib/openbsm/etc/audit_filter user/ngie/make_check/contrib/openbsm/etc/audit_user user/ngie/make_check/contrib/openbsm/etc/audit_warn user/ngie/make_check/contrib/openbsm/libauditd/Makefile.am user/ngie/make_check/contrib/openbsm/libauditd/auditd_lib.c user/ngie/make_check/contrib/openbsm/libauditd/libauditd.3 user/ngie/make_check/contrib/openbsm/libbsm/Makefile.am user/ngie/make_check/contrib/openbsm/libbsm/Makefile.in user/ngie/make_check/contrib/openbsm/libbsm/au_class.3 user/ngie/make_check/contrib/openbsm/libbsm/au_control.3 user/ngie/make_check/contrib/openbsm/libbsm/au_domain.3 user/ngie/make_check/contrib/openbsm/libbsm/au_errno.3 user/ngie/make_check/contrib/openbsm/libbsm/au_event.3 user/ngie/make_check/contrib/openbsm/libbsm/au_fcntl_cmd.3 user/ngie/make_check/contrib/openbsm/libbsm/au_free_token.3 user/ngie/make_check/contrib/openbsm/libbsm/au_io.3 user/ngie/make_check/contrib/openbsm/libbsm/au_mask.3 user/ngie/make_check/contrib/openbsm/libbsm/au_open.3 user/ngie/make_check/contrib/openbsm/libbsm/au_socket_type.3 user/ngie/make_check/contrib/openbsm/libbsm/au_token.3 user/ngie/make_check/contrib/openbsm/libbsm/au_user.3 user/ngie/make_check/contrib/openbsm/libbsm/audit_submit.3 user/ngie/make_check/contrib/openbsm/libbsm/bsm_audit.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_class.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_control.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_domain.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_errno.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_event.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_fcntl.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_flags.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_io.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_mask.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_notify.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_socket_type.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_token.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_user.c user/ngie/make_check/contrib/openbsm/libbsm/bsm_wrappers.c user/ngie/make_check/contrib/openbsm/libbsm/libbsm.3 user/ngie/make_check/contrib/openbsm/man/Makefile.am user/ngie/make_check/contrib/openbsm/man/Makefile.in user/ngie/make_check/contrib/openbsm/man/audit.2 user/ngie/make_check/contrib/openbsm/man/audit.log.5 user/ngie/make_check/contrib/openbsm/man/audit_class.5 user/ngie/make_check/contrib/openbsm/man/audit_control.5 user/ngie/make_check/contrib/openbsm/man/audit_event.5 user/ngie/make_check/contrib/openbsm/man/audit_user.5 user/ngie/make_check/contrib/openbsm/man/audit_warn.5 user/ngie/make_check/contrib/openbsm/man/auditctl.2 user/ngie/make_check/contrib/openbsm/man/auditon.2 user/ngie/make_check/contrib/openbsm/man/getaudit.2 user/ngie/make_check/contrib/openbsm/man/getauid.2 user/ngie/make_check/contrib/openbsm/man/setaudit.2 user/ngie/make_check/contrib/openbsm/man/setauid.2 user/ngie/make_check/contrib/openbsm/modules/Makefile.am user/ngie/make_check/contrib/openbsm/modules/auditfilter_noop/Makefile.am user/ngie/make_check/contrib/openbsm/modules/auditfilter_noop/auditfilter_noop.c user/ngie/make_check/contrib/openbsm/sys/Makefile.am user/ngie/make_check/contrib/openbsm/sys/bsm/Makefile.am user/ngie/make_check/contrib/openbsm/sys/bsm/audit.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_domain.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_errno.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_fcntl.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_internal.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_kevents.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_record.h user/ngie/make_check/contrib/openbsm/sys/bsm/audit_socket_type.h user/ngie/make_check/contrib/openbsm/test/Makefile.am user/ngie/make_check/contrib/openbsm/test/bsm/Makefile.am user/ngie/make_check/contrib/openbsm/test/bsm/generate.c user/ngie/make_check/contrib/openbsm/tools/Makefile.am user/ngie/make_check/contrib/openbsm/tools/audump.c user/ngie/make_check/crypto/openssh/digest-libc.c user/ngie/make_check/etc/mtree/BSD.usr.dist user/ngie/make_check/include/netdb.h user/ngie/make_check/lib/libbsm/Makefile user/ngie/make_check/lib/libc/net/getaddrinfo.3 user/ngie/make_check/lib/libc/net/getaddrinfo.c user/ngie/make_check/lib/libstand/Makefile user/ngie/make_check/lib/msun/tests/Makefile user/ngie/make_check/libexec/rtld-elf/rtld.c user/ngie/make_check/share/colldef/Makefile user/ngie/make_check/share/ctypedef/Makefile user/ngie/make_check/share/examples/tests/tests/atf/printf_test.c user/ngie/make_check/share/man/man4/ioat.4 user/ngie/make_check/share/man/man9/Makefile user/ngie/make_check/share/man/man9/zone.9 user/ngie/make_check/share/monetdef/Makefile user/ngie/make_check/share/msgdef/Makefile user/ngie/make_check/share/numericdef/Makefile user/ngie/make_check/share/timedef/Makefile user/ngie/make_check/sys/amd64/amd64/machdep.c user/ngie/make_check/sys/arm/allwinner/a20/a20_mp.c user/ngie/make_check/sys/arm/altera/socfpga/socfpga_mp.c user/ngie/make_check/sys/arm/amlogic/aml8726/aml8726_mp.c user/ngie/make_check/sys/arm/annapurna/alpine/alpine_machdep_mp.c user/ngie/make_check/sys/arm/arm/exception.S user/ngie/make_check/sys/arm/arm/gic.c user/ngie/make_check/sys/arm/arm/intr.c user/ngie/make_check/sys/arm/arm/mp_machdep.c user/ngie/make_check/sys/arm/arm/nexus.c user/ngie/make_check/sys/arm/broadcom/bcm2835/bcm2835_fbd.c user/ngie/make_check/sys/arm/freescale/imx/imx6_mp.c user/ngie/make_check/sys/arm/freescale/imx/imx_gpio.c user/ngie/make_check/sys/arm/freescale/imx/imx_sdhci.c user/ngie/make_check/sys/arm/include/intr.h user/ngie/make_check/sys/arm/include/smp.h user/ngie/make_check/sys/arm/qemu/virt_mp.c user/ngie/make_check/sys/arm/rockchip/rk30xx_mp.c user/ngie/make_check/sys/arm/samsung/exynos/exynos5_mp.c user/ngie/make_check/sys/arm/ti/aintc.c user/ngie/make_check/sys/arm/ti/omap4/omap4_mp.c user/ngie/make_check/sys/arm/xilinx/zy7_mp.c user/ngie/make_check/sys/arm64/include/ofw_machdep.h user/ngie/make_check/sys/boot/efi/loader/bootinfo.c user/ngie/make_check/sys/boot/i386/libi386/biosmem.c user/ngie/make_check/sys/conf/Makefile.mips user/ngie/make_check/sys/conf/files.arm user/ngie/make_check/sys/conf/kern.mk user/ngie/make_check/sys/conf/kmod.mk user/ngie/make_check/sys/dev/drm2/i915/intel_iic.c user/ngie/make_check/sys/dev/drm2/ttm/ttm_bo.c user/ngie/make_check/sys/dev/drm2/ttm/ttm_page_alloc.c user/ngie/make_check/sys/dev/if_ndis/if_ndis_pci.c user/ngie/make_check/sys/dev/ioat/ioat.c user/ngie/make_check/sys/dev/ioat/ioat.h user/ngie/make_check/sys/dev/ioat/ioat_hw.h user/ngie/make_check/sys/dev/mmc/mmc.c user/ngie/make_check/sys/dev/nand/nand_cdev.c user/ngie/make_check/sys/dev/nand/nand_geom.c user/ngie/make_check/sys/dev/ofw/ofw_bus_subr.c user/ngie/make_check/sys/dev/ofw/ofw_bus_subr.h user/ngie/make_check/sys/kern/kern_mbuf.c user/ngie/make_check/sys/kern/kern_proc.c user/ngie/make_check/sys/mips/include/pmap.h user/ngie/make_check/sys/mips/mips/pmap.c user/ngie/make_check/sys/mips/mips/uma_machdep.c user/ngie/make_check/sys/modules/geom/geom_sched/Makefile user/ngie/make_check/sys/net/if.c user/ngie/make_check/sys/net/if_lagg.c user/ngie/make_check/sys/net/if_lagg.h user/ngie/make_check/sys/net/if_var.h user/ngie/make_check/sys/netinet/if_ether.c user/ngie/make_check/sys/netinet/if_ether.h user/ngie/make_check/sys/netinet/in_var.h user/ngie/make_check/sys/netinet/ip_carp.c user/ngie/make_check/sys/netinet6/in6.c user/ngie/make_check/sys/netinet6/in6_var.h user/ngie/make_check/sys/netinet6/nd6.c user/ngie/make_check/sys/netinet6/nd6.h user/ngie/make_check/sys/netinet6/nd6_nbr.c user/ngie/make_check/sys/powerpc/conf/GENERIC64 user/ngie/make_check/sys/powerpc/pseries/phyp_llan.c user/ngie/make_check/sys/sys/efi.h user/ngie/make_check/sys/sys/linker.h user/ngie/make_check/sys/sys/proc.h user/ngie/make_check/sys/vm/device_pager.c user/ngie/make_check/sys/vm/sg_pager.c user/ngie/make_check/sys/vm/uma.h user/ngie/make_check/sys/vm/uma_core.c user/ngie/make_check/sys/vm/uma_int.h user/ngie/make_check/sys/vm/vm_kern.c user/ngie/make_check/sys/vm/vm_page.c user/ngie/make_check/sys/vm/vm_page.h user/ngie/make_check/sys/vm/vm_pageout.c user/ngie/make_check/sys/vm/vm_pageout.h user/ngie/make_check/sys/vm/vm_phys.c user/ngie/make_check/sys/vm/vm_phys.h user/ngie/make_check/sys/vm/vm_reserv.c user/ngie/make_check/sys/vm/vm_reserv.h user/ngie/make_check/sys/x86/x86/identcpu.c user/ngie/make_check/tools/tools/locale/tools/cldr2def.pl user/ngie/make_check/tools/tools/locale/tools/finalize (contents, props changed) user/ngie/make_check/usr.bin/calendar/calendars/calendar.freebsd user/ngie/make_check/usr.sbin/boot0cfg/boot0cfg.c user/ngie/make_check/usr.sbin/ndp/ndp.c user/ngie/make_check/usr.sbin/ypserv/Makefile.yp Directory Properties: user/ngie/make_check/ (props changed) user/ngie/make_check/contrib/openbsm/ (props changed) user/ngie/make_check/crypto/openssh/ (props changed) user/ngie/make_check/include/ (props changed) user/ngie/make_check/lib/libc/ (props changed) user/ngie/make_check/share/ (props changed) user/ngie/make_check/share/man/man4/ (props changed) user/ngie/make_check/sys/ (props changed) user/ngie/make_check/sys/boot/ (props changed) user/ngie/make_check/sys/conf/ (props changed) user/ngie/make_check/usr.bin/calendar/ (props changed) Modified: user/ngie/make_check/bin/ed/main.c ============================================================================== --- user/ngie/make_check/bin/ed/main.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/bin/ed/main.c Sun Dec 20 05:20:52 2015 (r292498) @@ -505,7 +505,8 @@ exec_command(void) return ERR; else if (open_sbuf() < 0) return FATAL; - if (*fnp && *fnp != '!') strcpy(old_filename, fnp); + if (*fnp && *fnp != '!') + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -532,7 +533,8 @@ exec_command(void) return ERR; } GET_COMMAND_SUFFIX(); - if (*fnp) strcpy(old_filename, fnp); + if (*fnp) + strlcpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -663,7 +665,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -797,7 +799,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; Copied: user/ngie/make_check/contrib/openbsm/.travis.yml (from r292497, head/contrib/openbsm/.travis.yml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ngie/make_check/contrib/openbsm/.travis.yml Sun Dec 20 05:20:52 2015 (r292498, copy of r292497, head/contrib/openbsm/.travis.yml) @@ -0,0 +1,18 @@ +language: c + +compiler: + - clang + - gcc + +os: + - linux + - osx + +before_install: + - if [ $TRAVIS_OS_NAME == "linux" ]; then + sudo apt-get -qq update; + sudo apt-get -qq install byacc flex; + elif [ $TRAVIS_OS_NAME == "osx" ]; then + brew update; + brew install byacc flex; + fi Modified: user/ngie/make_check/contrib/openbsm/INSTALL ============================================================================== --- user/ngie/make_check/contrib/openbsm/INSTALL Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/INSTALL Sun Dec 20 05:20:52 2015 (r292498) @@ -3,7 +3,7 @@ OpenBSM Build and Installation Instructi OpenBSM is currently built using autoconf and automake, which should allow for building on a range of operating systems, including FreeBSD, Mac OS X, and Linux. Some components are built only if appropriate kernel audit -suppport is found. Typical builds will be performed using: +support is found. Typical builds will be performed using: ./configure make @@ -31,7 +31,7 @@ not configurable. You may wish to specify that the OpenBSM components not be installed in the base system, rather in a specific directory. This may be done using the --prefix argument to configure. If installing to a specific directory, -remember to update your library path so that running tools from that +remember to update your library path so that when running tools from that directory the correct libbsm is used: ./configure --prefix=/home/rwatson/openbsm Modified: user/ngie/make_check/contrib/openbsm/LICENSE ============================================================================== --- user/ngie/make_check/contrib/openbsm/LICENSE Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/LICENSE Sun Dec 20 05:20:52 2015 (r292498) @@ -34,5 +34,3 @@ as a whole: The TrustedBSD Project would appreciate the contribution of fixes and enhancements under an identical license in order to avoid potentially confusing license proliferation. - -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: user/ngie/make_check/contrib/openbsm/Makefile.am ============================================================================== --- user/ngie/make_check/contrib/openbsm/Makefile.am Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/Makefile.am Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ -## - SUBDIRS = \ bsm Modified: user/ngie/make_check/contrib/openbsm/Makefile.in ============================================================================== --- user/ngie/make_check/contrib/openbsm/Makefile.in Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/Makefile.in Sun Dec 20 05:20:52 2015 (r292498) @@ -59,9 +59,9 @@ DIST_COMMON = README $(am__configure_dep $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ - NEWS TODO config/config.guess config/config.sub config/depcomp \ - config/install-sh config/ltmain.sh config/missing \ - config/ylwrap + NEWS TODO config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/ltmain.sh \ + config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ Modified: user/ngie/make_check/contrib/openbsm/NEWS ============================================================================== --- user/ngie/make_check/contrib/openbsm/NEWS Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/NEWS Sun Dec 20 05:20:52 2015 (r292498) @@ -1,5 +1,16 @@ OpenBSM Version History +OpenBSM 1.2 alpha 4 + +- Fix praudit to emit correct XML. +- Fix auditdistd bugs related to IPv6 support, locking, and a kqueue-related + descriptor leak. +- Add audit event definitions for Capsicum-related syscalls, as well as + AUE_BINDAT and AUE_CONNECTAT. +- Manpage symlinks for all libbsm functions are installed again after the + move to autotools in OpenBSM 1.0 Alpha 5. +- A variety of minor documentation cleanups. + OpenBSM 1.2 alpha 3 - Various minor tweaks to the auditdistd build to make it fit the FreeBSD @@ -494,5 +505,3 @@ OpenBSM 1.0 alpha 1 - auditd(8), audit(8) added to the OpenBSM distribution. auditd extended to support reloading of kernel event table. - Allow comments in /etc/security configuration files. - -$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: user/ngie/make_check/contrib/openbsm/README ============================================================================== --- user/ngie/make_check/contrib/openbsm/README Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/README Sun Dec 20 05:20:52 2015 (r292498) @@ -1,4 +1,4 @@ -OpenBSM 1.2a2 +OpenBSM Introduction @@ -10,7 +10,7 @@ of several organizations. OpenBSM includes several command line tools, including auditreduce(8) and praudit(8) for reducing and printing audit trails, as well as the libbsm(3) library to manage configuration files, generate audit records, and parse and -print audit trils. +print audit trails. Coupled with a kernel audit implementation, OpenBSM can be used to maintain system audit streams, and is a foundation for a full audit-enabled system. @@ -64,5 +64,3 @@ Information on OpenBSM may be found on t Information on TrustedBSD may be found on the TrustedBSD home page: http://www.TrustedBSD.org/ - -$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: user/ngie/make_check/contrib/openbsm/TODO ============================================================================== --- user/ngie/make_check/contrib/openbsm/TODO Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/TODO Sun Dec 20 05:20:52 2015 (r292498) @@ -7,8 +7,6 @@ OpenBSM TODO - Document contents of libbsm "public" data structures in libbsm man pages. - The audit.log.5 man page is incomplete, as it does not describe all token types. -- With the move to autoconf/automake, man page symlinks are no longer - installed. This needs to be fixed. - It might be desirable to be able to provide EOPNOTSUPP system call stubs on systems that don't have the necessary audit system calls; that would allow the full libbsm and tool set to build, just not run. @@ -23,5 +21,3 @@ OpenBSM TODO not available on the local OS platform. - Support for client certificates in auditdistd, to include certificate chain validation. - -$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: user/ngie/make_check/contrib/openbsm/VERSION ============================================================================== --- user/ngie/make_check/contrib/openbsm/VERSION Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/VERSION Sun Dec 20 05:20:52 2015 (r292498) @@ -1 +1 @@ -OPENBSM_1_2_alpha3 +OPENBSM_1_2_alpha4 Modified: user/ngie/make_check/contrib/openbsm/autogen.sh ============================================================================== --- user/ngie/make_check/contrib/openbsm/autogen.sh Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/autogen.sh Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,4 @@ #!/bin/sh -# -# $P4: //depot/projects/trustedbsd/openbsm/autogen.sh#2 $ -# libtoolize --copy --force aclocal Modified: user/ngie/make_check/contrib/openbsm/bin/Makefile.am ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/Makefile.am Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/Makefile.am Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/Makefile.am#4 $ -## - SUBDIRS = \ auditdistd \ auditfilterd \ Modified: user/ngie/make_check/contrib/openbsm/bin/audit/Makefile.am ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/audit/Makefile.am Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/audit/Makefile.am Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/audit/Makefile.am#7 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: user/ngie/make_check/contrib/openbsm/bin/audit/audit.8 ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/audit/audit.8 Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/audit/audit.8 Sun Dec 20 05:20:52 2015 (r292498) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.8#16 $ -.\" -.Dd January 29, 2009 +.Dd July 25, 2015 .Dt AUDIT 8 .Os .Sh NAME @@ -88,7 +86,7 @@ Audit policy file used to configure the .Xr audit 4 , .Xr audit_control 5 , .Xr auditd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: user/ngie/make_check/contrib/openbsm/bin/audit/audit.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/audit/audit.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/audit/audit.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.c#15 $ */ /* * Program to trigger the audit daemon with a message that is either: Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/Makefile.am ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/Makefile.am Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/Makefile.am Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/Makefile.am#6 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/audit_triggers.defs ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/audit_triggers.defs Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/audit_triggers.defs Sun Dec 20 05:20:52 2015 (r292498) @@ -1,5 +1 @@ -/* - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_triggers.defs#1 $ - */ - #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/audit_warn.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/audit_warn.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/audit_warn.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#11 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.8 ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.8 Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.8 Sun Dec 20 05:20:52 2015 (r292498) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ -.\" -.Dd December 11, 2008 +.Dd July 25, 2015 .Dt AUDITD 8 .Os .Sh NAME @@ -123,7 +121,7 @@ and are no longer available as arguments .Xr audit_warn 5 , .Xr audit 8 , .Xr auditdistd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#50 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/auditd.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#13 $ */ #ifndef _AUDITD_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_control.defs ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_control.defs Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_control.defs Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_control.defs#2 $ */ /* Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_darwin.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_darwin.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_darwin.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#5 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_fbsd.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditd/auditd_fbsd.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#4 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/Makefile.am ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/Makefile.am Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/Makefile.am Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/Makefile.am#1 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.8 ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.8 Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.8 Sun Dec 20 05:20:52 2015 (r292498) @@ -41,7 +41,7 @@ .Sh DESCRIPTION The .Nm -daemon is responsible for distributing audit trail files over TCP/IP network in +daemon is responsible for distributing audit trail files over a TCP/IP network in a secure and reliable way. .Pp The @@ -49,7 +49,7 @@ The daemon can be started with the following command line arguments: .Bl -tag -width ".Fl P Ar pidfile" .It Fl c Ar config -Specify alternative location of the configuration file. +Specify an alternative location of the configuration file. The default location is .Pa /etc/security/auditdistd.conf . Note: the configuration file may contain passwords. @@ -74,7 +74,7 @@ usage message. Start in a launchd-friendly mode, ie. do not use .Xr daemon 3 . .It Fl P Ar pidfile -Specify alternative location of a file where main process PID will be +Specify an alternative location of a file where main process PID will be stored. The default location is .Pa /var/run/auditdistd.pid . Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Sun Dec 20 05:20:52 2015 (r292498) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2011 +.Dd July 1, 2015 .Dt AUDITDISTD.CONF 5 .Os .Sh NAME @@ -37,19 +37,21 @@ daemon. .Sh DESCRIPTION Note: the configuration file may contain passwords. -Care should be taken to configure proper permissions on this file -.Li ( eg. 0600 ) . +Care should be taken to configure proper permissions for this file +.Li ( e.g., 0600 ) . .Pp -Every line starting with # is treated as comment and ignored. +Every line starting with +.Li # +gets treated as a comment and is ignored. .Sh CONFIGURATION FILE SYNTAX -General syntax of the +The general syntax of the .Nm -file is following: -.Bd -literal -offset +file is as follows: +.Bd -literal ## Global section. # Our name. -# The default is first part of the hostname. +# The default is the first part of the hostname. name "" # Connection timeout. @@ -71,11 +73,11 @@ sender { # The default is /var/audit/dist. directory "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" @@ -86,7 +88,7 @@ sender { # Optional. source "" - # Address of auditdistd receiver. + # Address of the auditdistd receiver. # No default. Obligatory. remote "" @@ -95,7 +97,7 @@ sender { directory "" # Fingerprint of the receiver's public key when using TLS - # for connection. + # for connections. # Example fingerprint: # SHA256=8F:0A:FC:8A:3D:09:80:AF:D9:AA:38:CC:8A:86:53:E6:8F:B6:1C:55:30:14:D7:F9:AA:8B:3E:73:CD:F5:76:2B fingerprint "" @@ -103,37 +105,37 @@ sender { # Password used to authenticate in front of the receiver. password "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" } - # Currently local audit trail files can be send only to one remote + # Currently local audit trail files can be sent only to one remote # auditdistd receiver, but this can change in the future. } receiver { ## Receiver section. - # Address to listen on. Multiple listen addresses might be specified. + # Address to listen on. Multiple listen addresses may be specified. # The defaults are "tcp4://0.0.0.0:7878" and "tcp6://[::]:7878". listen "" # Base directory. - # If directory in host section is no absolute, it will be concatenated - # with this base directory. + # If the directory in the host section is not absolute, it will be + # concatenated with this base directory. # The default is "/var/audit/remote". directory "" - # Path to receiver's certificate file. + # Path to the receiver's certificate file. # The default is "/etc/security/auditdistd.cert.pem". certfile "" - # Path to receiver's private key file. + # Path to the receiver's private key file. # The default is "/etc/security/auditdistd.key.pem". keyfile "" @@ -158,7 +160,7 @@ receiver { .Ed .Pp Most of the various available configuration parameters are optional. -If parameter is not defined in the particular section, it will be +If a parameter is not defined in the particular section, it will be inherited from the parent section if possible. For example, if the .Ic source @@ -172,14 +174,14 @@ In case the section does not define the .Ic source parameter at all, the default value will be used. -.Sh CONFIGURATION FILE DESCRIPTION +.Sh CONFIGURATION OPTION DESCRIPTION The following statements are available: .Bl -tag -width ".Ic xxxx" .It Ic name Aq name .Pp This host's name. -It is send to the receiver, so it can properly recognize us if there are -more than one sender coming from the same IP address. +It is sent to the receiver, so it can properly recognize us if there are +multiple senders coming from the same IP address. .It Ic timeout Aq seconds .Pp Connection timeout in seconds. @@ -198,17 +200,17 @@ The default value is Local address to bind to before connecting to the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. .It Ic directory Aq path .Pp -Directory where to look for audit trail files in case of sender mode or -directory where to store received audit trail files. +The directory where to look for audit trail files in case of sender mode, or +the directory where to store received audit trail files. The provided path has to be an absolute path. -The only exception is when directory is provided in the +The only exception is when the directory is provided in the .Ic receiver -section, then path provided in the +section; then the path provided in the .Ic host subsections can be relative to the directory in the .Ic receiver @@ -229,13 +231,13 @@ subsections in the .Ic receiver section where .Aq name -is host's name. +is the host's name. .\".It Ic checksum Aq algorithm .\".Pp .\"Checksum algorithm should be one of the following: .\".Bl -tag -width ".Ic sha256" .\".It Ic none -.\"No checksum will be calculated for the data being send over the network. +.\"No checksum will be calculated for the data being sent over the network. .\"This is the default setting. .\".It Ic crc32 .\"CRC32 checksum will be calculated. @@ -247,30 +249,30 @@ is host's name. .\"Compression algorithm should be one of the following: .\".Bl -tag -width ".Ic none" .\".It Ic none -.\"Data send over the network will not be compressed. +.\"Data sent over the network will not be compressed. .\"This is the default setting. .\".It Ic lzf .\"The .\".Nm LZF .\"algorithm by .\".An Marc Alexander Lehmann -.\"will be used to compress the data send over the network. +.\"will be used to compress the data sent over the network. .\".Nm LZF -.\"is very fast, general purpose compression algorithm. +.\"is a very fast, general purpose compression algorithm. .\".El .It Ic remote Aq addr .Pp Address of the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. -When operating in the +When operating in .Ic sender mode this address will be used to connect to the .Ic receiver . -When operating in the +When operating in .Ic receiver mode only connections from this address will be accepted. .It Ic listen Aq addr @@ -296,21 +298,22 @@ By default listens on .Pa tcp4://0.0.0.0:7878 and -.Pa tcp6://[::]:7878 -if kernel supports IPv4 and IPv6 respectively. +.Pa tcp6://[::]:7878 , +if the kernel supports IPv4 and IPv6 respectively. .It Ic keyfile Aq path .Pp -Path to a file that contains private key for TLS communication. +Path to a file that contains the private key for TLS communication. .It Ic certfile Aq path .Pp -Path to a file that contains certificate for TLS communication. +Path to a file that contains the certificate for TLS communication. .It Ic fingerprint Aq algo=hash .Pp -Finger print of the receiver's public key. -Currently only SHA256 algorithm is supported. -Certificate public key's fingerprint ready to be pasted into auditdistd +Fingerprint of the receiver's public key. +Currently only the SHA256 algorithm is supported. +The certificate public key's fingerprint ready to be pasted into the +.Nm auditdistd configuration file can be obtained by running: -.Bd -literal -offset +.Bd -literal # openssl x509 -in /etc/security/auditdistd.cert.pem -noout -fingerprint -sha256 | awk -F '[ =]' '{printf("%s=%s\\n", $1, $3)}' .Ed .It Ic password Aq password @@ -352,10 +355,10 @@ receiver { .Ed .Sh SEE ALSO .Xr audit 4 , -.Xr auditdistd 8 . +.Xr auditdistd 8 .Sh AUTHORS The .Nm auditdistd -was developed by +daemon was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/auditdistd.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.h#2 $ */ #ifndef _AUDITDISTD_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/faccessat.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/faccessat.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/faccessat.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/faccessat.h#1 $ */ #ifndef _FACCESSAT_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/fstatat.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/fstatat.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/fstatat.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/fstatat.h#1 $ */ #ifndef _FSTATAT_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/openat.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/openat.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/openat.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/openat.h#1 $ */ #ifndef _OPENAT_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/parse.y ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/parse.y Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/parse.y Sun Dec 20 05:20:52 2015 (r292498) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.c Sun Dec 20 05:20:52 2015 (r292498) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.c#1 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/pjdlog.h Sun Dec 20 05:20:52 2015 (r292498) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.h#1 $ */ #ifndef _PJDLOG_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.c#1 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.h#1 $ */ #ifndef _PROTO_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_common.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_common.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_common.c Sun Dec 20 05:20:52 2015 (r292498) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_common.c#1 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_impl.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_impl.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_impl.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_impl.h#1 $ */ #ifndef _PROTO_IMPL_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_socketpair.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_socketpair.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_socketpair.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_socketpair.c#1 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tcp.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tcp.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tcp.c Sun Dec 20 05:20:52 2015 (r292498) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#2 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tls.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tls.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_tls.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#2 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_uds.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_uds.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/proto_uds.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#2 $ */ /* UDS - UNIX Domain Socket */ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/receiver.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/receiver.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/receiver.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#3 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/renameat.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/renameat.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/renameat.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/renameat.h#1 $ */ #ifndef _RENAMEAT_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#3 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/sandbox.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.h#1 $ */ #ifndef _SANDBOX_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/sender.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/sender.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/sender.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#3 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/sigtimedwait.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/sigtimedwait.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/sigtimedwait.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#2 $ */ #ifndef _SIGTIMEDWAIT_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/strndup.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/strndup.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/strndup.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/strndup.h#1 $ */ #ifndef _STRNDUP_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.c Sun Dec 20 05:20:52 2015 (r292498) @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#3 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/subr.h Sun Dec 20 05:20:52 2015 (r292498) @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.h#1 $ */ #ifndef _AUDITDISTD_SUBR_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/synch.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/synch.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/synch.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#3 $ */ #ifndef _SYNCH_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/token.l ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/token.l Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/token.l Sun Dec 20 05:20:52 2015 (r292498) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.c ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.c Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.c Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#3 $ */ #include Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/trail.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.h#1 $ */ #ifndef _AUDITDISTD_TRAIL_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditdistd/unlinkat.h ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditdistd/unlinkat.h Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditdistd/unlinkat.h Sun Dec 20 05:20:52 2015 (r292498) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/unlinkat.h#1 $ */ #ifndef _UNLINKAT_H_ Modified: user/ngie/make_check/contrib/openbsm/bin/auditfilterd/Makefile.am ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditfilterd/Makefile.am Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditfilterd/Makefile.am Sun Dec 20 05:20:52 2015 (r292498) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/Makefile.am#4 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd.8 ============================================================================== --- user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Sun Dec 20 05:06:44 2015 (r292497) +++ user/ngie/make_check/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Sun Dec 20 05:20:52 2015 (r292498) @@ -23,8 +23,6 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Sun Dec 20 05:59:48 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 796C7A14917 for ; Sun, 20 Dec 2015 05:59:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5DD1CB6; Sun, 20 Dec 2015 05:59:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK5xl9v007445; Sun, 20 Dec 2015 05:59:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK5xl0E007441; Sun, 20 Dec 2015 05:59:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200559.tBK5xl0E007441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 05:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292503 - in user/ngie/make_check: . share/mk sys/sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:59:48 -0000 Author: ngie Date: Sun Dec 20 05:59:46 2015 New Revision: 292503 URL: https://svnweb.freebsd.org/changeset/base/292503 Log: MFhead @ r292502 Modified: user/ngie/make_check/Makefile.inc1 user/ngie/make_check/share/mk/suite.test.mk user/ngie/make_check/sys/sys/param.h Directory Properties: user/ngie/make_check/ (props changed) user/ngie/make_check/share/ (props changed) user/ngie/make_check/sys/ (props changed) Modified: user/ngie/make_check/Makefile.inc1 ============================================================================== --- user/ngie/make_check/Makefile.inc1 Sun Dec 20 05:52:03 2015 (r292502) +++ user/ngie/make_check/Makefile.inc1 Sun Dec 20 05:59:46 2015 (r292503) @@ -50,6 +50,7 @@ .endif LOCALBASE?= /usr/local + # Cross toolchain changes must be in effect before bsd.compiler.mk # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. .if defined(CROSS_TOOLCHAIN) Modified: user/ngie/make_check/share/mk/suite.test.mk ============================================================================== --- user/ngie/make_check/share/mk/suite.test.mk Sun Dec 20 05:52:03 2015 (r292502) +++ user/ngie/make_check/share/mk/suite.test.mk Sun Dec 20 05:59:46 2015 (r292503) @@ -50,13 +50,12 @@ FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} .endif -.if ${KYUAFILE:tl} == "auto" -CLEANFILES+= Kyuafile Kyuafile.tmp - .for _T in ${_TESTS} _TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} .endfor +.if ${KYUAFILE:tl} == "auto" +CLEANFILES+= Kyuafile Kyuafile.tmp Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ Modified: user/ngie/make_check/sys/sys/param.h ============================================================================== --- user/ngie/make_check/sys/sys/param.h Sun Dec 20 05:52:03 2015 (r292502) +++ user/ngie/make_check/sys/sys/param.h Sun Dec 20 05:59:46 2015 (r292503) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100091 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100092 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-user@freebsd.org Sun Dec 20 06:04:00 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A10A14D5E for ; Sun, 20 Dec 2015 06:04:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 893B31180; Sun, 20 Dec 2015 06:04:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK63xHn010260; Sun, 20 Dec 2015 06:03:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK63xXK010259; Sun, 20 Dec 2015 06:03:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200603.tBK63xXK010259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 06:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292505 - in user/ngie/make_check: . share X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 06:04:00 -0000 Author: ngie Date: Sun Dec 20 06:03:59 2015 New Revision: 292505 URL: https://svnweb.freebsd.org/changeset/base/292505 Log: MFhead @ r292504 Modified: Directory Properties: user/ngie/make_check/ (props changed) user/ngie/make_check/share/ (props changed) From owner-svn-src-user@freebsd.org Sun Dec 20 06:13:19 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB87BA4049A for ; Sun, 20 Dec 2015 06:13:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F3651842; Sun, 20 Dec 2015 06:13:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK6DI9i013052; Sun, 20 Dec 2015 06:13:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK6DIk6013049; Sun, 20 Dec 2015 06:13:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200613.tBK6DIk6013049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 06:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292506 - in user/ngie/make_check: . share/man/man7 share/mk X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 06:13:20 -0000 Author: ngie Date: Sun Dec 20 06:13:18 2015 New Revision: 292506 URL: https://svnweb.freebsd.org/changeset/base/292506 Log: Apply feedback from emaste Modified: user/ngie/make_check/Makefile user/ngie/make_check/share/man/man7/build.7 user/ngie/make_check/share/mk/suite.test.mk Modified: user/ngie/make_check/Makefile ============================================================================== --- user/ngie/make_check/Makefile Sun Dec 20 06:03:59 2015 (r292505) +++ user/ngie/make_check/Makefile Sun Dec 20 06:13:18 2015 (r292506) @@ -329,6 +329,10 @@ bmake: .PHONY ${MMAKE} all; \ ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= +regress: .PHONY + @echo "'make regress' has been renamed 'make check'" | /usr/bin/fmt + @false + tinderbox toolchains kernel-toolchains: upgrade_checks tinderbox: Modified: user/ngie/make_check/share/man/man7/build.7 ============================================================================== --- user/ngie/make_check/share/man/man7/build.7 Sun Dec 20 06:03:59 2015 (r292505) +++ user/ngie/make_check/share/man/man7/build.7 Sun Dec 20 06:13:18 2015 (r292506) @@ -116,7 +116,7 @@ but the check directory can be changed w .It Cm checkworld Run the .Fx -Test Suite on installed world. +test suite on installed world. .It Cm clean Remove any files created during the build process. .It Cm cleandepend Modified: user/ngie/make_check/share/mk/suite.test.mk ============================================================================== --- user/ngie/make_check/share/mk/suite.test.mk Sun Dec 20 06:03:59 2015 (r292505) +++ user/ngie/make_check/share/mk/suite.test.mk Sun Dec 20 06:13:18 2015 (r292506) @@ -78,14 +78,6 @@ Kyuafile: Makefile CHECKDIR?= ${DESTDIR}${TESTSDIR} KYUA= ${LOCALBASE}/bin/kyua -${KYUA}: - @echo - @echo "kyua binary not installed at expected location (${.TARGET})" - @echo - @echo "Please install via pkg install, or specify the path to the kyua" - @echo "package via the \$${LOCALBASE} variable, e.g. " - @echo "LOCALBASE=\"${LOCALBASE}\"" - @false # Definition of the "make check" target and supporting variables. # @@ -98,5 +90,13 @@ ${KYUA}: # report bogus results unless the new binaries are put in place. realcheck: .PHONY -realcheck: ${KYUA} + @if [ ! -x ${KYUA} ]; then \ + echo; \ + echo "kyua binary not installed at expected location (${.TARGET})"; \ + echo; \ + echo "Please install via pkg install, or specify the path to the kyua"; \ + echo "package via the \$${LOCALBASE} variable, e.g. "; \ + echo "LOCALBASE=\"${LOCALBASE}\""; \ + false; \ + fi @${KYUA} test -k ${CHECKDIR}/Kyuafile From owner-svn-src-user@freebsd.org Tue Dec 22 07:59:42 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 716DBA14587 for ; Tue, 22 Dec 2015 07:59:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B4A91646; Tue, 22 Dec 2015 07:59:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBM7xf0e098566; Tue, 22 Dec 2015 07:59:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM7xfm5098565; Tue, 22 Dec 2015 07:59:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512220759.tBM7xfm5098565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 07:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292587 - user/ngie/stable-10-libnv X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 07:59:42 -0000 Author: ngie Date: Tue Dec 22 07:59:41 2015 New Revision: 292587 URL: https://svnweb.freebsd.org/changeset/base/292587 Log: Branch off ^/stable/10 for backporting libnv to stable/10 Added: - copied from r292586, stable/10/ Directory Properties: user/ngie/stable-10-libnv/ (props changed) From owner-svn-src-user@freebsd.org Tue Dec 22 22:52:39 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59E16A50DC4 for ; Tue, 22 Dec 2015 22:52:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 089AD1EAE; Tue, 22 Dec 2015 22:52:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMMqcwg085295; Tue, 22 Dec 2015 22:52:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMMqbMv085291; Tue, 22 Dec 2015 22:52:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222252.tBMMqbMv085291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 22:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292630 - in user/ngie/stable-10-libnv: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 22:52:39 -0000 Author: ngie Date: Tue Dec 22 22:52:37 2015 New Revision: 292630 URL: https://svnweb.freebsd.org/changeset/base/292630 Log: MFstable/10 @ r292629 Added: user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/lzma12.h - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/api/lzma/lzma12.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_buffer_encoder.h - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/common/block_buffer_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/hardware_cputhreads.c - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/common/hardware_cputhreads.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/memcmplen.h - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/common/memcmplen.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/outqueue.c - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/common/outqueue.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/outqueue.h - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/common/outqueue.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_encoder_mt.c - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/common/stream_encoder_mt.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/liblzma.map - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/liblzma.map user/ngie/stable-10-libnv/contrib/xz/src/liblzma/liblzma.pc.in - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/liblzma.pc.in user/ngie/stable-10-libnv/contrib/xz/src/liblzma/validate_map.sh - copied unchanged from r292629, stable/10/contrib/xz/src/liblzma/validate_map.sh user/ngie/stable-10-libnv/contrib/xz/src/xz/mytime.c - copied unchanged from r292629, stable/10/contrib/xz/src/xz/mytime.c user/ngie/stable-10-libnv/contrib/xz/src/xz/mytime.h - copied unchanged from r292629, stable/10/contrib/xz/src/xz/mytime.h Deleted: user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/lzma.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_encoder.h Modified: user/ngie/stable-10-libnv/Makefile.inc1 user/ngie/stable-10-libnv/ObsoleteFiles.inc user/ngie/stable-10-libnv/contrib/xz/ChangeLog user/ngie/stable-10-libnv/contrib/xz/FREEBSD-Xlist user/ngie/stable-10-libnv/contrib/xz/FREEBSD-upgrade user/ngie/stable-10-libnv/contrib/xz/THANKS user/ngie/stable-10-libnv/contrib/xz/TODO user/ngie/stable-10-libnv/contrib/xz/src/common/mythread.h user/ngie/stable-10-libnv/contrib/xz/src/common/sysdefs.h user/ngie/stable-10-libnv/contrib/xz/src/common/tuklib_cpucores.c user/ngie/stable-10-libnv/contrib/xz/src/common/tuklib_integer.h user/ngie/stable-10-libnv/contrib/xz/src/common/tuklib_physmem.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/base.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/block.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/container.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/filter.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/hardware.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/index.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/index_hash.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/api/lzma/version.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/check/check.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/check/sha256.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/alone_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/alone_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/alone_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/auto_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_buffer_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_buffer_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_header_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_header_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/block_util.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/common.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/common.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/easy_buffer_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/easy_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_buffer_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_buffer_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_common.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_common.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/filter_flags_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/index.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/index_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/index_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/index_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/index_hash.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_buffer_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_buffer_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/common/stream_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/delta/delta_common.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/delta/delta_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/delta/delta_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/delta/delta_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/delta/delta_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/delta/delta_private.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lz/lz_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lz/lz_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lz/lz_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lz/lz_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lz/lz_encoder_mf.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/fastpos.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma2_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma2_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma2_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma2_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_common.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_encoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_encoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/rangecoder/range_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/arm.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/armthumb.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/ia64.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/powerpc.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/simple_coder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/simple_coder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/simple_decoder.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/simple_decoder.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/simple_private.h user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/sparc.c user/ngie/stable-10-libnv/contrib/xz/src/liblzma/simple/x86.c user/ngie/stable-10-libnv/contrib/xz/src/xz/args.c user/ngie/stable-10-libnv/contrib/xz/src/xz/args.h user/ngie/stable-10-libnv/contrib/xz/src/xz/coder.c user/ngie/stable-10-libnv/contrib/xz/src/xz/coder.h user/ngie/stable-10-libnv/contrib/xz/src/xz/file_io.c user/ngie/stable-10-libnv/contrib/xz/src/xz/file_io.h user/ngie/stable-10-libnv/contrib/xz/src/xz/hardware.c user/ngie/stable-10-libnv/contrib/xz/src/xz/hardware.h user/ngie/stable-10-libnv/contrib/xz/src/xz/list.c user/ngie/stable-10-libnv/contrib/xz/src/xz/main.c user/ngie/stable-10-libnv/contrib/xz/src/xz/message.c user/ngie/stable-10-libnv/contrib/xz/src/xz/options.c user/ngie/stable-10-libnv/contrib/xz/src/xz/private.h user/ngie/stable-10-libnv/contrib/xz/src/xz/signals.c user/ngie/stable-10-libnv/contrib/xz/src/xz/suffix.c user/ngie/stable-10-libnv/contrib/xz/src/xz/xz.1 user/ngie/stable-10-libnv/lib/Makefile user/ngie/stable-10-libnv/lib/libarchive/Makefile user/ngie/stable-10-libnv/lib/liblzma/Makefile user/ngie/stable-10-libnv/lib/liblzma/Symbol.map user/ngie/stable-10-libnv/lib/liblzma/Versions.def user/ngie/stable-10-libnv/lib/liblzma/config.h user/ngie/stable-10-libnv/rescue/rescue/Makefile user/ngie/stable-10-libnv/share/man/man4/isp.4 user/ngie/stable-10-libnv/sys/cam/ctl/ctl.c user/ngie/stable-10-libnv/sys/dev/if_ndis/if_ndis_pci.c user/ngie/stable-10-libnv/sys/dev/isp/isp.c user/ngie/stable-10-libnv/sys/dev/isp/isp_freebsd.c user/ngie/stable-10-libnv/sys/dev/isp/isp_freebsd.h user/ngie/stable-10-libnv/sys/dev/isp/isp_library.c user/ngie/stable-10-libnv/sys/dev/isp/isp_pci.c user/ngie/stable-10-libnv/sys/dev/isp/isp_sbus.c user/ngie/stable-10-libnv/sys/dev/isp/ispmbox.h user/ngie/stable-10-libnv/sys/dev/isp/ispvar.h user/ngie/stable-10-libnv/sys/dev/qlxgbe/ql_hw.c user/ngie/stable-10-libnv/sys/dev/qlxgbe/ql_os.c user/ngie/stable-10-libnv/sys/dev/qlxgbe/ql_ver.h user/ngie/stable-10-libnv/sys/sys/param.h user/ngie/stable-10-libnv/usr.bin/cpio/Makefile user/ngie/stable-10-libnv/usr.bin/grep/Makefile user/ngie/stable-10-libnv/usr.bin/gzip/Makefile user/ngie/stable-10-libnv/usr.bin/lzmainfo/Makefile user/ngie/stable-10-libnv/usr.bin/mkulzma/Makefile user/ngie/stable-10-libnv/usr.bin/tar/Makefile user/ngie/stable-10-libnv/usr.bin/xz/Makefile user/ngie/stable-10-libnv/usr.bin/xzdec/Makefile Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/Makefile.inc1 ============================================================================== --- user/ngie/stable-10-libnv/Makefile.inc1 Tue Dec 22 22:40:42 2015 (r292629) +++ user/ngie/stable-10-libnv/Makefile.inc1 Tue Dec 22 22:52:37 2015 (r292630) @@ -1697,6 +1697,8 @@ _lib_libradius= lib/libradius _ofed_lib= contrib/ofed/usr.lib/ .endif +lib/liblzma__L: lib/libthr__L + _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} .for _DIR in ${LOCAL_LIB_DIRS} .if exists(${.CURDIR}/${_DIR}/Makefile) Modified: user/ngie/stable-10-libnv/ObsoleteFiles.inc ============================================================================== --- user/ngie/stable-10-libnv/ObsoleteFiles.inc Tue Dec 22 22:40:42 2015 (r292629) +++ user/ngie/stable-10-libnv/ObsoleteFiles.inc Tue Dec 22 22:52:37 2015 (r292630) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20151222: liblzma header +OLD_FILES+=usr/include/lzma/lzma.h # 20151115: added missing _test suffix on multiple tests in lib/libc OLD_FILES+=usr/tests/lib/libc/c063/faccessat OLD_FILES+=usr/tests/lib/libc/c063/fchmodat Modified: user/ngie/stable-10-libnv/contrib/xz/ChangeLog ============================================================================== --- user/ngie/stable-10-libnv/contrib/xz/ChangeLog Tue Dec 22 22:40:42 2015 (r292629) +++ user/ngie/stable-10-libnv/contrib/xz/ChangeLog Tue Dec 22 22:52:37 2015 (r292630) @@ -1,66 +1,1463 @@ -commit 495aaf3a5b7200a5d2bf449bbbcc0e18834607af +commit 9815cdf6987ef91a85493bfcfd1ce2aaf3b47a0a Author: Lasse Collin -Date: 2014-09-20 20:44:32 +0300 +Date: 2015-09-29 13:59:35 +0300 - Bump version and soname for 5.0.7. + Bump version and soname for 5.2.2. src/liblzma/Makefile.am | 2 +- src/liblzma/api/lzma/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -commit ac6c8921d1d8d2d749d5c97f9a0b0594cc863cea +commit cbe0cec8476bdd0416c7ca9bc83895c9bea1cf78 Author: Lasse Collin -Date: 2014-09-20 20:43:29 +0300 +Date: 2015-09-29 13:57:28 +0300 + + Update NEWS for 5.2.2. + + NEWS | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 49427ce7eececdd18bbd35dab23c81910d083e1c +Author: Andre Noll +Date: 2015-05-28 15:50:00 +0200 + + Fix typo in German translation. + + As pointed out by Robert Pollak, there's a typo in the German + translation of the compression preset option (-0 ... -9) help text. + "The compressor" translates to "der Komprimierer", and the genitive + form is "des Komprimierers". The old word makes no sense at all. + + po/de.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 608d6f06c940e7f28c25de005e8b99bdff42d27c +Author: Hauke Henningsen +Date: 2015-08-17 04:59:54 +0200 + + Update German translation, mostly wrt orthography + + Provide an update of the German translation. + * A lot of compound words were previously written with spaces, while + German orthography is relatively clear in that the components + should not be separated. + * When referring to the actual process of (de)compression rather than the + concept, replace “(De-)Kompression” with “(De-)Komprimierung”. + Previously, both forms were used in this context and are now used in a + manner consistent with “Komprimierung” being more likely to refer to + a process. + * Consistently translate “standard input”/“output” + * Use “Zeichen” instead of false friend “Charakter” for “character” + * Insert commas around relative clauses (as required in German) + * Some other minor corrections + * Capitalize “ß” as “ẞ” + * Consistently start option descriptions in --help with capital letters + + Acked-By: Andre Noll + + * Update after msgmerge + + po/de.po | 383 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 196 insertions(+), 187 deletions(-) + +commit c8988414e5b67b8ef2fe0ba7b1ccdd0ec73c60d3 +Author: Lasse Collin +Date: 2015-08-11 13:23:04 +0300 + + Build: Minor Cygwin cleanup. + + Some tests used "cygwin*" and some used "cygwin". I changed + them all to use "cygwin". Shouldn't affect anything in practice. + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 85a6dfed53477906bfe9a7c0123dd412e391cb48 +Author: Lasse Collin +Date: 2015-08-11 13:21:52 +0300 + + Build: Support building of MSYS2 binaries. + + configure.ac | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 77f270be8432df2e4516a0c48814b6976d6618c5 +Author: Lasse Collin +Date: 2015-08-09 21:06:26 +0300 + + Windows: Define DLL_EXPORT when building liblzma.dll with MSVC. + + src/liblzma/common/common.h uses it to set __declspec(dllexport) + for the API symbols. + + Thanks to Adam Walling. + + windows/liblzma_dll.vcxproj | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 8c975446c5903090a5a8493b5b96b71003056a88 +Author: Lasse Collin +Date: 2015-08-09 21:02:20 +0300 + + Windows: Omit unneeded header files from MSVC project files. + + windows/liblzma.vcxproj | 5 ----- + windows/liblzma_dll.vcxproj | 5 ----- + 2 files changed, 10 deletions(-) + +commit 119a00434954726ca58e4a578e6469f530fca30e +Author: Lasse Collin +Date: 2015-07-12 20:48:19 +0300 + + liblzma: A MSVC-specific hack isn't needed with MSVC 2013 and newer. + + src/liblzma/api/lzma.h | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit d4e7c557fcab353539c9481a8d95cb04bcb15c7c +Author: Lasse Collin +Date: 2015-06-19 20:38:55 +0300 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 98001740ca56c894a7bd32eb47e9857a8a7d878d +Author: Lasse Collin +Date: 2015-06-19 20:21:30 +0300 + + Windows: Update the docs. + + INSTALL | 29 ++++++---- + windows/INSTALL-MSVC.txt | 47 +++++++++++++++ + windows/INSTALL-MinGW.txt | 138 ++++++++++++++++++++++++++++++++++++++++++++ + windows/INSTALL-Windows.txt | 138 -------------------------------------------- + 4 files changed, 204 insertions(+), 148 deletions(-) + +commit 28195e4c877007cc760ecea1d17f740693d66873 +Author: Lasse Collin +Date: 2015-06-19 17:25:31 +0300 + + Windows: Add MSVC project files for building liblzma. + + Thanks to Adam Walling for creating these files. + + windows/liblzma.vcxproj | 359 ++++++++++++++++++++++++++++++++++++++++ + windows/liblzma_dll.vcxproj | 388 ++++++++++++++++++++++++++++++++++++++++++++ + windows/xz_win.sln | 48 ++++++ + 3 files changed, 795 insertions(+) + +commit 960440f3230dc628f6966d9f7614fc1b28baf44e +Author: Lasse Collin +Date: 2015-05-13 20:57:55 +0300 + + Tests: Fix a memory leak in test_bcj_exact_size. + + Thanks to Cristian Rodríguez. + + tests/test_bcj_exact_size.c | 1 + + 1 file changed, 1 insertion(+) + +commit 68cd35acafbdcdf4e8ea8b5bb843c736939d6f8b +Author: Lasse Collin +Date: 2015-05-12 18:08:24 +0300 + + Fix NEWS about threading in 5.2.0. + + Thanks to Andy Hochhaus. + + NEWS | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ff96ed6d25786728356017a13baf8c14731b4f1e +Author: Lasse Collin +Date: 2015-05-11 21:26:16 +0300 + + xz: Document that threaded decompression hasn't been implemented yet. + + src/xz/xz.1 | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 00d37b64a64ea8597fd2422d5187afd761ab9531 +Author: Lasse Collin +Date: 2015-04-20 20:20:29 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit db190a832c49ca3aed6d69cc992fa5583cae7b11 +Author: Lasse Collin +Date: 2015-04-20 19:59:18 +0300 + + Revert "xz: Use pipe2() if available." + + This reverts commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd. + It is a problem when libc has pipe2() but the kernel is too + old to have pipe2() and thus pipe2() fails. In xz it's pointless + to have a fallback for non-functioning pipe2(); it's better to + avoid pipe2() completely. + + Thanks to Michael Fox for the bug report. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 +-------- + 2 files changed, 3 insertions(+), 10 deletions(-) + +commit eccd8155e107c5ada03d13e7730675cdf1a44ddc +Author: Lasse Collin +Date: 2015-03-29 22:14:47 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 25263fd9e7a8a913395cb93d7c104cd48c2b4a00 +Author: Lasse Collin +Date: 2015-03-29 22:13:48 +0300 + + Fix the detection of installed RAM on QNX. + + The earlier version compiled but didn't actually work + since sysconf(_SC_PHYS_PAGES) always fails (or so I was told). + + Thanks to Ole André Vadla Ravnås for the patch and testing. + + m4/tuklib_physmem.m4 | 6 +++--- + src/common/tuklib_physmem.c | 14 +++++++++++++- + 2 files changed, 16 insertions(+), 4 deletions(-) + +commit 4c544d2410903d38402221cb783ed85585b6a007 +Author: Lasse Collin +Date: 2015-03-27 22:39:07 +0200 + + Fix CPU core count detection on QNX. + + It tried to use sysctl() on QNX but + - it broke the build because sysctl() needs -lsocket on QNX; + - sysctl() doesn't work for detecting the core count on QNX + even if it compiled. + + sysconf() works. An alternative would have been to use + QNX-specific SYSPAGE_ENTRY(num_cpu) from . + + Thanks to Ole André Vadla Ravnås. + + m4/tuklib_cpucores.m4 | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit e0ea6737b03e83ccaff4514d00e31bb926f8f0f3 +Author: Lasse Collin +Date: 2015-03-07 22:05:57 +0200 + + xz: size_t/uint32_t cleanup in options.c. + + src/xz/options.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 8bcca29a65335fd679c13814b70b35b68fa5daed +Author: Lasse Collin +Date: 2015-03-07 22:04:23 +0200 + + xz: Fix a comment and silence a warning in message.c. + + src/xz/message.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f243f5f44c6b19a7c289a0ec73a03ee08364cb5b +Author: Lasse Collin +Date: 2015-03-07 22:01:00 +0200 + + liblzma: Silence more uint32_t vs. size_t warnings. + + src/liblzma/lz/lz_encoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 7f0a4c50f4a374c40acf4b86848f301ad1e82d34 +Author: Lasse Collin +Date: 2015-03-07 19:54:00 +0200 + + xz: Make arg_count an unsigned int to silence a warning. + + Actually the value of arg_count cannot exceed INT_MAX + but it's nicer as an unsigned int. + + src/xz/args.h | 2 +- + src/xz/main.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f6ec46801588b1be29c07c9db98558b521304002 +Author: Lasse Collin +Date: 2015-03-07 19:33:17 +0200 + + liblzma: Fix a warning in index.c. + + src/liblzma/common/index.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a24518971cc621315af142dd3bb7614fab04ad27 +Author: Lasse Collin +Date: 2015-02-26 20:46:14 +0200 + + Build: Fix a CR+LF problem when running autoreconf -fi on OS/2. + + build-aux/version.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dec11497a71518423b5ff0e759100cf8aadf6c7b +Author: Lasse Collin +Date: 2015-02-26 16:53:44 +0200 + + Bump version and soname for 5.2.1. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 29e39c79975ab89ee5dd671e97064534a9f3a649 +Author: Lasse Collin +Date: 2015-02-26 13:01:09 +0200 + + Update NEWS for 5.2.1. + + NEWS | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd +Author: Lasse Collin +Date: 2015-02-22 19:38:48 +0200 + + xz: Use pipe2() if available. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 ++++++++- + 2 files changed, 10 insertions(+), 3 deletions(-) + +commit 117d962685c72682c63edc9bb765367189800202 +Author: Lasse Collin +Date: 2015-02-21 23:40:26 +0200 + + liblzma: Fix a compression-ratio regression in LZMA1/2 in fast mode. + + The bug was added in the commit + f48fce093b07aeda95c18850f5e086d9f2383380 and thus + affected 5.1.4beta and 5.2.0. Luckily the bug cannot + cause data corruption or other nasty things. + + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ae984e31c167d3bc52972ec422dd1ebd5f5d5719 +Author: Lasse Collin +Date: 2015-02-21 23:00:19 +0200 + + xz: Fix the fcntl() usage when creating a pipe for the self-pipe trick. + + Now it reads the old flags instead of blindly setting O_NONBLOCK. + The old code may have worked correctly, but this is better. + + src/xz/file_io.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 2205bb5853098aea36a56df6f5747037175f66b4 +Author: Lasse Collin +Date: 2015-02-10 15:29:34 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d935b0cdf3db440269b9d952b2b281b18f8c7b08 +Author: Lasse Collin +Date: 2015-02-10 15:28:30 +0200 + + tuklib_cpucores: Use cpuset_getaffinity() on FreeBSD if available. + + In FreeBSD, cpuset_getaffinity() is the preferred way to get + the number of available cores. + + Thanks to Rui Paulo for the patch. I edited it slightly, but + hopefully I didn't break anything. + + m4/tuklib_cpucores.m4 | 23 ++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 18 ++++++++++++++++++ + 2 files changed, 40 insertions(+), 1 deletion(-) + +commit eb61bc58c20769cac4d05f363b9c0e8c9c71a560 +Author: Lasse Collin +Date: 2015-02-09 22:08:37 +0200 + + xzdiff: Make the mktemp usage compatible with FreeBSD's mktemp. + + Thanks to Rui Paulo for the fix. + + src/scripts/xzdiff.in | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit b9a5b6b7a29029680af733082b6a46e0fc01623a +Author: Lasse Collin +Date: 2015-02-03 21:45:53 +0200 + + Add a few casts to tuklib_integer.h to silence possible warnings. + + I heard that Visual Studio 2013 gave warnings without the casts. + + Thanks to Gabi Davar. + + src/common/tuklib_integer.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit c45757135f40e4a0de730ba5fff0100219493982 +Author: Lasse Collin +Date: 2015-01-26 21:24:39 +0200 + + liblzma: Set LZMA_MEMCMPLEN_EXTRA depending on the compare method. + + src/liblzma/common/memcmplen.h | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3c500174ed5485f550972a2a6109c361e875f069 +Author: Lasse Collin +Date: 2015-01-26 20:40:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit fec88d41e672d9e197c9442aecf02bd0dfa6d516 +Author: Lasse Collin +Date: 2015-01-26 20:39:28 +0200 + + liblzma: Silence harmless Valgrind errors. + + Thanks to Torsten Rupp for reporting this. I had + forgotten to run Valgrind before the 5.2.0 release. + + src/liblzma/lz/lz_encoder.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit a9b45badfec0928d20a27c7176c005fa637f7d1e +Author: Lasse Collin +Date: 2015-01-09 21:50:19 +0200 + + xz: Fix comments. + + src/xz/file_io.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 541aee6dd4aa97a809aba281475a21b641bb89e2 +Author: Lasse Collin +Date: 2015-01-09 21:35:06 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4170edc914655310d2363baccf5e615e09b04911 +Author: Lasse Collin +Date: 2015-01-09 21:34:06 +0200 + + xz: Don't fail if stdout doesn't support O_NONBLOCK. + + This is similar to the case with stdin. + + Thanks to Brad Smith for the bug report and testing + on OpenBSD. + + src/xz/file_io.c | 36 +++++++++++++++--------------------- + 1 file changed, 15 insertions(+), 21 deletions(-) + +commit 04bbc0c2843c50c8ad1cba42b937118e38b0508d +Author: Lasse Collin +Date: 2015-01-07 19:18:20 +0200 + + xz: Fix a memory leak in DOS-specific code. + + src/xz/file_io.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f0f1f6c7235ffa901cf76fe18e33749e200b3eea +Author: Lasse Collin +Date: 2015-01-07 19:08:06 +0200 + + xz: Don't fail if stdin doesn't support O_NONBLOCK. + + It's a problem at least on OpenBSD which doesn't support + O_NONBLOCK on e.g. /dev/null. I'm not surprised if it's + a problem on other OSes too since this behavior is allowed + in POSIX-1.2008. + + The code relying on this behavior was committed in June 2013 + and included in 5.1.3alpha released on 2013-10-26. Clearly + the development releases only get limited testing. + + src/xz/file_io.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +commit d2d484647d9d9d679f03c75abb0404f67069271c +Author: Lasse Collin +Date: 2015-01-06 20:30:15 +0200 + + Tests: Don't hide unexpected error messages in test_files.sh. + + Hiding them makes no sense since normally there's no error + when testing the "good" files. With "bad" files errors are + expected and then it makes sense to keep the messages hidden. + + tests/test_files.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit aae6a6aeda51cf94a47e39ad624728f9bee75e30 +Author: Lasse Collin +Date: 2014-12-30 11:17:16 +0200 + + Update Solaris notes in INSTALL. + + Mention the possible "make check" failure on Solaris in the + Solaris-specific section of INSTALL. It was already in + section 4.5 but it is better mention it in the OS-specific + section too. + + INSTALL | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7815112153178800a3521b9f31960e7cdc26cfba +Author: Lasse Collin +Date: 2014-12-26 12:00:05 +0200 + + Build: POSIX shell isn't required if scripts are disabled. + + INSTALL | 3 ++- + configure.ac | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit a0cd05ee71d330b79ead6eb9222e1b24e1559d3a +Author: Lasse Collin +Date: 2014-12-21 20:48:37 +0200 + + DOS: Update Makefile. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit b85ee0905ec4ab7656d22e63519fdd3bedb21f2e +Author: Lasse Collin +Date: 2014-12-21 19:50:38 +0200 + + Windows: Fix bin_i486 to bin_i686 in build.bash. + + windows/build.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cbafa710918195dbba3db02c3fab4f0538235206 +Author: Lasse Collin +Date: 2014-12-21 18:58:44 +0200 + + Docs: Use lzma_cputhreads() in 04_compress_easy_mt.c. + + doc/examples/04_compress_easy_mt.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +commit 8dbb57238d372c7263cfeb3e7f7fd9a73173156a +Author: Lasse Collin +Date: 2014-12-21 18:56:44 +0200 + + Docs: Update docs/examples/00_README.txt. + + doc/examples/00_README.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6 +Author: Lasse Collin +Date: 2014-12-21 18:11:17 +0200 + + Bump version and soname for 5.2.0. + + I know that soname != app version, but I skip AGE=1 + in -version-info to make the soname match the liblzma + version anyway. It doesn't hurt anything as long as + it doesn't conflict with library versioning rules. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma.map | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 3e8bd1d15e417f2d588e9be50ce027ee3d48b2da +Author: Lasse Collin +Date: 2014-12-21 18:05:03 +0200 + + Avoid variable-length arrays in the debug programs. + + debug/full_flush.c | 3 ++- + debug/sync_flush.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 72f7307cfdceb941aeb2bf30d424cc0d13621786 +Author: Lasse Collin +Date: 2014-12-21 18:01:45 +0200 + + Build: Include 04_compress_easy_mt.c in the tarball. + + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 2cb82ff21c62def11f3683a8bb0aaf363102aaa0 +Author: Lasse Collin +Date: 2014-12-21 18:00:38 +0200 + + Fix build when --disable-threads is used. + + src/common/mythread.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9b9e3536e458ef958f66b0e8982efc9d36de4d17 +Author: Adrien Nader +Date: 2014-12-21 15:56:15 +0100 + + po/fr: improve wording for help for --lzma1/--lzma2. + + po/fr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a8b6b569e7fadbf5b5b9139d53bc764015c15027 +Author: Adrien Nader +Date: 2014-12-21 15:55:48 +0100 + + po/fr: missing line in translation of --extreme. + + po/fr.po | 1 + + 1 file changed, 1 insertion(+) + +commit f168a6fd1a888cf4f0caaddcafcb21dadc6ab6e9 +Author: Lasse Collin +Date: 2014-12-21 14:32:33 +0200 + + Update NEWS for 5.2.0. + + NEWS | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +commit cec2ee863b3a88f4bf039cb00f73c4a4fc93a429 +Author: Lasse Collin +Date: 2014-12-21 14:32:22 +0200 + + Update NEWS for 5.0.8. + + NEWS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 42e97a32649bf53ce43be2258b902a417c6e7fa1 +Author: Lasse Collin +Date: 2014-12-21 14:07:54 +0200 + + xz: Fix a comment. + + src/xz/options.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 29b95d5d6665cedffa6a9d6d3d914f981e852182 +Author: Lasse Collin +Date: 2014-12-20 20:43:14 +0200 + + Update INSTALL about the dependencies of the scripts. + + INSTALL | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3af91040bb42c21afbb81f5568c3313125e61192 +Author: Lasse Collin +Date: 2014-12-20 20:42:33 +0200 + + Windows: Update build instructions. + + INSTALL | 15 +++++++++------ + windows/INSTALL-Windows.txt | 44 +++++++++++++++++++++----------------------- + 2 files changed, 30 insertions(+), 29 deletions(-) + +commit 0152f72bf6289d744823dc6c849538f3a139ad70 +Author: Lasse Collin +Date: 2014-12-20 20:41:48 +0200 + + Windows: Update the build script and README-Windows.txt. + + The 32-bit build is now for i686 or newer because the + prebuilt MinGW-w64 toolchains include i686 code in the + executables even if one uses -march=i486. + + The build script builds 32-bit SSE2 enabled version too. + Run-time detection of SSE2 support would be nice (on any OS) + but it's not implemented in XZ Utils yet. + + windows/README-Windows.txt | 30 ++++++++++++++++-------------- + windows/build.bash | 23 ++++++++++++++--------- + 2 files changed, 30 insertions(+), 23 deletions(-) + +commit 4a1f6133ee5533cee8d91e06fcc22443e5f1881a +Author: Lasse Collin +Date: 2014-12-19 15:51:50 +0200 + + Windows: Define TUKLIB_SYMBOL_PREFIX in config.h. + + It is to keep all symbols in the lzma_ namespace. + + windows/config.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 7f7d093de79eee0c7dbfd7433647e46302f19f82 +Author: Lasse Collin +Date: 2014-12-16 21:00:09 +0200 + + xz: Update the man page about --threads. + + src/xz/xz.1 | 5 ----- + 1 file changed, 5 deletions(-) + +commit 009823448b82aa5f465668878a544c5842885407 +Author: Lasse Collin +Date: 2014-12-16 20:57:43 +0200 + + xz: Update the man page about --block-size. + + src/xz/xz.1 | 41 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 33 insertions(+), 8 deletions(-) + +commit 7dddfbeb499e528940bc12047355c184644aafe9 +Author: Adrien Nader +Date: 2014-12-10 22:26:57 +0100 + + po/fr: several more translation updates: reword and handle --ignore-check. + + po/fr.po | 50 ++++++++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 24 deletions(-) + +commit 6eca5be40e04ddc4b738d493e4e56835956d8b69 +Author: Adrien Nader +Date: 2014-12-10 22:23:01 +0100 + + po/fr: yet another place where my email address had to be updated. + + po/fr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d1003673e92ba47edd6aeeb3dbea05c18269d0e7 +Author: Adrien Nader +Date: 2014-12-10 22:22:20 +0100 + + po/fr: fix several typos that have been around since the beginning. + + po/fr.po | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit 4c5aa911a0df027e46171e368debc543d2fa72b2 +Author: Adrien Nader +Date: 2014-12-03 20:02:31 +0100 + + po/fr: last batch of new translations for now. + + Four new error messages. + + po/fr.po | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 3e3099e36d27059499e7996fb38a62e8ab01d356 +Author: Adrien Nader +Date: 2014-12-03 20:01:32 +0100 + + po/fr: translations for --threads, --block-size and --block-list. + + po/fr.po | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit e7d96a5933eec4e9d4a62569ee88df0ebb0f1d53 +Author: Adrien Nader +Date: 2014-12-03 20:00:53 +0100 + + po/fr: remove fuzzy marker for error messages that will be kept in English. + + The following is a copy of a comment inside fr.po: + + Note from translator on "file status flags". + The following entry is kept un-translated on purpose. It is difficult to + translate and should only happen in exceptional circumstances which means + that translating would: + - lose some of the meaning + - make it more difficult to look up in search engines; it might happen one + in + a million times, if we dilute the error message in 20 languages, it will be + almost impossible to find an explanation and support for the error. + + po/fr.po | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 46cbb9033af8a21fafe543302d6919746e0d72af +Author: Adrien Nader +Date: 2014-12-03 19:58:25 +0100 + + po/fr: several minor updates and better wording. + + Meaning doesn't change at all: it's only for better wording and/or + formatting of a few strings. + + po/fr.po | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 7ce49d444f04e73145f79c832eb4d510594b074a +Author: Adrien Nader +Date: 2014-12-03 19:56:12 +0100 + + po/fr: update my email address and copyright years. + + po/fr.po | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 214c553ebc3047cd720da1ce5c80cf7c38118d3c +Author: Adrien Nader +Date: 2014-11-26 10:08:26 +0100 + + fr.po: commit file after only "update-po" so actual is readable. + + po/fr.po | 311 ++++++++++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 199 insertions(+), 112 deletions(-) + +commit 1190c641af09cde85f8bd0fbe5c4906f4a29431b +Author: Lasse Collin +Date: 2014-12-02 20:04:07 +0200 + + liblzma: Document how lzma_mt.block_size affects memory usage. + + src/liblzma/api/lzma/container.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit e4fc1d2f9571fba79ce383595be2ea2a9257def0 +Author: Lasse Collin +Date: 2014-11-28 20:07:18 +0200 + + Update INSTALL about a "make check" failure in test_scripts.sh. + + INSTALL | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +commit 34f9e40a0a0c3bd2c2730cdb9cd550bbb8a3f2fe +Author: Lasse Collin +Date: 2014-11-26 20:12:27 +0200 + + Remove LZMA_UNSTABLE macro. + + src/liblzma/api/lzma/container.h | 4 ---- + src/liblzma/common/common.h | 2 -- + src/xz/private.h | 1 - + 3 files changed, 7 deletions(-) + +commit 6d9c0ce9f2677b159e32b224aba5b535b304a705 +Author: Lasse Collin +Date: 2014-11-26 20:10:33 +0200 + + liblzma: Update lzma_stream_encoder_mt() API docs. + + src/liblzma/api/lzma/container.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 2301f3f05dd9742f42cda8f0f318864f5dc39ab3 +Author: Lasse Collin +Date: 2014-11-25 12:32:05 +0200 + + liblzma: Verify the filter chain in threaded encoder initialization. + + This way an invalid filter chain is detected at the Stream + encoder initialization instead of delaying it to the first + call to lzma_code() which triggers the initialization of + the actual filter encoder(s). + + src/liblzma/common/stream_encoder_mt.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 107a263d5bb63cd3593fd6a5c938706539f84523 +Author: Lasse Collin +Date: 2014-11-17 19:11:49 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 71 +++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 47 insertions(+), 24 deletions(-) + +commit b13a781833399ff5726cfc997f3cb2f0acbdbf31 +Author: Lasse Collin +Date: 2014-11-17 18:52:21 +0200 + + Build: Replace obsolete AC_HELP_STRING with AS_HELP_STRING. + + configure.ac | 36 ++++++++++++++++++------------------ + m4/tuklib_integer.m4 | 2 +- + 2 files changed, 19 insertions(+), 19 deletions(-) + +commit 542cac122ed3550148a2af0033af22b757491378 +Author: Lasse Collin +Date: 2014-11-17 18:43:19 +0200 + + Build: Fix Autoconf warnings about escaped backquotes. + + Thanks to Daniel Richard G. for pointing out that it's + good to sometimes run autoreconf -fi with -Wall. + + configure.ac | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 7b03a15cea8cd4f19ed680b51c4bcbae3ce4142f +Author: Lasse Collin +Date: 2014-11-10 18:54:40 +0200 + + xzdiff: Use mkdir if mktemp isn't available. + + src/scripts/xzdiff.in | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit f8c13e5e3609581d5dd9f8777985ca07f2390ad7 +Author: Lasse Collin +Date: 2014-11-10 18:45:01 +0200 + + xzdiff: Create a temporary directory to hold a temporary file. + + This avoids the possibility of "File name too long" when + creating a temp file when the input file name is very long. + + This also means that other users on the system can no longer + see the input file names in /tmp (or whatever $TMPDIR is) + since the temporary directory will have a generic name. This + usually doesn't matter since on many systems one can see + the arguments given to all processes anyway. + + The number X chars to mktemp where increased from 6 to 10. + + Note that with some shells temp files or dirs won't be used at all. + + src/scripts/xzdiff.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 7716dcf9df7f457500cb657314e7a9aea5fedb06 +Author: Lasse Collin +Date: 2014-11-10 15:38:47 +0200 + + liblzma: Fix lzma_mt.preset in lzma_stream_encoder_mt_memusage(). + + It read the filter chain from a wrong variable. This is a similar + bug that was fixed in 9494fb6d0ff41c585326f00aa8f7fe58f8106a5e. + + src/liblzma/common/stream_encoder_mt.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 230fa4a605542c84b4178a57381695a0af4e779b +Author: Lasse Collin +Date: 2014-11-10 14:49:55 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4e4ae08bc7c1711e399c9f2d26eb375d39d08101 +Author: Lasse Collin +Date: 2014-10-29 21:28:25 +0200 + + Update .gitignore files. + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Dec 22 23:02:14 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4383A4F0A8 for ; Tue, 22 Dec 2015 23:02:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7727F1586; Tue, 22 Dec 2015 23:02:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMN2Dhl088252; Tue, 22 Dec 2015 23:02:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMN2C5E088242; Tue, 22 Dec 2015 23:02:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222302.tBMN2C5E088242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292631 - in user/ngie/stable-10-libnv: contrib/mdocml etc/mtree lib lib/libnv lib/libnv/tests share/mk X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:02:14 -0000 Author: ngie Date: Tue Dec 22 23:02:12 2015 New Revision: 292631 URL: https://svnweb.freebsd.org/changeset/base/292631 Log: MFC r258065,r258594,r259430,r260222,r261407,r261408,r263479,r264021,r266351,r269603: r258065 (by pjd): Bring in libnv library for managing name/value pairs. The following types are currently supported: - NV_TYPE_NULL - only name, no data; - NV_TYPE_BOOL - boolean (true or false); - NV_TYPE_NUMBER - 64bit unsigned integer; - NV_TYPE_STRING - C string; - NV_TYPE_NVLIST - nested nvlist; - NV_TYPE_DESCRIPTOR - file descriptor; - NV_TYPE_BINARY - binary data. For detailed documentation and examples see nv(3) manual page. Sponsored by: The FreeBSD Foundation r258594 (by pjd): Fix double free(). Reported by: Coverity Coverity CID: 1130048 r259430 (by pjd): MFp4 @1189139: Get rid of the msg_peek() function, which has a problem. If there was less data in the socket buffer than requested by the caller, the function would busy loop, as select(2) will always return immediately. We can just receive nvlhdr now, because some time ago we splitted receive of data from the receive of descriptors. r260222 (by pjd): MFp4 @1189711: Fix resource leaks on nvlist_destroy(). Reported by: Mariusz Zaborski r261407 (by pjd): Fix sending empty nvlist. Submitted by: Mariusz Zaborski r261408 (by pjd): Assert input arguments to buf_send() and buf_recv(). Submitted by: Mariusz Zaborski r263479 (by bdrewery): nv(3) was not in 10.0. It might be MFC'd to stable/10 for 10.1, but for now update the manual to avoid confusion on its availability. Discussed with: pjd r264021 (by jilles): libnv: Don't lose big-endian flag when receiving a message. A bug caused the "big endian" flag to be lost when receiving a message. As a result, the bits are interpreted as little endian and an extremely large allocation is attempted. This change fixes ping(8)'s communication to casperd(8) on big-endian architectures. Reported by: Anton Shterenlikht Tested by: danfe r266351 (by rstone): Correct a typo. r269603: Integrate lib/libnv into the build/kyua Rename all of the TAP test applications from to _test to match the convention described in the TestSuite wiki page Phabric: D538 Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Added: user/ngie/stable-10-libnv/lib/libnv/ - copied from r258065, head/lib/libnv/ user/ngie/stable-10-libnv/lib/libnv/tests/ - copied from r269603, head/lib/libnv/tests/ Modified: user/ngie/stable-10-libnv/contrib/mdocml/lib.in user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist user/ngie/stable-10-libnv/lib/Makefile user/ngie/stable-10-libnv/lib/libnv/Makefile user/ngie/stable-10-libnv/lib/libnv/msgio.c user/ngie/stable-10-libnv/lib/libnv/msgio.h user/ngie/stable-10-libnv/lib/libnv/nv.3 user/ngie/stable-10-libnv/lib/libnv/nvlist.c user/ngie/stable-10-libnv/lib/libnv/nvpair.c user/ngie/stable-10-libnv/share/mk/bsd.libnames.mk Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/contrib/mdocml/lib.in ============================================================================== --- user/ngie/stable-10-libnv/contrib/mdocml/lib.in Tue Dec 22 22:52:37 2015 (r292630) +++ user/ngie/stable-10-libnv/contrib/mdocml/lib.in Tue Dec 22 23:02:12 2015 (r292631) @@ -67,6 +67,7 @@ LINE("libmemstat", "Kernel Memory Alloca LINE("libmenu", "Curses Menu Library (libmenu, \\-lmenu)") LINE("libnetgraph", "Netgraph User Library (libnetgraph, \\-lnetgraph)") LINE("libnetpgp", "Netpgp signing, verification, encryption and decryption (libnetpgp, \\-lnetpgp)") +LINE("libnv", "Name/value pairs library (libnv, \\-lnv)") LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)") LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") LINE("libpcap", "Packet Capture Library (libpcap, \\-lpcap)") Modified: user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist ============================================================================== --- user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist Tue Dec 22 22:52:37 2015 (r292630) +++ user/ngie/stable-10-libnv/etc/mtree/BSD.tests.dist Tue Dec 22 23:02:12 2015 (r292631) @@ -140,6 +140,8 @@ .. libmp .. + libnv + .. librt .. libthr @@ -204,7 +206,6 @@ execve .. pipe - .. .. kqueue .. Modified: user/ngie/stable-10-libnv/lib/Makefile ============================================================================== --- user/ngie/stable-10-libnv/lib/Makefile Tue Dec 22 22:52:37 2015 (r292630) +++ user/ngie/stable-10-libnv/lib/Makefile Tue Dec 22 23:02:12 2015 (r292631) @@ -70,6 +70,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libnetbsd \ ${_libnetgraph} \ ${_libngatm} \ + libnv \ libopie \ libpam \ libpcap \ Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Tue Nov 12 19:39:14 2013 (r258065) +++ user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:02:12 2015 (r292631) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= nv SHLIBDIR?= /lib SHLIB_MAJOR= 0 @@ -158,4 +160,8 @@ MLINKS+=nv.3 nvlist_existsv.3 \ WARNS?= 6 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: user/ngie/stable-10-libnv/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Tue Nov 12 19:39:14 2013 (r258065) +++ user/ngie/stable-10-libnv/lib/libnv/msgio.c Tue Dec 22 23:02:12 2015 (r292631) @@ -113,30 +113,6 @@ fd_wait(int fd, bool doread) NULL, NULL); } -int -msg_peek(int sock, void *buf, size_t size) -{ - ssize_t done; - - PJDLOG_ASSERT(sock >= 0); - PJDLOG_ASSERT(size > 0); - - do { - fd_wait(sock, true); - done = recv(sock, buf, size, MSG_PEEK | MSG_WAITALL); - if (done == -1) { - if (errno == EAGAIN || errno == EINTR) - continue; - return (-1); - } else if (done == 0) { - errno = ENOTCONN; - return (-1); - } - } while (done != (ssize_t)size); - - return (0); -} - static int msg_recv(int sock, struct msghdr *msg) { @@ -362,6 +338,10 @@ buf_send(int sock, void *buf, size_t siz ssize_t done; unsigned char *ptr; + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(size > 0); + PJDLOG_ASSERT(buf != NULL); + ptr = buf; do { fd_wait(sock, false); @@ -387,8 +367,11 @@ buf_recv(int sock, void *buf, size_t siz ssize_t done; unsigned char *ptr; + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(buf != NULL); + ptr = buf; - do { + while (size > 0) { fd_wait(sock, true); done = recv(sock, ptr, size, 0); if (done == -1) { @@ -401,7 +384,7 @@ buf_recv(int sock, void *buf, size_t siz } size -= done; ptr += done; - } while (size > 0); + } return (0); } Modified: user/ngie/stable-10-libnv/lib/libnv/msgio.h ============================================================================== --- head/lib/libnv/msgio.h Tue Nov 12 19:39:14 2013 (r258065) +++ user/ngie/stable-10-libnv/lib/libnv/msgio.h Tue Dec 22 23:02:12 2015 (r292631) @@ -38,8 +38,6 @@ struct cmsgcred; struct iovec; struct msghdr; -int msg_peek(int sock, void *buf, size_t size); - int cred_send(int sock); int cred_recv(int sock, struct cmsgcred *cred); Modified: user/ngie/stable-10-libnv/lib/libnv/nv.3 ============================================================================== --- head/lib/libnv/nv.3 Tue Nov 12 19:39:14 2013 (r258065) +++ user/ngie/stable-10-libnv/lib/libnv/nv.3 Tue Dec 22 23:02:12 2015 (r292631) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2013 +.Dd March 21, 2014 .Dt NV 3 .Os .Sh NAME @@ -194,7 +194,7 @@ The API supports the following data type .Bl -ohang -offset indent .It Sy null ( NV_TYPE_NULL ) There is no data associated with the name. -.It Sy bool ( NV_TYPE_BOLL ) +.It Sy bool ( NV_TYPE_BOOL ) The value can be either .Dv true or @@ -594,7 +594,7 @@ while ((name = nvlist_next(nvl, &type, & The .Nm libnv library appeared in -.Fx 10.0 . +.Fx 11.0 . .Sh AUTHORS .An -nosplit The Modified: user/ngie/stable-10-libnv/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Tue Nov 12 19:39:14 2013 (r258065) +++ user/ngie/stable-10-libnv/lib/libnv/nvlist.c Tue Dec 22 23:02:12 2015 (r292631) @@ -125,8 +125,10 @@ nvlist_destroy(nvlist_t *nvl) NVLIST_ASSERT(nvl); - while ((nvp = nvlist_first_nvpair(nvl)) != NULL) + while ((nvp = nvlist_first_nvpair(nvl)) != NULL) { nvlist_remove_nvpair(nvl, nvp); + nvpair_free(nvp); + } nvl->nvl_magic = 0; free(nvl); @@ -580,7 +582,7 @@ nvlist_check_header(struct nvlist_header errno = EINVAL; return (false); } - if ((nvlhdrp->nvlh_flags &= ~NV_FLAG_ALL_MASK) != 0) { + if ((nvlhdrp->nvlh_flags & ~NV_FLAG_ALL_MASK) != 0) { errno = EINVAL; return (false); } @@ -724,11 +726,11 @@ nvlist_recv(int sock) { struct nvlist_header nvlhdr; nvlist_t *nvl, *ret; + unsigned char *buf; size_t nfds, size; - void *buf; int serrno, *fds; - if (msg_peek(sock, &nvlhdr, sizeof(nvlhdr)) == -1) + if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); if (!nvlist_check_header(&nvlhdr)) @@ -741,10 +743,12 @@ nvlist_recv(int sock) if (buf == NULL) return (NULL); + memcpy(buf, &nvlhdr, sizeof(nvlhdr)); + ret = NULL; fds = NULL; - if (buf_recv(sock, buf, size) == -1) + if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr)) == -1) goto out; if (nfds > 0) { Modified: user/ngie/stable-10-libnv/lib/libnv/nvpair.c ============================================================================== --- head/lib/libnv/nvpair.c Tue Nov 12 19:39:14 2013 (r258065) +++ user/ngie/stable-10-libnv/lib/libnv/nvpair.c Tue Dec 22 23:02:12 2015 (r292631) @@ -683,10 +683,8 @@ nvpair_unpack(int flags, const unsigned if (ptr == NULL) goto failed; tmp = realloc(nvp, sizeof(*nvp) + strlen(nvp->nvp_name) + 1); - if (tmp == NULL) { - free(nvp); + if (tmp == NULL) goto failed; - } nvp = tmp; /* Update nvp_name after realloc(). */ nvp->nvp_name = (char *)(nvp + 1); Modified: user/ngie/stable-10-libnv/share/mk/bsd.libnames.mk ============================================================================== --- user/ngie/stable-10-libnv/share/mk/bsd.libnames.mk Tue Dec 22 22:52:37 2015 (r292630) +++ user/ngie/stable-10-libnv/share/mk/bsd.libnames.mk Tue Dec 22 23:02:12 2015 (r292631) @@ -100,6 +100,7 @@ LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncur LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a +LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a From owner-svn-src-user@freebsd.org Tue Dec 22 23:05:45 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 219A2A4F259 for ; Tue, 22 Dec 2015 23:05:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9542186C; Tue, 22 Dec 2015 23:05:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMN5ifw088592; Tue, 22 Dec 2015 23:05:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMN5hSd088581; Tue, 22 Dec 2015 23:05:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222305.tBMN5hSd088581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292632 - user/ngie/stable-10-libnv/lib/libnv X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:05:45 -0000 Author: ngie Date: Tue Dec 22 23:05:43 2015 New Revision: 292632 URL: https://svnweb.freebsd.org/changeset/base/292632 Log: MFC r271578,r271579,r271847,r272102,r272843,r273752,r277920,r277921,r277925,r277926,r277927,r279421,r279422,r279423: r271578 (by pjd): Remove the limit on descriptors that can be send in one nvlist. Submitted by: Mariusz Zaborski r271579 (by pjd): Use non-recursive algorithm for traversing nvlists. This also removes the limit on number of nested nvlists. Submitted by: Mariusz Zaborski r271847 (by pjd): Don't use nvl in case of a failure. Reported by: Coverity CID: 1238922 r272102 (by pjd): Document the new nvlist_get_parent() function. Submitted by: Mariusz Zaborski r272843 (by pjd): Fix problem on big endian systems introduced in r271579 - when we were returning from handling a nested nvlist we were resetting big-endian flag. Reported by: Kuleshov Aleksey @ yandex.ru Tested by: Kuleshov Aleksey @ yandex.ru r273752 (by jmg): fix typo, properly install a link to nv for nvlist_freev... r277920 (by pjd): If moving descriptor or binary data to an nvlist fails, we need to close the descriptor or free the memory before returning. Submitted by: Mariusz Zaborski While here, protect errno, so it won't be overwritted by close(2) or free(3). r277921 (by pjd): Modify nvlist_get_parent() API to take additional cookie argument. This allow for non-recursive iteration over nested nvlists, as in documented example. Submitted by: Mariusz Zaborski r277925 (by pjd): Handle empty nvlists correctly. Submitted by: Mariusz Zaborski r277926 (by pjd): Add missing nvlist_get_parent(3) link. Submitted by: Mariusz Zaborski r277927 (by pjd): Make gcc happy. Reported by: bz r279421 (by rstone): Make libnv headers includable from C++ Differential Revision: https://reviews.freebsd.org/D1868 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279422 (by rstone): Tests of basic nvlist add functions Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279423 (by rstone): Revert r279422. My "apply patch and commit" script wasn't adding new files properly. Pointy hat to: rstone Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile user/ngie/stable-10-libnv/lib/libnv/dnv.h user/ngie/stable-10-libnv/lib/libnv/msgio.c user/ngie/stable-10-libnv/lib/libnv/nv.3 user/ngie/stable-10-libnv/lib/libnv/nv.h user/ngie/stable-10-libnv/lib/libnv/nv_impl.h user/ngie/stable-10-libnv/lib/libnv/nvlist.c user/ngie/stable-10-libnv/lib/libnv/nvlist_impl.h user/ngie/stable-10-libnv/lib/libnv/nvpair.c user/ngie/stable-10-libnv/lib/libnv/nvpair_impl.h Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:05:43 2015 (r292632) @@ -60,6 +60,7 @@ MLINKS+=nv.3 nvlist_create.3 \ nv.3 nvlist_get_nvlist.3 \ nv.3 nvlist_get_descriptor.3 \ nv.3 nvlist_get_binary.3 \ + nv.3 nvlist_get_parent.3 \ nv.3 nvlist_take_bool.3 \ nv.3 nvlist_take_number.3 \ nv.3 nvlist_take_string.3 \ @@ -148,7 +149,7 @@ MLINKS+=nv.3 nvlist_existsv.3 \ nv.3 nvlist_takev_nvlist.3 \ nv.3 nvlist_takev_descriptor.3 \ nv.3 nvlist_takev_binary.3 \ - nv.3 nvlist_freef.3 \ + nv.3 nvlist_freev.3 \ nv.3 nvlist_freev_type.3 \ nv.3 nvlist_freev_null.3 \ nv.3 nvlist_freev_bool.3 \ Modified: user/ngie/stable-10-libnv/lib/libnv/dnv.h ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/dnv.h Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/dnv.h Tue Dec 22 23:05:43 2015 (r292632) @@ -45,6 +45,8 @@ struct nvlist; typedef struct nvlist nvlist_t; #endif +__BEGIN_DECLS + /* * The dnvlist_get functions returns value associated with the given name. * If it returns a pointer, the pointer represents internal buffer and should @@ -103,4 +105,6 @@ nvlist_t *dnvlist_takev_nvlist(nvlist_t int dnvlist_takev_descriptor(nvlist_t *nvl, int defval, const char *namefmt, va_list nameap) __printflike(3, 0); void *dnvlist_takev_binary(nvlist_t *nvl, size_t *sizep, void *defval, size_t defsize, const char *namefmt, va_list nameap) __printflike(5, 0); +__END_DECLS + #endif /* !_DNV_H_ */ Modified: user/ngie/stable-10-libnv/lib/libnv/msgio.c ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/msgio.c Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/msgio.c Tue Dec 22 23:05:43 2015 (r292632) @@ -31,7 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #define PJDLOG_ABORT(...) abort() #endif +#define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) + static int msghdr_add_fd(struct cmsghdr *cmsg, int fd) { @@ -234,22 +236,31 @@ cred_recv(int sock, struct cmsgcred *cre return (0); } -int -fd_send(int sock, const int *fds, size_t nfds) +static int +fd_package_send(int sock, const int *fds, size_t nfds) { struct msghdr msg; struct cmsghdr *cmsg; + struct iovec iov; unsigned int i; int serrno, ret; + uint8_t dummy; - if (nfds == 0 || fds == NULL) { - errno = EINVAL; - return (-1); - } + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(fds != NULL); + PJDLOG_ASSERT(nfds > 0); bzero(&msg, sizeof(msg)); - msg.msg_iov = NULL; - msg.msg_iovlen = 0; + + /* + * XXX: Look into cred_send function for more details. + */ + dummy = 0; + iov.iov_base = &dummy; + iov.iov_len = sizeof(dummy); + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; msg.msg_controllen = nfds * CMSG_SPACE(sizeof(int)); msg.msg_control = calloc(1, msg.msg_controllen); if (msg.msg_control == NULL) @@ -274,22 +285,32 @@ end: return (ret); } -int -fd_recv(int sock, int *fds, size_t nfds) +static int +fd_package_recv(int sock, int *fds, size_t nfds) { struct msghdr msg; struct cmsghdr *cmsg; unsigned int i; int serrno, ret; + struct iovec iov; + uint8_t dummy; - if (nfds == 0 || fds == NULL) { - errno = EINVAL; - return (-1); - } + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(nfds > 0); + PJDLOG_ASSERT(fds != NULL); + i = 0; bzero(&msg, sizeof(msg)); - msg.msg_iov = NULL; - msg.msg_iovlen = 0; + bzero(&iov, sizeof(iov)); + + /* + * XXX: Look into cred_send function for more details. + */ + iov.iov_base = &dummy; + iov.iov_len = sizeof(dummy); + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; msg.msg_controllen = nfds * CMSG_SPACE(sizeof(int)); msg.msg_control = calloc(1, msg.msg_controllen); if (msg.msg_control == NULL) @@ -333,6 +354,64 @@ end: } int +fd_recv(int sock, int *fds, size_t nfds) +{ + unsigned int i, step, j; + int ret, serrno; + + if (nfds == 0 || fds == NULL) { + errno = EINVAL; + return (-1); + } + + ret = i = step = 0; + while (i < nfds) { + if (PKG_MAX_SIZE < nfds - i) + step = PKG_MAX_SIZE; + else + step = nfds - i; + ret = fd_package_recv(sock, fds + i, step); + if (ret != 0) { + /* Close all received descriptors. */ + serrno = errno; + for (j = 0; j < i; j++) + close(fds[j]); + errno = serrno; + break; + } + i += step; + } + + return (ret); +} + +int +fd_send(int sock, const int *fds, size_t nfds) +{ + unsigned int i, step; + int ret; + + if (nfds == 0 || fds == NULL) { + errno = EINVAL; + return (-1); + } + + ret = i = step = 0; + while (i < nfds) { + if (PKG_MAX_SIZE < nfds - i) + step = PKG_MAX_SIZE; + else + step = nfds - i; + ret = fd_package_send(sock, fds + i, step); + if (ret != 0) + break; + i += step; + } + + return (ret); +} + +int buf_send(int sock, void *buf, size_t size) { ssize_t done; Modified: user/ngie/stable-10-libnv/lib/libnv/nv.3 ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nv.3 Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/nv.3 Tue Dec 22 23:05:43 2015 (r292632) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2014 +.Dd January 30, 2015 .Dt NV 3 .Os .Sh NAME @@ -150,6 +150,8 @@ .Fn nvlist_get_descriptor "const nvlist_t *nvl" "const char *name" .Ft "const void *" .Fn nvlist_get_binary "const nvlist_t *nvl" "const char *name" "size_t *sizep" +.Ft "const nvlist_t *" +.Fn nvlist_get_parent "const nvlist_t *nvl" "void **cookiep" .\" .Ft bool .Fn nvlist_take_bool "nvlist_t *nvl" "const char *name" @@ -437,6 +439,10 @@ extension, which allows to provide defau The nvlist must not be in error state. .Pp The +.Fn nvlist_get_parent +function allows to obtain the parent nvlist from the nested nvlist. +.Pp +The .Fn nvlist_take_bool , .Fn nvlist_take_number , .Fn nvlist_take_string , @@ -582,6 +588,28 @@ while ((name = nvlist_next(nvl, &type, & printf("\\n"); } .Ed +.Pp +Iterating over every nested nvlist: +.Bd -literal +nvlist_t *nvl; +const char *name; +void *cookie; +int type; + +nvl = nvlist_recv(sock); +if (nvl == NULL) + err(1, "nvlist_recv() failed"); + +cookie = NULL; +do { + while ((name = nvlist_next(nvl, &type, &cookie)) != NULL) { + if (type == NV_TYPE_NVLIST) { + nvl = nvlist_get_nvlist(nvl, name); + cookie = NULL; + } + } +} while ((nvl = nvlist_get_parent(nvl, &cookie)) != NULL); +.Ed .Sh SEE ALSO .Xr close 2 , .Xr dup 2 , Modified: user/ngie/stable-10-libnv/lib/libnv/nv.h ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nv.h Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/nv.h Tue Dec 22 23:05:43 2015 (r292632) @@ -63,6 +63,8 @@ typedef struct nvlist nvlist_t; */ #define NV_FLAG_IGNORE_CASE 0x01 +__BEGIN_DECLS + nvlist_t *nvlist_create(int flags); void nvlist_destroy(nvlist_t *nvl); int nvlist_error(const nvlist_t *nvl); @@ -83,6 +85,8 @@ nvlist_t *nvlist_xfer(int sock, nvlist_t const char *nvlist_next(const nvlist_t *nvl, int *typep, void **cookiep); +const nvlist_t *nvlist_get_parent(const nvlist_t *nvl, void **cookiep); + /* * The nvlist_exists functions check if the given name (optionally of the given * type) exists on nvlist. @@ -270,4 +274,6 @@ void nvlist_freev_nvlist(nvlist_t *nvl, void nvlist_freev_descriptor(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); void nvlist_freev_binary(nvlist_t *nvl, const char *namefmt, va_list nameap) __printflike(2, 0); +__END_DECLS + #endif /* !_NV_H_ */ Modified: user/ngie/stable-10-libnv/lib/libnv/nv_impl.h ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nv_impl.h Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/nv_impl.h Tue Dec 22 23:05:43 2015 (r292632) @@ -39,6 +39,8 @@ struct nvpair; typedef struct nvpair nvpair_t; #endif +#define NV_TYPE_NVLIST_UP 255 + #define NV_TYPE_FIRST NV_TYPE_NULL #define NV_TYPE_LAST NV_TYPE_BINARY @@ -55,6 +57,8 @@ void nvlist_add_nvpair(nvlist_t *nvl, co void nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp); +void nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent); + const nvpair_t *nvlist_get_nvpair(const nvlist_t *nvl, const char *name); nvpair_t *nvlist_take_nvpair(nvlist_t *nvl, const char *name); Modified: user/ngie/stable-10-libnv/lib/libnv/nvlist.c ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nvlist.c Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/nvlist.c Tue Dec 22 23:05:43 2015 (r292632) @@ -73,10 +73,11 @@ __FBSDID("$FreeBSD$"); #define NVLIST_MAGIC 0x6e766c /* "nvl" */ struct nvlist { - int nvl_magic; - int nvl_error; - int nvl_flags; - struct nvl_head nvl_head; + int nvl_magic; + int nvl_error; + int nvl_flags; + nvpair_t *nvl_parent; + struct nvl_head nvl_head; }; #define NVLIST_ASSERT(nvl) do { \ @@ -106,6 +107,7 @@ nvlist_create(int flags) nvl = malloc(sizeof(*nvl)); nvl->nvl_error = 0; nvl->nvl_flags = flags; + nvl->nvl_parent = NULL; TAILQ_INIT(&nvl->nvl_head); nvl->nvl_magic = NVLIST_MAGIC; @@ -147,6 +149,40 @@ nvlist_error(const nvlist_t *nvl) return (nvl->nvl_error); } +nvpair_t * +nvlist_get_nvpair_parent(const nvlist_t *nvl) +{ + + NVLIST_ASSERT(nvl); + + return (nvl->nvl_parent); +} + +const nvlist_t * +nvlist_get_parent(const nvlist_t *nvl, void **cookiep) +{ + nvpair_t *nvp; + + NVLIST_ASSERT(nvl); + + nvp = nvl->nvl_parent; + if (cookiep != NULL) + *cookiep = nvp; + if (nvp == NULL) + return (NULL); + + return (nvpair_nvlist(nvp)); +} + +void +nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent) +{ + + NVLIST_ASSERT(nvl); + + nvl->nvl_parent = parent; +} + bool nvlist_empty(const nvlist_t *nvl) { @@ -301,24 +337,36 @@ nvlist_clone(const nvlist_t *nvl) return (newnvl); } -/* - * Dump content of nvlist. - */ -static void -nvlist_xdump(const nvlist_t *nvl, int fd, int level) +static bool +nvlist_dump_error_check(const nvlist_t *nvl, int fd, int level) { - nvpair_t *nvp; - - PJDLOG_ASSERT(level < 3); if (nvlist_error(nvl) != 0) { dprintf(fd, "%*serror: %d\n", level * 4, "", nvlist_error(nvl)); - return; + return (true); } - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; - nvp = nvlist_next_nvpair(nvl, nvp)) { + return (false); +} + +/* + * Dump content of nvlist. + */ +void +nvlist_dump(const nvlist_t *nvl, int fd) +{ + const nvlist_t *tmpnvl; + nvpair_t *nvp, *tmpnvp; + void *cookie; + int level; + + level = 0; + if (nvlist_dump_error_check(nvl, fd, level)) + return; + + nvp = nvlist_first_nvpair(nvl); + while (nvp != NULL) { dprintf(fd, "%*s%s (%s):", level * 4, "", nvpair_name(nvp), nvpair_type_string(nvpair_type(nvp))); switch (nvpair_type(nvp)) { @@ -340,7 +388,16 @@ nvlist_xdump(const nvlist_t *nvl, int fd break; case NV_TYPE_NVLIST: dprintf(fd, "\n"); - nvlist_xdump(nvpair_get_nvlist(nvp), fd, level + 1); + tmpnvl = nvpair_get_nvlist(nvp); + if (nvlist_dump_error_check(tmpnvl, fd, level + 1)) + break; + tmpnvp = nvlist_first_nvpair(tmpnvl); + if (tmpnvp != NULL) { + nvl = tmpnvl; + nvp = tmpnvp; + level++; + continue; + } break; case NV_TYPE_DESCRIPTOR: dprintf(fd, " %d\n", nvpair_get_descriptor(nvp)); @@ -361,14 +418,16 @@ nvlist_xdump(const nvlist_t *nvl, int fd default: PJDLOG_ABORT("Unknown type: %d.", nvpair_type(nvp)); } - } -} - -void -nvlist_dump(const nvlist_t *nvl, int fd) -{ - nvlist_xdump(nvl, fd, 0); + while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { + cookie = NULL; + nvl = nvlist_get_parent(nvl, &cookie); + if (nvl == NULL) + return; + nvp = cookie; + level--; + } + } } void @@ -381,41 +440,51 @@ nvlist_fdump(const nvlist_t *nvl, FILE * /* * The function obtains size of the nvlist after nvlist_pack(). - * Additional argument 'level' allows to track how deep are we as we obtain - * size of the NV_TYPE_NVLIST elements using recursion. We allow at most - * three levels of recursion. */ -static size_t -nvlist_xsize(const nvlist_t *nvl, int level) +size_t +nvlist_size(const nvlist_t *nvl) { - const nvpair_t *nvp; + const nvlist_t *tmpnvl; + const nvpair_t *nvp, *tmpnvp; + void *cookie; size_t size; NVLIST_ASSERT(nvl); PJDLOG_ASSERT(nvl->nvl_error == 0); - PJDLOG_ASSERT(level < 3); size = sizeof(struct nvlist_header); - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; - nvp = nvlist_next_nvpair(nvl, nvp)) { + nvp = nvlist_first_nvpair(nvl); + while (nvp != NULL) { size += nvpair_header_size(); size += strlen(nvpair_name(nvp)) + 1; - if (nvpair_type(nvp) == NV_TYPE_NVLIST) - size += nvlist_xsize(nvpair_get_nvlist(nvp), level + 1); - else + if (nvpair_type(nvp) == NV_TYPE_NVLIST) { + size += sizeof(struct nvlist_header); + size += nvpair_header_size() + 1; + tmpnvl = nvpair_get_nvlist(nvp); + PJDLOG_ASSERT(tmpnvl->nvl_error == 0); + tmpnvp = nvlist_first_nvpair(tmpnvl); + if (tmpnvp != NULL) { + nvl = tmpnvl; + nvp = tmpnvp; + continue; + } + } else { size += nvpair_size(nvp); + } + + while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { + cookie = NULL; + nvl = nvlist_get_parent(nvl, &cookie); + if (nvl == NULL) + goto out; + nvp = cookie; + } } +out: return (size); } -size_t -nvlist_size(const nvlist_t *nvl) -{ - - return (nvlist_xsize(nvl, 0)); -} - static int * nvlist_xdescriptors(const nvlist_t *nvl, int *descs, int level) { @@ -522,7 +591,9 @@ nvlist_xpack(const nvlist_t *nvl, int64_ { unsigned char *buf, *ptr; size_t left, size; - nvpair_t *nvp; + const nvlist_t *tmpnvl; + nvpair_t *nvp, *tmpnvp; + void *cookie; NVLIST_ASSERT(nvl); @@ -541,15 +612,68 @@ nvlist_xpack(const nvlist_t *nvl, int64_ ptr = nvlist_pack_header(nvl, ptr, &left); - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; - nvp = nvlist_next_nvpair(nvl, nvp)) { - ptr = nvpair_pack(nvp, ptr, fdidxp, &left); + nvp = nvlist_first_nvpair(nvl); + while (nvp != NULL) { + NVPAIR_ASSERT(nvp); + + nvpair_init_datasize(nvp); + ptr = nvpair_pack_header(nvp, ptr, &left); if (ptr == NULL) { free(buf); return (NULL); } + switch (nvpair_type(nvp)) { + case NV_TYPE_NULL: + ptr = nvpair_pack_null(nvp, ptr, &left); + break; + case NV_TYPE_BOOL: + ptr = nvpair_pack_bool(nvp, ptr, &left); + break; + case NV_TYPE_NUMBER: + ptr = nvpair_pack_number(nvp, ptr, &left); + break; + case NV_TYPE_STRING: + ptr = nvpair_pack_string(nvp, ptr, &left); + break; + case NV_TYPE_NVLIST: + tmpnvl = nvpair_get_nvlist(nvp); + ptr = nvlist_pack_header(tmpnvl, ptr, &left); + if (ptr == NULL) + goto out; + tmpnvp = nvlist_first_nvpair(tmpnvl); + if (tmpnvp != NULL) { + nvl = tmpnvl; + nvp = tmpnvp; + continue; + } + ptr = nvpair_pack_nvlist_up(ptr, &left); + break; + case NV_TYPE_DESCRIPTOR: + ptr = nvpair_pack_descriptor(nvp, ptr, fdidxp, &left); + break; + case NV_TYPE_BINARY: + ptr = nvpair_pack_binary(nvp, ptr, &left); + break; + default: + PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp)); + } + if (ptr == NULL) { + free(buf); + return (NULL); + } + while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { + cookie = NULL; + nvl = nvlist_get_parent(nvl, &cookie); + if (nvl == NULL) + goto out; + nvp = cookie; + ptr = nvpair_pack_nvlist_up(ptr, &left); + if (ptr == NULL) + goto out; + } } +out: if (sizep != NULL) *sizep = size; return (buf); @@ -600,9 +724,9 @@ nvlist_check_header(struct nvlist_header return (true); } -static const unsigned char * +const unsigned char * nvlist_unpack_header(nvlist_t *nvl, const unsigned char *ptr, size_t nfds, - int *flagsp, size_t *leftp) + bool *isbep, size_t *leftp) { struct nvlist_header nvlhdr; @@ -629,7 +753,8 @@ nvlist_unpack_header(nvlist_t *nvl, cons nvl->nvl_flags = (nvlhdr.nvlh_flags & NV_FLAG_PUBLIC_MASK); ptr += sizeof(nvlhdr); - *flagsp = (int)nvlhdr.nvlh_flags; + if (isbep != NULL) + *isbep = (((int)nvlhdr.nvlh_flags & NV_FLAG_BIG_ENDIAN) != 0); *leftp -= sizeof(nvlhdr); return (ptr); @@ -642,32 +767,72 @@ nvlist_t * nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds) { const unsigned char *ptr; - nvlist_t *nvl; + nvlist_t *nvl, *retnvl, *tmpnvl; nvpair_t *nvp; size_t left; - int flags; + bool isbe; left = size; ptr = buf; - nvl = nvlist_create(0); + tmpnvl = NULL; + nvl = retnvl = nvlist_create(0); if (nvl == NULL) goto failed; - ptr = nvlist_unpack_header(nvl, ptr, nfds, &flags, &left); + ptr = nvlist_unpack_header(nvl, ptr, nfds, &isbe, &left); if (ptr == NULL) goto failed; while (left > 0) { - ptr = nvpair_unpack(flags, ptr, &left, fds, nfds, &nvp); + ptr = nvpair_unpack(isbe, ptr, &left, &nvp); + if (ptr == NULL) + goto failed; + switch (nvpair_type(nvp)) { + case NV_TYPE_NULL: + ptr = nvpair_unpack_null(isbe, nvp, ptr, &left); + break; + case NV_TYPE_BOOL: + ptr = nvpair_unpack_bool(isbe, nvp, ptr, &left); + break; + case NV_TYPE_NUMBER: + ptr = nvpair_unpack_number(isbe, nvp, ptr, &left); + break; + case NV_TYPE_STRING: + ptr = nvpair_unpack_string(isbe, nvp, ptr, &left); + break; + case NV_TYPE_NVLIST: + ptr = nvpair_unpack_nvlist(isbe, nvp, ptr, &left, nfds, + &tmpnvl); + nvlist_set_parent(tmpnvl, nvp); + break; + case NV_TYPE_DESCRIPTOR: + ptr = nvpair_unpack_descriptor(isbe, nvp, ptr, &left, + fds, nfds); + break; + case NV_TYPE_BINARY: + ptr = nvpair_unpack_binary(isbe, nvp, ptr, &left); + break; + case NV_TYPE_NVLIST_UP: + if (nvl->nvl_parent == NULL) + goto failed; + nvl = nvpair_nvlist(nvl->nvl_parent); + continue; + default: + PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp)); + } if (ptr == NULL) goto failed; nvlist_move_nvpair(nvl, nvp); + if (tmpnvl != NULL) { + nvl = tmpnvl; + tmpnvl = NULL; + } } - return (nvl); + return (retnvl); failed: - nvlist_destroy(nvl); + nvlist_destroy(retnvl); return (NULL); } @@ -1328,7 +1493,8 @@ nvlist_movev_nvlist(nvlist_t *nvl, nvlis nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - nvlist_destroy(value); + if (value != NULL && nvlist_get_nvpair_parent(value) != NULL) + nvlist_destroy(value); errno = nvlist_error(nvl); return; } Modified: user/ngie/stable-10-libnv/lib/libnv/nvlist_impl.h ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nvlist_impl.h Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/nvlist_impl.h Tue Dec 22 23:05:43 2015 (r292632) @@ -40,4 +40,8 @@ void *nvlist_xpack(const nvlist_t *nvl, nvlist_t *nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds); +nvpair_t *nvlist_get_nvpair_parent(const nvlist_t *nvl); +const unsigned char *nvlist_unpack_header(nvlist_t *nvl, + const unsigned char *ptr, size_t nfds, bool *isbep, size_t *leftp); + #endif /* !_NVLIST_IMPL_H_ */ Modified: user/ngie/stable-10-libnv/lib/libnv/nvpair.c ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nvpair.c Tue Dec 22 23:02:12 2015 (r292631) +++ user/ngie/stable-10-libnv/lib/libnv/nvpair.c Tue Dec 22 23:05:43 2015 (r292632) @@ -67,7 +67,7 @@ struct nvpair { int nvp_type; uint64_t nvp_data; size_t nvp_datasize; - nvlist_t *nvp_list; /* Used for sanity checks. */ + nvlist_t *nvp_list; TAILQ_ENTRY(nvpair) nvp_next; }; @@ -90,7 +90,7 @@ nvpair_assert(const nvpair_t *nvp) NVPAIR_ASSERT(nvp); } -const nvlist_t * +nvlist_t * nvpair_nvlist(const nvpair_t *nvp) { @@ -131,6 +131,17 @@ nvpair_insert(struct nvl_head *head, nvp nvp->nvp_list = nvl; } +static void +nvpair_remove_nvlist(nvpair_t *nvp) +{ + nvlist_t *nvl; + + /* XXX: DECONST is bad, mkay? */ + nvl = __DECONST(nvlist_t *, nvpair_get_nvlist(nvp)); + PJDLOG_ASSERT(nvl != NULL); + nvlist_set_parent(nvl, NULL); +} + void nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl) { @@ -138,6 +149,9 @@ nvpair_remove(struct nvl_head *head, nvp NVPAIR_ASSERT(nvp); PJDLOG_ASSERT(nvp->nvp_list == nvl); + if (nvpair_type(nvp) == NV_TYPE_NVLIST) + nvpair_remove_nvlist(nvp); + TAILQ_REMOVE(head, nvp, nvp_next); nvp->nvp_list = NULL; } @@ -201,7 +215,7 @@ nvpair_size(const nvpair_t *nvp) return (nvp->nvp_datasize); } -static unsigned char * +unsigned char * nvpair_pack_header(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { struct nvpair_header nvphdr; @@ -227,7 +241,7 @@ nvpair_pack_header(const nvpair_t *nvp, return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp __unused) { @@ -238,7 +252,7 @@ nvpair_pack_null(const nvpair_t *nvp, un return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_bool(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { uint8_t value; @@ -256,7 +270,7 @@ nvpair_pack_bool(const nvpair_t *nvp, un return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_number(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { uint64_t value; @@ -274,7 +288,7 @@ nvpair_pack_number(const nvpair_t *nvp, return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_string(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { @@ -289,37 +303,31 @@ nvpair_pack_string(const nvpair_t *nvp, return (ptr); } -static unsigned char * -nvpair_pack_nvlist(const nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, - size_t *leftp) +unsigned char * +nvpair_pack_nvlist_up(unsigned char *ptr, size_t *leftp) { - unsigned char *data; - size_t size; - - NVPAIR_ASSERT(nvp); - PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NVLIST); - - if (nvp->nvp_datasize == 0) - return (ptr); - - data = nvlist_xpack((const nvlist_t *)(intptr_t)nvp->nvp_data, fdidxp, - &size); - if (data == NULL) - return (NULL); - - PJDLOG_ASSERT(size == nvp->nvp_datasize); - PJDLOG_ASSERT(*leftp >= nvp->nvp_datasize); + struct nvpair_header nvphdr; + size_t namesize; + const char *name = ""; - memcpy(ptr, data, nvp->nvp_datasize); - free(data); + namesize = 1; + nvphdr.nvph_type = NV_TYPE_NVLIST_UP; + nvphdr.nvph_namesize = namesize; + nvphdr.nvph_datasize = 0; + PJDLOG_ASSERT(*leftp >= sizeof(nvphdr)); + memcpy(ptr, &nvphdr, sizeof(nvphdr)); + ptr += sizeof(nvphdr); + *leftp -= sizeof(nvphdr); - ptr += nvp->nvp_datasize; - *leftp -= nvp->nvp_datasize; + PJDLOG_ASSERT(*leftp >= namesize); + memcpy(ptr, name, namesize); + ptr += namesize; + *leftp -= namesize; return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_descriptor(const nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, size_t *leftp) { @@ -349,7 +357,7 @@ nvpair_pack_descriptor(const nvpair_t *n return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_binary(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { @@ -364,17 +372,12 @@ nvpair_pack_binary(const nvpair_t *nvp, return (ptr); } -unsigned char * -nvpair_pack(nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, size_t *leftp) +void +nvpair_init_datasize(nvpair_t *nvp) { NVPAIR_ASSERT(nvp); - /* - * We have to update datasize for NV_TYPE_NVLIST on every pack, - * so that proper datasize is placed into nvpair_header - * during the nvpair_pack_header() call below. - */ if (nvp->nvp_type == NV_TYPE_NVLIST) { if (nvp->nvp_data == 0) { nvp->nvp_datasize = 0; @@ -383,42 +386,10 @@ nvpair_pack(nvpair_t *nvp, unsigned char nvlist_size((const nvlist_t *)(intptr_t)nvp->nvp_data); } } - - ptr = nvpair_pack_header(nvp, ptr, leftp); - if (ptr == NULL) - return (NULL); - - switch (nvp->nvp_type) { - case NV_TYPE_NULL: - ptr = nvpair_pack_null(nvp, ptr, leftp); - break; - case NV_TYPE_BOOL: - ptr = nvpair_pack_bool(nvp, ptr, leftp); - break; - case NV_TYPE_NUMBER: - ptr = nvpair_pack_number(nvp, ptr, leftp); - break; - case NV_TYPE_STRING: - ptr = nvpair_pack_string(nvp, ptr, leftp); - break; - case NV_TYPE_NVLIST: - ptr = nvpair_pack_nvlist(nvp, ptr, fdidxp, leftp); - break; - case NV_TYPE_DESCRIPTOR: - ptr = nvpair_pack_descriptor(nvp, ptr, fdidxp, leftp); - break; - case NV_TYPE_BINARY: - ptr = nvpair_pack_binary(nvp, ptr, leftp); - break; - default: - PJDLOG_ABORT("Invalid type (%d).", nvp->nvp_type); - } - - return (ptr); } -static const unsigned char * -nvpair_unpack_header(int flags, nvpair_t *nvp, const unsigned char *ptr, +const unsigned char * +nvpair_unpack_header(bool isbe, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp) { struct nvpair_header nvphdr; @@ -434,16 +405,18 @@ nvpair_unpack_header(int flags, nvpair_t if (nvphdr.nvph_type < NV_TYPE_FIRST) goto failed; #endif - if (nvphdr.nvph_type > NV_TYPE_LAST) + if (nvphdr.nvph_type > NV_TYPE_LAST && + nvphdr.nvph_type != NV_TYPE_NVLIST_UP) { goto failed; + } #if BYTE_ORDER == BIG_ENDIAN - if ((flags & NV_FLAG_BIG_ENDIAN) == 0) { + if (!isbe) { nvphdr.nvph_namesize = le16toh(nvphdr.nvph_namesize); nvphdr.nvph_datasize = le64toh(nvphdr.nvph_datasize); } #else - if ((flags & NV_FLAG_BIG_ENDIAN) != 0) { + if (isbe) { nvphdr.nvph_namesize = be16toh(nvphdr.nvph_namesize); nvphdr.nvph_datasize = be64toh(nvphdr.nvph_datasize); } @@ -477,8 +450,8 @@ failed: return (NULL); } -static const unsigned char * -nvpair_unpack_null(int flags __unused, nvpair_t *nvp, const unsigned char *ptr, +const unsigned char * +nvpair_unpack_null(bool isbe __unused, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp __unused) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Dec 22 23:07:03 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 108BCA4F296 for ; Tue, 22 Dec 2015 23:07:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6B9919CB; Tue, 22 Dec 2015 23:07:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMN71QD088677; Tue, 22 Dec 2015 23:07:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMN71BX088676; Tue, 22 Dec 2015 23:07:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222307.tBMN71BX088676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292633 - user/ngie/stable-10-libnv/lib/libnv X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:07:03 -0000 Author: ngie Date: Tue Dec 22 23:07:01 2015 New Revision: 292633 URL: https://svnweb.freebsd.org/changeset/base/292633 Log: Convert src.opts.mk to bsd.own.mk Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:05:43 2015 (r292632) +++ user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:07:01 2015 (r292633) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= nv SHLIBDIR?= /lib From owner-svn-src-user@freebsd.org Tue Dec 22 23:08:52 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F011BA4F336 for ; Tue, 22 Dec 2015 23:08:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F6AF1B01; Tue, 22 Dec 2015 23:08:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMN8oFd088892; Tue, 22 Dec 2015 23:08:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMN8oVd088888; Tue, 22 Dec 2015 23:08:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222308.tBMN8oVd088888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292634 - user/ngie/stable-10-libnv/lib/libnv/tests X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:08:52 -0000 Author: ngie Date: Tue Dec 22 23:08:50 2015 New Revision: 292634 URL: https://svnweb.freebsd.org/changeset/base/292634 Log: MFC r279424,r279425,r279426,r279427,r279428,r279429,r279430,r279431,r279432: r279424 (by rstone): Tests of basic nvlist add functions Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279425 (by rstone): Add tests for nvlist_clone Differential Revision: https://reviews.freebsd.org/D1870 Reviewed by: pjd, jfv Sponsored by: Sandvine Inc r279426 (by rstone): Add tests for nvlist_pack/unpack Differential Revision: https://reviews.freebsd.org/D1871 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279427 (by rstone): Add test cases for nvlist_move_* Differential Revision: https://reviews.freebsd.org/D1872 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279428 (by rstone): Add tests for nvlist_take_* Differential Revision: https://reviews.freebsd.org/D1873 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279429 (by rstone): Add tests for nvlist_free* functions Differential Revision: https://reviews.freebsd.org/D1874 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279430 (by rstone): Add tests for dnv_get_* Differential Revision: https://reviews.freebsd.org/D1875 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279431 (by rstone): Add tests for dnvlist_take_* Differential Revision: https://reviews.freebsd.org/D1876 Reviewed by: jfv, pjd Sponsored by: Sandvine Inc. r279432 (by rstone): Extend the unit test to fix the bug caught in r277925 Differential Revision: https://reviews.freebsd.org/D1888 MFC After: 1 month Sponsored by: Sandvine Inc. Added: user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc - copied, changed from r279430, head/lib/libnv/tests/dnv_tests.cc user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc - copied, changed from r279424, head/lib/libnv/tests/nv_tests.cc Modified: user/ngie/stable-10-libnv/lib/libnv/tests/Makefile user/ngie/stable-10-libnv/lib/libnv/tests/nvlist_send_recv_test.c Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/lib/libnv/tests/Makefile ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/tests/Makefile Tue Dec 22 23:07:01 2015 (r292633) +++ user/ngie/stable-10-libnv/lib/libnv/tests/Makefile Tue Dec 22 23:08:50 2015 (r292634) @@ -2,6 +2,10 @@ TESTSDIR= ${TESTSBASE}/lib/libnv +ATF_TESTS_CXX= \ + dnv_tests \ + nv_tests \ + TAP_TESTS_C+= nvlist_add_test TAP_TESTS_C+= nvlist_exists_test TAP_TESTS_C+= nvlist_free_test @@ -12,6 +16,6 @@ TAP_TESTS_C+= nvlist_send_recv_test DPADD+= ${LIBNV} LDADD+= -lnv -WARNS?= 6 +WARNS?= 3 .include Copied and modified: user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc (from r279430, head/lib/libnv/tests/dnv_tests.cc) ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Sun Mar 1 00:21:56 2015 (r279430, copy source) +++ user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc Tue Dec 22 23:08:50 2015 (r292634) @@ -274,6 +274,278 @@ ATF_TEST_CASE_BODY(dnvlist_get_binary__d nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__present); +ATF_TEST_CASE_BODY(dnvlist_take_bool__present) +{ + nvlist_t *nvl; + const char *key; + bool value; + + nvl = nvlist_create(0); + + key = "name"; + value = true; + nvlist_add_bool(nvl, key, value); + + ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, key, false), value); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__empty); +ATF_TEST_CASE_BODY(dnvlist_take_bool__empty) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, "123", false), false); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_bool__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_bool__default_value) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + nvlist_add_bool(nvl, "key", true); + + ATF_REQUIRE_EQ(dnvlist_take_bool(nvl, "otherkey", true), true); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__present); +ATF_TEST_CASE_BODY(dnvlist_take_number__present) +{ + nvlist_t *nvl; + const char *key; + uint64_t value; + + nvl = nvlist_create(0); + + key = "name"; + value = 194154; + nvlist_add_number(nvl, key, value); + + ATF_REQUIRE_EQ(dnvlist_take_number(nvl, key, 2), value); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__empty); +ATF_TEST_CASE_BODY(dnvlist_take_number__empty) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + + ATF_REQUIRE_EQ(dnvlist_take_number(nvl, "123", 126484), 126484); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_number__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_number__default_value) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + nvlist_add_number(nvl, "key", 12); + + ATF_REQUIRE_EQ(dnvlist_take_number(nvl, "otherkey", 13), 13); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__present); +ATF_TEST_CASE_BODY(dnvlist_take_string__present) +{ + nvlist_t *nvl; + const char *key; + const char *value; + char *default_val, *actual_val; + + nvl = nvlist_create(0); + + key = "name"; + value = "wrowm"; + default_val = strdup("default"); + nvlist_add_string(nvl, key, value); + + actual_val = dnvlist_take_string(nvl, key, default_val); + ATF_REQUIRE_EQ(strcmp(actual_val, value), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + free(actual_val); + free(default_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__empty); +ATF_TEST_CASE_BODY(dnvlist_take_string__empty) +{ + nvlist_t *nvl; + char *default_val, *actual_val; + + nvl = nvlist_create(0); + default_val = strdup(""); + + actual_val = dnvlist_take_string(nvl, "123", default_val); + ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_string__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_string__default_value) +{ + nvlist_t *nvl; + char *default_val, *actual_val; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "key", "foobar"); + default_val = strdup("other"); + + actual_val = dnvlist_take_string(nvl, "otherkey", default_val); + ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__present); +ATF_TEST_CASE_BODY(dnvlist_take_nvlist__present) +{ + nvlist_t *nvl; + const char *key; + nvlist_t *value, *default_val, *actual_val; + + nvl = nvlist_create(0); + + key = "name"; + value = nvlist_create(0); + default_val = nvlist_create(0); + nvlist_move_nvlist(nvl, key, value); + + actual_val = dnvlist_take_nvlist(nvl, key, default_val); + ATF_REQUIRE_EQ(actual_val, value); + ATF_REQUIRE(nvlist_empty(nvl)); + + free(actual_val); + free(default_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__empty); +ATF_TEST_CASE_BODY(dnvlist_take_nvlist__empty) +{ + nvlist_t *nvl, *actual_val; + + nvl = nvlist_create(0); + + actual_val = dnvlist_take_nvlist(nvl, "123", NULL); + ATF_REQUIRE_EQ(actual_val, NULL); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_nvlist__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_nvlist__default_value) +{ + nvlist_t *nvl; + nvlist_t *default_val, *actual_val; + + nvl = nvlist_create(0); + nvlist_move_nvlist(nvl, "key", nvlist_create(0)); + default_val = nvlist_create(0); + + actual_val = dnvlist_take_nvlist(nvl, "otherkey", default_val); + ATF_REQUIRE_EQ(actual_val, default_val); + + free(actual_val); + nvlist_destroy(nvl); +} + +static void +set_binary_value(void *&value, size_t &size, const char *str) +{ + + value = strdup(str); + size = strlen(str) + 1; /* +1 to include '\0' */ +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__present); +ATF_TEST_CASE_BODY(dnvlist_take_binary__present) +{ + nvlist_t *nvl; + const char *key; + void *value, *default_val, *actual_val; + size_t value_size, default_size, actual_size; + + nvl = nvlist_create(0); + + key = "name"; + set_binary_value(value, value_size, "fkdojvmo908"); + set_binary_value(default_val, default_size, "16546"); + nvlist_add_binary(nvl, key, value, value_size); + + actual_val = dnvlist_take_binary(nvl, key, &actual_size, default_val, + default_size); + ATF_REQUIRE_EQ(value_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, value, value_size), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + free(actual_val); + free(default_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__empty); +ATF_TEST_CASE_BODY(dnvlist_take_binary__empty) +{ + nvlist_t *nvl; + void *default_val, *actual_val; + size_t default_size, actual_size; + + nvl = nvlist_create(0); + set_binary_value(default_val, default_size, "\xa8\x89\x49\xff\xe2\x08"); + + actual_val = dnvlist_take_binary(nvl, "123", &actual_size, default_val, + default_size); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, default_val, actual_size), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_take_binary__default_value); +ATF_TEST_CASE_BODY(dnvlist_take_binary__default_value) +{ + nvlist_t *nvl; + void *default_val, *actual_val; + size_t default_size, actual_size; + + nvl = nvlist_create(0); + nvlist_add_binary(nvl, "key", "foobar", 6); + set_binary_value(default_val, default_size, "vbhag"); + + actual_val = dnvlist_take_binary(nvl, "otherkey", &actual_size, + default_val, default_size); + ATF_REQUIRE_EQ(default_size, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, default_val, default_size), 0); + + free(actual_val); + nvlist_destroy(nvl); +} + ATF_INIT_TEST_CASES(tp) { ATF_ADD_TEST_CASE(tp, dnvlist_get_bool__present); @@ -286,4 +558,20 @@ ATF_INIT_TEST_CASES(tp) ATF_ADD_TEST_CASE(tp, dnvlist_get_nvlist__default_value); ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__present); ATF_ADD_TEST_CASE(tp, dnvlist_get_binary__default_value); + + ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_bool__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_number__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_number__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_number__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_string__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_string__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_string__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_nvlist__default_value); + ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__present); + ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__empty); + ATF_ADD_TEST_CASE(tp, dnvlist_take_binary__default_value); } Copied and modified: user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc (from r279424, head/lib/libnv/tests/nv_tests.cc) ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sun Mar 1 00:20:57 2015 (r279424, copy source) +++ user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc Tue Dec 22 23:08:50 2015 (r292634) @@ -31,6 +31,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include + /* * Test that a newly created nvlist has no errors, and is empty. */ @@ -288,15 +293,895 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__si free(value); } -ATF_INIT_TEST_CASES(tp) +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__empty_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__empty_nvlist) { - ATF_ADD_TEST_CASE(tp, nvlist_create__is_empty); - ATF_ADD_TEST_CASE(tp, nvlist_add_null__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_bool__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_number__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_string__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_nvlist__single_insert); - ATF_ADD_TEST_CASE(tp, nvlist_add_binary__single_insert); + nvlist_t *nvl, *clone; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + clone = nvlist_clone(nvl); + ATF_REQUIRE(clone != NULL); + ATF_REQUIRE(clone != nvl); + ATF_REQUIRE(nvlist_empty(clone)); + + nvlist_destroy(clone); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nonempty_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__nonempty_nvlist) +{ + nvlist_t *nvl, *clone; + const char *key; + void *it; + uint64_t value; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + value = 684874; + nvlist_add_number(nvl, key, value); + + clone = nvlist_clone(nvl); + ATF_REQUIRE(clone != NULL); + ATF_REQUIRE(clone != nvl); + ATF_REQUIRE(nvlist_exists_number(clone, key)); + ATF_REQUIRE_EQ(nvlist_get_number(clone, key), value); + + /* Iterate over the nvlist; ensure that it has only our one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(clone, &type, &it), key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), NULL); + + nvlist_destroy(clone); + nvlist_destroy(nvl); +} + +static const char * const test_subnvlist_key = "nvlist"; + +static const char * const test_string_key = "string"; +static const char * const test_string_val = "59525"; + +static nvlist_t* +create_test_nvlist(void) +{ + nvlist_t *nvl, *sublist; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + sublist = nvlist_create(0); + ATF_REQUIRE(sublist != NULL); + + nvlist_add_string(sublist, test_string_key, test_string_val); + nvlist_move_nvlist(nvl, test_subnvlist_key, sublist); + + return (nvl); +} + +static void +verify_test_nvlist(const nvlist_t *nvl) +{ + void *it; + const nvlist_t *value; + int type; + + ATF_REQUIRE(nvlist_exists_nvlist(nvl, test_subnvlist_key)); + + value = nvlist_get_nvlist(nvl, test_subnvlist_key); + + ATF_REQUIRE(nvlist_exists_string(value, test_string_key)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(value, test_string_key), test_string_val), 0); + ATF_REQUIRE(nvlist_get_string(value, test_string_key) != test_string_val); + + /* Iterate over both nvlists; ensure that each has only the one key. */ + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(value, &type, &it), + test_string_key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), NULL); + + it = NULL; + ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), + test_subnvlist_key), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nested_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__nested_nvlist) +{ + nvlist_t *nvl, *clone; + + nvl = create_test_nvlist(); + clone = nvlist_clone(nvl); + + ATF_REQUIRE(clone != NULL); + ATF_REQUIRE(clone != nvl); + verify_test_nvlist(clone); + + nvlist_destroy(clone); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__empty_nvlist); +ATF_TEST_CASE_BODY(nvlist_pack__empty_nvlist) +{ + nvlist_t *nvl, *unpacked; + void *packed; + size_t packed_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + + unpacked = nvlist_unpack(packed, packed_size); + ATF_REQUIRE(unpacked != NULL); + ATF_REQUIRE(unpacked != nvl); + ATF_REQUIRE(nvlist_empty(unpacked)); + + nvlist_destroy(unpacked); + nvlist_destroy(nvl); + free(packed); +} + +static void +verify_null(const nvlist_t *nvl, int type) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); +} + +static void +verify_number(const nvlist_t *nvl, const char *name, int type, uint64_t value) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, name), value); +} + +static void +verify_string(const nvlist_t *nvl, const char *name, int type, + const char * value) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, name), value), 0); +} + +static void +verify_nvlist(const nvlist_t *nvl, const char *name, int type) +{ + + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + verify_test_nvlist(nvlist_get_nvlist(nvl, name)); +} + +static void +verify_binary(const nvlist_t *nvl, const char *name, int type, + const void * value, size_t size) +{ + const void *actual_value; + size_t actual_size; + + ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); + actual_value = nvlist_get_binary(nvl, name, &actual_size); + ATF_REQUIRE_EQ(size, actual_size); + ATF_REQUIRE_EQ(memcmp(value, actual_value, size), 0); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__multiple_values); +ATF_TEST_CASE_BODY(nvlist_pack__multiple_values) +{ + std::ostringstream msg; + std::set keys_seen; + nvlist_t *nvl, *unpacked, *nvvalue; + const char *nullkey, *numkey, *strkey, *nvkey, *binkey, *name; + int numvalue; + const char * strvalue; + void *binvalue, *packed, *it; + size_t binsize, packed_size; + int type; + + nvl = nvlist_create(0); + + nullkey = "null"; + nvlist_add_null(nvl, nullkey); + + numkey = "number"; + numvalue = 939853984; + nvlist_add_number(nvl, numkey, numvalue); + + strkey = "string"; + strvalue = "jfieutijf"; + nvlist_add_string(nvl, strkey, strvalue); + + nvkey = "nvlist"; + nvvalue = create_test_nvlist(); + nvlist_move_nvlist(nvl, nvkey, nvvalue); + + binkey = "binary"; + binsize = 4; + binvalue = malloc(binsize); + memset(binvalue, 'b', binsize); + nvlist_move_binary(nvl, binkey, binvalue, binsize); + + packed = nvlist_pack(nvl, &packed_size); + ATF_REQUIRE(packed != NULL); + + unpacked = nvlist_unpack(packed, packed_size); + ATF_REQUIRE(unpacked != 0); + + it = NULL; + while ((name = nvlist_next(unpacked, &type, &it)) != NULL) { + /* Ensure that we see every key only once. */ + ATF_REQUIRE_EQ(keys_seen.count(name), 0); + + if (strcmp(name, nullkey) == 0) + verify_null(unpacked, type); + else if (strcmp(name, numkey) == 0) + verify_number(unpacked, name, type, numvalue); + else if (strcmp(name, strkey) == 0) + verify_string(unpacked, name, type, strvalue); + else if (strcmp(name, nvkey) == 0) + verify_nvlist(unpacked, name, type); + else if (strcmp(name, binkey) == 0) + verify_binary(unpacked, name, type, binvalue, binsize); + else { + msg << "Unexpected key :'" << name << "'"; + ATF_FAIL(msg.str().c_str()); + } + + keys_seen.insert(name); + } + + /* Ensure that we saw every key. */ + ATF_REQUIRE_EQ(keys_seen.size(), 5); + + nvlist_destroy(nvl); + nvlist_destroy(unpacked); + free(packed); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_unpack__duplicate_key); +ATF_TEST_CASE_BODY(nvlist_unpack__duplicate_key) +{ + nvlist_t *nvl, *unpacked; + const char *key1, *key2; + void *packed, *keypos; + size_t size, keylen; + + nvl = nvlist_create(0); + + key1 = "key1"; + keylen = strlen(key1); + nvlist_add_number(nvl, key1, 5); + + key2 = "key2"; + ATF_REQUIRE_EQ(keylen, strlen(key2)); + nvlist_add_number(nvl, key2, 10); + + packed = nvlist_pack(nvl, &size); + + /* + * Mangle the packed nvlist by replacing key1 with key2, creating a + * packed nvlist with a duplicate key. + */ + keypos = memmem(packed, size, key1, keylen); + ATF_REQUIRE(keypos != NULL); + memcpy(keypos, key2, keylen); + + unpacked = nvlist_unpack(packed, size); + ATF_REQUIRE(nvlist_error(unpacked) != 0); + + free(packed); + nvlist_destroy(nvl); + nvlist_destroy(unpacked); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_string__single_insert); +ATF_TEST_CASE_BODY(nvlist_move_string__single_insert) +{ + nvlist_t *nvl; + const char *key; + char *value; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + value = strdup("testval"); + ATF_REQUIRE(value != NULL); + + nvlist_move_string(nvl, key, value); + ATF_REQUIRE_EQ(nvlist_get_string(nvl, key), value); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__null_child); +ATF_TEST_CASE_BODY(nvlist_move_nvlist__null_child) +{ + nvlist_t *parent; + + parent = nvlist_create(0); + + nvlist_move_nvlist(parent, "test", NULL); + + ATF_REQUIRE(nvlist_error(parent) != 0); + + nvlist_destroy(parent); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__single_insert); +ATF_TEST_CASE_BODY(nvlist_move_nvlist__single_insert) +{ + nvlist_t *nvl; + const char *key; + nvlist_t *value; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + value = nvlist_create(0); + ATF_REQUIRE(value != NULL); + + nvlist_move_nvlist(nvl, key, value); + ATF_REQUIRE_EQ(nvlist_get_nvlist(nvl, key), value); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_binary__single_insert); +ATF_TEST_CASE_BODY(nvlist_move_binary__single_insert) +{ + nvlist_t *nvl; + const char *key; + void *value; + size_t size, actual_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + key = "testkey"; + size = 73; + value = malloc(size); + ATF_REQUIRE(value != NULL); + + nvlist_move_binary(nvl, key, value, size); + ATF_REQUIRE_EQ(nvlist_get_binary(nvl, key, &actual_size), value); + ATF_REQUIRE_EQ(size, actual_size); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_bool__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + bool testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "boolkey"; + testval = false; + nvlist_add_bool(nvl, testkey, testval); + + ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_bool__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + bool testval, otherval1; + nvlist_t *otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "boolkey"; + testval = true; + nvlist_add_bool(nvl, testkey, testval); + + otherkey1 = "key1"; + otherval1 = false; + nvlist_add_bool(nvl, otherkey1, otherval1); + + otherkey2 = "key2"; + otherval2 = create_test_nvlist(); + nvlist_move_nvlist(nvl, otherkey2, otherval2); + + ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval); + + ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey1)); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey1), otherval1); + + ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey2)); + verify_test_nvlist(nvlist_get_nvlist(nvl, otherkey2)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_number__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + uint64_t testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testval = std::numeric_limits::max(); + nvlist_add_number(nvl, testkey, testval); + + ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_number__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + uint64_t testval, otherval1; + const char *otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + otherkey1 = "key1"; + otherval1 = 5; + nvlist_add_number(nvl, otherkey1, otherval1); + + testkey = "numkey"; + testval = 1654; + nvlist_add_number(nvl, testkey, testval); + + otherkey2 = "key2"; + otherval2 = "string"; + nvlist_add_string(nvl, otherkey2, otherval2); + + ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval); + + ATF_REQUIRE(nvlist_exists_number(nvl, otherkey1)); + ATF_REQUIRE_EQ(nvlist_get_number(nvl, otherkey1), otherval1); + + ATF_REQUIRE(nvlist_exists_string(nvl, otherkey2)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey2), otherval2), 0); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_string__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + const char *testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testval = "nvlist"; + nvlist_add_string(nvl, testkey, testval); + + ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_string__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + const char *testval, *otherval1; + bool otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + otherkey1 = "key1"; + otherval1 = "fjdifjdk"; + nvlist_add_string(nvl, otherkey1, otherval1); + + otherkey2 = "key2"; + otherval2 = true; + nvlist_add_bool(nvl, otherkey2, otherval2); + + testkey = "strkey"; + testval = "1654"; + nvlist_add_string(nvl, testkey, testval); + + ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0); + + ATF_REQUIRE(nvlist_exists_string(nvl, otherkey1)); + ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey1), otherval1), 0); + + ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2)); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_nvlist__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + nvlist_t *testval; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testval = create_test_nvlist(); + nvlist_move_nvlist(nvl, testkey, testval); + + verify_test_nvlist(nvlist_take_nvlist(nvl, testkey)); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_nvlist__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + nvlist_t *testval, *otherval1; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "strkey"; + testval = create_test_nvlist(); + nvlist_move_nvlist(nvl, testkey, testval); + + otherkey1 = "key1"; + otherval1 = nvlist_create(0); + nvlist_move_nvlist(nvl, otherkey1, otherval1); + + otherkey2 = "key2"; + nvlist_add_null(nvl, otherkey2); + + verify_test_nvlist(nvlist_take_nvlist(nvl, testkey)); + + ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey1)); + ATF_REQUIRE(nvlist_empty(nvlist_get_nvlist(nvl, otherkey1))); + + ATF_REQUIRE(nvlist_exists_null(nvl, otherkey2)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__single_remove); +ATF_TEST_CASE_BODY(nvlist_take_binary__single_remove) +{ + nvlist_t *nvl; + const char *testkey; + void *testval; + const void *actual_val; + size_t testsize, actual_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + testkey = "numkey"; + testsize = 457; + testval = malloc(testsize); + memset(testval, '5', testsize); + nvlist_move_binary(nvl, testkey, testval, testsize); + + actual_val = nvlist_take_binary(nvl, testkey, &actual_size); + ATF_REQUIRE_EQ(testsize, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_val, testval, testsize), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__other_keys_unchanged); +ATF_TEST_CASE_BODY(nvlist_take_binary__other_keys_unchanged) +{ + nvlist_t *nvl; + const char *testkey, *otherkey1, *otherkey2; + const void *actual_value; + char testval[] = "gjiertj"; + char otherval1[] = "fdreg"; + size_t testsize, othersize, actual_size; + bool otherval2; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + otherkey1 = "key1"; + othersize = sizeof(otherval1); + nvlist_add_binary(nvl, otherkey1, otherval1, othersize); + + otherkey2 = "key2"; + otherval2 = true; + nvlist_add_bool(nvl, otherkey2, otherval2); + + testkey = "strkey"; + testsize = sizeof(testval); + nvlist_add_binary(nvl, testkey, testval, testsize); + + actual_value = nvlist_take_binary(nvl, testkey, &actual_size); + ATF_REQUIRE_EQ(testsize, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, testval, testsize), 0); + + ATF_REQUIRE(nvlist_exists_binary(nvl, otherkey1)); + actual_value = nvlist_get_binary(nvl, otherkey1, &actual_size); + ATF_REQUIRE_EQ(othersize, actual_size); + ATF_REQUIRE_EQ(memcmp(actual_value, otherval1, othersize), 0); + + ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2)); + ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_null); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Dec 22 23:10:19 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8730A4F39C for ; Tue, 22 Dec 2015 23:10:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CAB21C1F; Tue, 22 Dec 2015 23:10:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMNAIMD089019; Tue, 22 Dec 2015 23:10:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMNAIXu089018; Tue, 22 Dec 2015 23:10:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222310.tBMNAIXu089018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292635 - user/ngie/stable-10-libnv/lib/libnv X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:10:19 -0000 Author: ngie Date: Tue Dec 22 23:10:18 2015 New Revision: 292635 URL: https://svnweb.freebsd.org/changeset/base/292635 Log: MFC r271241: Include src.opts.mk after SHLIBDIR has been defined so libnv is installed to /lib , not /usr/lib Approved by: rpaulo (mentor) Submitted by: antoine Pointyhat to: me Phabric: D739 Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:08:50 2015 (r292634) +++ user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:10:18 2015 (r292635) @@ -1,9 +1,10 @@ # $FreeBSD$ +SHLIBDIR?= /lib + .include LIB= nv -SHLIBDIR?= /lib SHLIB_MAJOR= 0 SRCS= dnvlist.c From owner-svn-src-user@freebsd.org Tue Dec 22 23:11:50 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C36D7A4F4B4 for ; Tue, 22 Dec 2015 23:11:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 937D11DD6; Tue, 22 Dec 2015 23:11:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMNBnDG091104; Tue, 22 Dec 2015 23:11:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMNBn4Z091103; Tue, 22 Dec 2015 23:11:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222311.tBMNBn4Z091103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292636 - user/ngie/stable-10-libnv/lib/libnv X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:11:50 -0000 Author: ngie Date: Tue Dec 22 23:11:49 2015 New Revision: 292636 URL: https://svnweb.freebsd.org/changeset/base/292636 Log: MFC r271026,r271027,r271028: r271026 (by pjd): Fix descriptors leak in case of nvlist_xunpack() failure. Submitted by: Mariusz Zaborski r271027 (by pjd): Declare i. Reported by: sbruno r271028 (by pjd): Use better type for i. Modified: user/ngie/stable-10-libnv/lib/libnv/nvlist.c Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/lib/libnv/nvlist.c ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nvlist.c Tue Dec 22 23:10:18 2015 (r292635) +++ user/ngie/stable-10-libnv/lib/libnv/nvlist.c Tue Dec 22 23:11:49 2015 (r292636) @@ -892,7 +892,7 @@ nvlist_recv(int sock) struct nvlist_header nvlhdr; nvlist_t *nvl, *ret; unsigned char *buf; - size_t nfds, size; + size_t nfds, size, i; int serrno, *fds; if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1) @@ -925,8 +925,11 @@ nvlist_recv(int sock) } nvl = nvlist_xunpack(buf, size, fds, nfds); - if (nvl == NULL) + if (nvl == NULL) { + for (i = 0; i < nfds; i++) + close(fds[i]); goto out; + } ret = nvl; out: From owner-svn-src-user@freebsd.org Tue Dec 22 23:21:08 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 118C8A4F703 for ; Tue, 22 Dec 2015 23:21:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E17E119E; Tue, 22 Dec 2015 23:21:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMNL6fb092307; Tue, 22 Dec 2015 23:21:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMNL6jH092301; Tue, 22 Dec 2015 23:21:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222321.tBMNL6jH092301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 23:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292637 - in user/ngie/stable-10-libnv: lib/libnv lib/libnv/tests sys/conf sys/kern sys/sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:21:08 -0000 Author: ngie Date: Tue Dec 22 23:21:06 2015 New Revision: 292637 URL: https://svnweb.freebsd.org/changeset/base/292637 Log: MFC r279434,r279435,r279436,r279438,r279439,r279440,r279760,r282254,r282257,r282304,r282312: r279434 (by rstone): Add function to force an nvlist into the error state Add an nvlist_set_error() function that can be used to force an nvlist into the error state. This is useful both for writing tests and for writing APIs that use nvlists internally. Differential Revision: https://reviews.freebsd.org/D1878 Reviewed by: pjd, jfv MFC After: 1 month Sponsored by: Sandvine Inc. r279435 (by rstone): Don't allocate memory for operations that do not insert Almost every operation performed on an nvlist was allocating a new string to hold the key name. The nvlist_exists* family of functions would always return false if they failed to allocate the string. The rest of the functions would outright abort(). Fix the non-varargs variants of the functions to perform the requested operations directly and the varargs versions to allocate the string and call into the non-varargs versions. The varargs versions are still broken and really can't be fixed, so we might consider axing them entirely. However, now the non- varargs functions are always safe to call. Differential Revision: https://reviews.freebsd.org/D1879 Reviewed by: pjd, jfv Sponsored by: Sandvine Inc. r279436 (by rstone): Prevent creation of an invalid nvlist If an nvlist is set as a child of another nvlist with nvlist_move_nvlist then fail the operation and set the parent nvlist to the error state. Differential Revision: https://reviews.freebsd.org/D1880 Reviewers: jfv Sponsored by: Sandvine Inc r279438 (by rstone): Add macros to make code compile in kernel Make it possible to compile libnv in the kernel. Mostly this involves wrapping functions that have a different signature in the kernel and in userland (e.g. malloc()) in a macro that will conditionally expand to the right API depending on whether the code is being compiled for the kernel or not. I have also #ifdef'ed out all of file descriptor-handling code, as well as the unsafe varargs functions. Differential Revision: https://reviews.freebsd.org/D1882 Reviewed by: jfv Sponsored by: Sandvine Inc r279439 (by rstone): Move libnv into the kernel and hook it into the kernel build Differential Revision: https://reviews.freebsd.org/D1883 Reviewed by: jfv Sponsored by: Sandvine Inc. r279440 (by rstone): Fix build of nv_tests.cc nv_tests.cc managed to get two copies of several functions due to me applying a patch in an unclean working tree. My kingdom for an "svn clean" command. X-MFC-With: r279424 r279760 (by dim): Fix lib/libnv tests compilation with -std=c++11, by adding appropriate casts for NULL to invocations of the ATF_REQUIER_EQ() macro. Reviewed by: rstone, jmmv Differential Revision: https://reviews.freebsd.org/D2027 r282254 (by oshogbo): Remove the use of nvlist_.*[fv] functions from tests. Approved by: pjd (mentor) r282257 (by oshogbo): Remove the nvlist_.*[fv] functions. Those functions are problematic, because there is no way to report memory allocation problems without complicating the API, so we can either abort or potentially return invalid results. None of which is acceptable. In most cases the caller knows the size of the name, so he can allocate buffer on the stack and use snprintf(3) to prepare the name. After some discussion the conclusion is to removed those functions, which also simplifies the API. Discussed with: pjd, rstone Approved by: pjd (mentor) r282304 (by oshogbo): Sort MLINKS alphabetically. Approved by: pjd (mentor) r282312 (by oshogbo): Add nvlist_flags() function, which returns nvlist's public flags. Approved by: pjd (mentor) Added: user/ngie/stable-10-libnv/sys/kern/subr_dnvlist.c - copied, changed from r279439, head/sys/kern/subr_dnvlist.c user/ngie/stable-10-libnv/sys/kern/subr_nvlist.c - copied, changed from r279439, head/sys/kern/subr_nvlist.c user/ngie/stable-10-libnv/sys/kern/subr_nvpair.c - copied, changed from r279439, head/sys/kern/subr_nvpair.c user/ngie/stable-10-libnv/sys/sys/dnv.h - copied unchanged from r279439, head/sys/sys/dnv.h user/ngie/stable-10-libnv/sys/sys/nv.h - copied, changed from r279439, head/sys/sys/nv.h user/ngie/stable-10-libnv/sys/sys/nv_impl.h - copied, changed from r279439, head/sys/sys/nv_impl.h user/ngie/stable-10-libnv/sys/sys/nvlist_impl.h - copied unchanged from r279439, head/sys/sys/nvlist_impl.h user/ngie/stable-10-libnv/sys/sys/nvpair_impl.h - copied unchanged from r279439, head/sys/sys/nvpair_impl.h Deleted: user/ngie/stable-10-libnv/lib/libnv/dnv.h user/ngie/stable-10-libnv/lib/libnv/dnvlist.c user/ngie/stable-10-libnv/lib/libnv/nv.h user/ngie/stable-10-libnv/lib/libnv/nv_impl.h user/ngie/stable-10-libnv/lib/libnv/nvlist.c user/ngie/stable-10-libnv/lib/libnv/nvlist_impl.h user/ngie/stable-10-libnv/lib/libnv/nvpair.c user/ngie/stable-10-libnv/lib/libnv/nvpair_impl.h Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile user/ngie/stable-10-libnv/lib/libnv/nv.3 user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc user/ngie/stable-10-libnv/sys/conf/files Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/lib/libnv/Makefile ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:11:49 2015 (r292636) +++ user/ngie/stable-10-libnv/lib/libnv/Makefile Tue Dec 22 23:21:06 2015 (r292637) @@ -7,10 +7,13 @@ SHLIBDIR?= /lib LIB= nv SHLIB_MAJOR= 0 -SRCS= dnvlist.c +.PATH: ${.CURDIR}/../../sys/kern ${.CURDIR}/../../sys/sys +CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR} + +SRCS= subr_dnvlist.c SRCS+= msgio.c -SRCS+= nvlist.c -SRCS+= nvpair.c +SRCS+= subr_nvlist.c +SRCS+= subr_nvpair.c INCS= dnv.h INCS+= nv.h @@ -19,146 +22,66 @@ MAN+= nv.3 MLINKS+=nv.3 libnv.3 \ nv.3 nvlist.3 -MLINKS+=nv.3 nvlist_create.3 \ - nv.3 nvlist_destroy.3 \ - nv.3 nvlist_error.3 \ - nv.3 nvlist_empty.3 \ +MLINKS+=nv.3 nvlist_add_binary.3 \ + nv.3 nvlist_add_bool.3 \ + nv.3 nvlist_add_descriptor.3 \ + nv.3 nvlist_add_null.3 \ + nv.3 nvlist_add_number.3 \ + nv.3 nvlist_add_nvlist.3 \ + nv.3 nvlist_add_string.3 \ + nv.3 nvlist_add_stringf.3 \ + nv.3 nvlist_add_stringv.3 \ nv.3 nvlist_clone.3 \ + nv.3 nvlist_create.3 \ + nv.3 nvlist_destroy.3 \ nv.3 nvlist_dump.3 \ - nv.3 nvlist_fdump.3 \ - nv.3 nvlist_size.3 \ - nv.3 nvlist_pack.3 \ - nv.3 nvlist_unpack.3 \ - nv.3 nvlist_send.3 \ - nv.3 nvlist_recv.3 \ - nv.3 nvlist_xfer.3 \ - nv.3 nvlist_next.3 \ + nv.3 nvlist_empty.3 \ + nv.3 nvlist_error.3 \ nv.3 nvlist_exists.3 \ - nv.3 nvlist_exists_type.3 \ - nv.3 nvlist_exists_null.3 \ + nv.3 nvlist_exists_binary.3 \ nv.3 nvlist_exists_bool.3 \ + nv.3 nvlist_exists_descriptor.3 \ + nv.3 nvlist_exists_null.3 \ nv.3 nvlist_exists_number.3 \ - nv.3 nvlist_exists_string.3 \ nv.3 nvlist_exists_nvlist.3 \ - nv.3 nvlist_exists_descriptor.3 \ - nv.3 nvlist_exists_binary.3 \ - nv.3 nvlist_add_null.3 \ - nv.3 nvlist_add_bool.3 \ - nv.3 nvlist_add_number.3 \ - nv.3 nvlist_add_string.3 \ - nv.3 nvlist_add_stringf.3 \ - nv.3 nvlist_add_stringv.3 \ - nv.3 nvlist_add_nvlist.3 \ - nv.3 nvlist_add_descriptor.3 \ - nv.3 nvlist_add_binary.3 \ - nv.3 nvlist_move_string.3 \ - nv.3 nvlist_move_nvlist.3 \ - nv.3 nvlist_move_descriptor.3 \ - nv.3 nvlist_move_binary.3 \ + nv.3 nvlist_exists_string.3 \ + nv.3 nvlist_exists_type.3 \ + nv.3 nvlist_fdump.3 \ + nv.3 nvlist_flags.3 \ + nv.3 nvlist_free.3 \ + nv.3 nvlist_free_binary.3 \ + nv.3 nvlist_free_bool.3 \ + nv.3 nvlist_free_descriptor.3 \ + nv.3 nvlist_free_null.3 \ + nv.3 nvlist_free_number.3 \ + nv.3 nvlist_free_nvlist.3 \ + nv.3 nvlist_free_string.3 \ + nv.3 nvlist_free_type.3 \ + nv.3 nvlist_get_binary.3 \ nv.3 nvlist_get_bool.3 \ + nv.3 nvlist_get_descriptor.3 \ nv.3 nvlist_get_number.3 \ - nv.3 nvlist_get_string.3 \ nv.3 nvlist_get_nvlist.3 \ - nv.3 nvlist_get_descriptor.3 \ - nv.3 nvlist_get_binary.3 \ nv.3 nvlist_get_parent.3 \ + nv.3 nvlist_get_string.3 \ + nv.3 nvlist_move_binary.3 \ + nv.3 nvlist_move_descriptor.3 \ + nv.3 nvlist_move_nvlist.3 \ + nv.3 nvlist_move_string.3 \ + nv.3 nvlist_next.3 \ + nv.3 nvlist_pack.3 \ + nv.3 nvlist_recv.3 \ + nv.3 nvlist_send.3 \ + nv.3 nvlist_set_error.3 \ + nv.3 nvlist_size.3 \ + nv.3 nvlist_take_binary.3 \ nv.3 nvlist_take_bool.3 \ + nv.3 nvlist_take_descriptor.3 \ nv.3 nvlist_take_number.3 \ - nv.3 nvlist_take_string.3 \ nv.3 nvlist_take_nvlist.3 \ - nv.3 nvlist_take_descriptor.3 \ - nv.3 nvlist_take_binary.3 \ - nv.3 nvlist_free.3 \ - nv.3 nvlist_free_type.3 \ - nv.3 nvlist_free_null.3 \ - nv.3 nvlist_free_bool.3 \ - nv.3 nvlist_free_number.3 \ - nv.3 nvlist_free_string.3 \ - nv.3 nvlist_free_nvlist.3 \ - nv.3 nvlist_free_descriptor.3 \ - nv.3 nvlist_free_binary.3 -MLINKS+=nv.3 nvlist_existsf.3 \ - nv.3 nvlist_existsf_type.3 \ - nv.3 nvlist_existsf_null.3 \ - nv.3 nvlist_existsf_bool.3 \ - nv.3 nvlist_existsf_number.3 \ - nv.3 nvlist_existsf_string.3 \ - nv.3 nvlist_existsf_nvlist.3 \ - nv.3 nvlist_existsf_descriptor.3 \ - nv.3 nvlist_existsf_binary.3 \ - nv.3 nvlist_addf_null.3 \ - nv.3 nvlist_addf_bool.3 \ - nv.3 nvlist_addf_number.3 \ - nv.3 nvlist_addf_string.3 \ - nv.3 nvlist_addf_nvlist.3 \ - nv.3 nvlist_addf_descriptor.3 \ - nv.3 nvlist_addf_binary.3 \ - nv.3 nvlist_movef_string.3 \ - nv.3 nvlist_movef_nvlist.3 \ - nv.3 nvlist_movef_descriptor.3 \ - nv.3 nvlist_movef_binary.3 \ - nv.3 nvlist_getf_bool.3 \ - nv.3 nvlist_getf_number.3 \ - nv.3 nvlist_getf_string.3 \ - nv.3 nvlist_getf_nvlist.3 \ - nv.3 nvlist_getf_descriptor.3 \ - nv.3 nvlist_getf_binary.3 \ - nv.3 nvlist_takef_bool.3 \ - nv.3 nvlist_takef_number.3 \ - nv.3 nvlist_takef_string.3 \ - nv.3 nvlist_takef_nvlist.3 \ - nv.3 nvlist_takef_descriptor.3 \ - nv.3 nvlist_takef_binary.3 \ - nv.3 nvlist_freef.3 \ - nv.3 nvlist_freef_type.3 \ - nv.3 nvlist_freef_null.3 \ - nv.3 nvlist_freef_bool.3 \ - nv.3 nvlist_freef_number.3 \ - nv.3 nvlist_freef_string.3 \ - nv.3 nvlist_freef_nvlist.3 \ - nv.3 nvlist_freef_descriptor.3 \ - nv.3 nvlist_freef_binary.3 -MLINKS+=nv.3 nvlist_existsv.3 \ - nv.3 nvlist_existsv_type.3 \ - nv.3 nvlist_existsv_null.3 \ - nv.3 nvlist_existsv_bool.3 \ - nv.3 nvlist_existsv_number.3 \ - nv.3 nvlist_existsv_string.3 \ - nv.3 nvlist_existsv_nvlist.3 \ - nv.3 nvlist_existsv_descriptor.3 \ - nv.3 nvlist_existsv_binary.3 \ - nv.3 nvlist_addv_null.3 \ - nv.3 nvlist_addv_bool.3 \ - nv.3 nvlist_addv_number.3 \ - nv.3 nvlist_addv_string.3 \ - nv.3 nvlist_addv_nvlist.3 \ - nv.3 nvlist_addv_descriptor.3 \ - nv.3 nvlist_addv_binary.3 \ - nv.3 nvlist_movev_string.3 \ - nv.3 nvlist_movev_nvlist.3 \ - nv.3 nvlist_movev_descriptor.3 \ - nv.3 nvlist_movev_binary.3 \ - nv.3 nvlist_getv_bool.3 \ - nv.3 nvlist_getv_number.3 \ - nv.3 nvlist_getv_string.3 \ - nv.3 nvlist_getv_nvlist.3 \ - nv.3 nvlist_getv_descriptor.3 \ - nv.3 nvlist_getv_binary.3 \ - nv.3 nvlist_takev_bool.3 \ - nv.3 nvlist_takev_number.3 \ - nv.3 nvlist_takev_string.3 \ - nv.3 nvlist_takev_nvlist.3 \ - nv.3 nvlist_takev_descriptor.3 \ - nv.3 nvlist_takev_binary.3 \ - nv.3 nvlist_freev.3 \ - nv.3 nvlist_freev_type.3 \ - nv.3 nvlist_freev_null.3 \ - nv.3 nvlist_freev_bool.3 \ - nv.3 nvlist_freev_number.3 \ - nv.3 nvlist_freev_string.3 \ - nv.3 nvlist_freev_nvlist.3 \ - nv.3 nvlist_freev_descriptor.3 \ - nv.3 nvlist_freev_binary.3 + nv.3 nvlist_take_string.3 \ + nv.3 nvlist_unpack.3 \ + nv.3 nvlist_xfer.3 WARNS?= 6 Modified: user/ngie/stable-10-libnv/lib/libnv/nv.3 ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/nv.3 Tue Dec 22 23:11:49 2015 (r292636) +++ user/ngie/stable-10-libnv/lib/libnv/nv.3 Tue Dec 22 23:21:06 2015 (r292637) @@ -28,14 +28,16 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2015 +.Dd May 1, 2015 .Dt NV 3 .Os .Sh NAME .Nm nvlist_create , .Nm nvlist_destroy , .Nm nvlist_error , +.Nm nvlist_set_error , .Nm nvlist_empty , +.Nm nvlist_flags , .Nm nvlist_exists , .Nm nvlist_free , .Nm nvlist_clone , @@ -63,8 +65,12 @@ .Fn nvlist_destroy "nvlist_t *nvl" .Ft int .Fn nvlist_error "const nvlist_t *nvl" +.Ft void +.Fn nvlist_set_error "nvlist_t *nvl, int error" .Ft bool .Fn nvlist_empty "const nvlist_t *nvl" +.Ft int +.Fn nvlist_flags "const nvlist_t *nvl" .\" .Ft "nvlist_t *" .Fn nvlist_clone "const nvlist_t *nvl" @@ -248,8 +254,17 @@ the error will be returned. .Pp The +.Fn nvlist_set_error +function sets an nvlist to be in the error state. +Subsequent calls to +.Fn nvlist_error +will return the given error value. +This function cannot be used to clear the error state from an nvlist. +This function does nothing if the nvlist is already in the error state. +.Pp +The .Fn nvlist_empty -functions returns +function returns .Dv true if the given nvlist is empty and .Dv false @@ -257,6 +272,12 @@ otherwise. The nvlist must not be in error state. .Pp The +.Fn nvlist_flags +function returns flags used to create the nvlist with the +.Fn nvlist_create +function. +.Pp +The .Fn nvlist_clone functions clones the given nvlist. The clone shares no resources with its origin. Modified: user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc Tue Dec 22 23:11:49 2015 (r292636) +++ user/ngie/stable-10-libnv/lib/libnv/tests/dnv_tests.cc Tue Dec 22 23:21:06 2015 (r292637) @@ -45,7 +45,7 @@ ATF_TEST_CASE_BODY(dnvlist_get_bool__pre nvlist_add_bool(nvl, key, value); ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), value); - ATF_REQUIRE_EQ(dnvlist_getf_bool(nvl, false, "%c%s", 'n', "ame"), value); + ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "name", false), value); nvlist_destroy(nvl); } @@ -60,12 +60,12 @@ ATF_TEST_CASE_BODY(dnvlist_get_bool__def nvl = nvlist_create(0); ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), false); - ATF_REQUIRE_EQ(dnvlist_getf_bool(nvl, true, "%d", 123), true); + ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "123", true), true); nvlist_add_bool(nvl, key, true); ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "otherkey", true), true); - ATF_REQUIRE_EQ(dnvlist_getf_bool(nvl, false, "%d%c", 12, 'c'), false); + ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "12c", false), false); nvlist_destroy(nvl); } @@ -84,7 +84,7 @@ ATF_TEST_CASE_BODY(dnvlist_get_number__p nvlist_add_number(nvl, key, value); ATF_REQUIRE_EQ(dnvlist_get_number(nvl, key, 19), value); - ATF_REQUIRE_EQ(dnvlist_getf_number(nvl, 65, "key"), value); + ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "key", 65), value); nvlist_destroy(nvl); } @@ -99,12 +99,11 @@ ATF_TEST_CASE_BODY(dnvlist_get_number__d nvl = nvlist_create(0); ATF_REQUIRE_EQ(dnvlist_get_number(nvl, key, 5), 5); - ATF_REQUIRE_EQ(dnvlist_getf_number(nvl, 12, "%s", key), 12); + ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "1234", 5), 5); nvlist_add_number(nvl, key, 24841); - ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "hthth", 184), 184); - ATF_REQUIRE_EQ(dnvlist_getf_number(nvl, 5641, "%d", 1234), 5641); + ATF_REQUIRE_EQ(dnvlist_get_number(nvl, "1234", 5641), 5641); nvlist_destroy(nvl); } @@ -124,7 +123,7 @@ ATF_TEST_CASE_BODY(dnvlist_get_string__p ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, key, "g"), value), 0); - actual_value = dnvlist_getf_string(nvl, "rs", "%s", key); + actual_value = dnvlist_get_string(nvl, key, "rs"); ATF_REQUIRE_EQ(strcmp(actual_value, value), 0); nvlist_destroy(nvl); @@ -142,13 +141,13 @@ ATF_TEST_CASE_BODY(dnvlist_get_string__d ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, key, "bar"), "bar"), 0); - actual_value = dnvlist_getf_string(nvl, "d", "%s", key); + actual_value = dnvlist_get_string(nvl, key, "d"); ATF_REQUIRE_EQ(strcmp(actual_value, "d"), 0); nvlist_add_string(nvl, key, "cxhweh"); ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, "hthth", "fd"), "fd"), 0); - actual_value = dnvlist_getf_string(nvl, "5", "%s", "5"); + actual_value = dnvlist_get_string(nvl, "5", "5"); ATF_REQUIRE_EQ(strcmp("5", "5"), 0); nvlist_destroy(nvl); @@ -172,10 +171,6 @@ ATF_TEST_CASE_BODY(dnvlist_get_nvlist__p ATF_REQUIRE(actual_value != NULL); ATF_REQUIRE(nvlist_empty(actual_value)); - actual_value = dnvlist_getf_nvlist(nvl, NULL, "%s", key); - ATF_REQUIRE(actual_value != NULL); - ATF_REQUIRE(nvlist_empty(actual_value)); - nvlist_destroy(nvl); } @@ -191,11 +186,10 @@ ATF_TEST_CASE_BODY(dnvlist_get_nvlist__d dummy = nvlist_create(0); ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, key, dummy), dummy); - ATF_REQUIRE_EQ(dnvlist_getf_nvlist(nvl, dummy, "%s", key), dummy); nvlist_move_nvlist(nvl, key, nvlist_create(0)); ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, "456", dummy), dummy); - ATF_REQUIRE_EQ(dnvlist_getf_nvlist(nvl, dummy, "%s", "gh"), dummy); + ATF_REQUIRE_EQ(dnvlist_get_nvlist(nvl, "gh", dummy), dummy); nvlist_destroy(nvl); } @@ -226,10 +220,6 @@ ATF_TEST_CASE_BODY(dnvlist_get_binary__p ATF_REQUIRE_EQ(value_size, actual_size); ATF_REQUIRE_EQ(memcmp(actual_value, value, actual_size), 0); - actual_value = dnvlist_getf_binary(nvl, &actual_size, "g", 1, "%s", k); - ATF_REQUIRE_EQ(value_size, actual_size); - ATF_REQUIRE_EQ(memcmp(actual_value, value, actual_size), 0); - nvlist_destroy(nvl); } @@ -251,8 +241,8 @@ ATF_TEST_CASE_BODY(dnvlist_get_binary__d ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); set_const_binary_value(default_value, default_size, "atf"); - actual_value = dnvlist_getf_binary(nvl, &actual_size, default_value, - default_size, "%s", key); + actual_value = dnvlist_get_binary(nvl, key, &actual_size, default_value, + default_size); ATF_REQUIRE_EQ(default_size, actual_size); ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); @@ -266,8 +256,8 @@ ATF_TEST_CASE_BODY(dnvlist_get_binary__d set_const_binary_value(default_value, default_size, "rrhgrythtyrtgbrhgrtdsvdfbtjlkul"); - actual_value = dnvlist_getf_binary(nvl, &actual_size, default_value, - default_size, "s"); + actual_value = dnvlist_get_binary(nvl, "s", &actual_size, default_value, + default_size); ATF_REQUIRE_EQ(default_size, actual_size); ATF_REQUIRE_EQ(memcmp(actual_value, default_value, actual_size), 0); @@ -450,7 +440,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_nvlist__ nvl = nvlist_create(0); actual_val = dnvlist_take_nvlist(nvl, "123", NULL); - ATF_REQUIRE_EQ(actual_val, NULL); + ATF_REQUIRE_EQ(actual_val, static_cast(NULL)); free(actual_val); nvlist_destroy(nvl); Modified: user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc ============================================================================== --- user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc Tue Dec 22 23:11:49 2015 (r292636) +++ user/ngie/stable-10-libnv/lib/libnv/tests/nv_tests.cc Tue Dec 22 23:21:06 2015 (r292637) @@ -54,7 +54,7 @@ ATF_TEST_CASE_BODY(nvlist_create__is_emp ATF_REQUIRE(nvlist_empty(nvl)); it = NULL; - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -77,15 +77,14 @@ ATF_TEST_CASE_BODY(nvlist_add_null__sing ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); ATF_REQUIRE(nvlist_exists_null(nvl, key)); - ATF_REQUIRE(nvlist_existsf_null(nvl, "key")); + ATF_REQUIRE(nvlist_exists_null(nvl, "key")); /* Iterate over the nvlist; ensure that it has only our one key. */ it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NULL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -108,17 +107,16 @@ ATF_TEST_CASE_BODY(nvlist_add_bool__sing ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me")); + ATF_REQUIRE(nvlist_exists(nvl, "name")); ATF_REQUIRE(nvlist_exists_bool(nvl, key)); - ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e')); + ATF_REQUIRE(nvlist_exists_bool(nvl, "name")); ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true); - ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true); /* Iterate over the nvlist; ensure that it has only our one key. */ it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -143,17 +141,15 @@ ATF_TEST_CASE_BODY(nvlist_add_number__si ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123)); + ATF_REQUIRE(nvlist_exists(nvl, "foo123")); ATF_REQUIRE(nvlist_exists_number(nvl, key)); - ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key)); ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value); - ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value); /* Iterate over the nvlist; ensure that it has only our one key. */ it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -178,11 +174,10 @@ ATF_TEST_CASE_BODY(nvlist_add_string__si ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists(nvl, "test")); ATF_REQUIRE(nvlist_exists_string(nvl, key)); - ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_string(nvl, "test")); ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0); - ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0); /* nvlist_add_* is required to clone the value, so check for that. */ ATF_REQUIRE(nvlist_get_string(nvl, key) != value); @@ -191,7 +186,7 @@ ATF_TEST_CASE_BODY(nvlist_add_string__si it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -219,9 +214,9 @@ ATF_TEST_CASE_BODY(nvlist_add_nvlist__si ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists(nvl, "test")); ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); - ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_nvlist(nvl, "test")); value = nvlist_get_nvlist(nvl, key); ATF_REQUIRE(nvlist_exists_null(value, subkey)); @@ -229,20 +224,32 @@ ATF_TEST_CASE_BODY(nvlist_add_nvlist__si /* nvlist_add_* is required to clone the value, so check for that. */ ATF_REQUIRE(sublist != value); - value = nvlist_getf_nvlist(nvl, "%s", key); - ATF_REQUIRE(nvlist_exists_null(value, subkey)); - ATF_REQUIRE(sublist != value); - /* Iterate over the nvlist; ensure that it has only our one key. */ it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(sublist); nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_nvlist__child_with_error); +ATF_TEST_CASE_BODY(nvlist_add_nvlist__child_with_error) +{ + nvlist_t *nvl, *parent; + + nvl = nvlist_create(0); + parent = nvlist_create(0); + + nvlist_set_error(nvl, EBADF); + nvlist_add_nvlist(parent, "test", nvl); + ATF_REQUIRE_EQ(nvlist_error(parent), EBADF); + + nvlist_destroy(nvl); + nvlist_destroy(parent); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_add_binary__single_insert); ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert) { @@ -267,9 +274,9 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__si ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists(nvl, key)); - ATF_REQUIRE(nvlist_existsf(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists(nvl, "binary")); ATF_REQUIRE(nvlist_exists_binary(nvl, key)); - ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key)); + ATF_REQUIRE(nvlist_exists_binary(nvl, "binary")); ret_value = nvlist_get_binary(nvl, key, &ret_size); ATF_REQUIRE_EQ(value_size, ret_size); @@ -278,16 +285,11 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__si /* nvlist_add_* is required to clone the value, so check for that. */ ATF_REQUIRE(value != ret_value); - ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key); - ATF_REQUIRE_EQ(value_size, ret_size); - ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0); - ATF_REQUIRE(value != ret_value); - /* Iterate over the nvlist; ensure that it has only our one key. */ it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); free(value); @@ -336,7 +338,7 @@ ATF_TEST_CASE_BODY(nvlist_clone__nonempt it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(clone, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), static_cast(NULL)); nvlist_destroy(clone); nvlist_destroy(nvl); @@ -384,13 +386,13 @@ verify_test_nvlist(const nvlist_t *nvl) ATF_REQUIRE_EQ(strcmp(nvlist_next(value, &type, &it), test_string_key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), static_cast(NULL)); it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), test_subnvlist_key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast(NULL)); } ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nested_nvlist); @@ -409,6 +411,22 @@ ATF_TEST_CASE_BODY(nvlist_clone__nested_ nvlist_destroy(nvl); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__error_nvlist); +ATF_TEST_CASE_BODY(nvlist_clone__error_nvlist) +{ + nvlist_t *nvl, *clone; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + nvlist_set_error(nvl, ENOMEM); + + clone = nvlist_clone(nvl); + ATF_REQUIRE(clone == NULL); + + nvlist_destroy(nvl); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__empty_nvlist); ATF_TEST_CASE_BODY(nvlist_pack__empty_nvlist) { @@ -550,6 +568,24 @@ ATF_TEST_CASE_BODY(nvlist_pack__multiple free(packed); } +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_pack__error_nvlist); +ATF_TEST_CASE_BODY(nvlist_pack__error_nvlist) +{ + nvlist_t *nvl; + void *packed; + size_t size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + nvlist_set_error(nvl, ENOMEM); + + packed = nvlist_pack(nvl, &size); + ATF_REQUIRE(packed == NULL); + + nvlist_destroy(nvl); +} + ATF_TEST_CASE_WITHOUT_HEAD(nvlist_unpack__duplicate_key); ATF_TEST_CASE_BODY(nvlist_unpack__duplicate_key) { @@ -620,1778 +656,17 @@ ATF_TEST_CASE_BODY(nvlist_move_nvlist__n nvlist_destroy(parent); } -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__single_insert); -ATF_TEST_CASE_BODY(nvlist_move_nvlist__single_insert) -{ - nvlist_t *nvl; - const char *key; - nvlist_t *value; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - key = "testkey"; - value = nvlist_create(0); - ATF_REQUIRE(value != NULL); - - nvlist_move_nvlist(nvl, key, value); - ATF_REQUIRE_EQ(nvlist_get_nvlist(nvl, key), value); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_binary__single_insert); -ATF_TEST_CASE_BODY(nvlist_move_binary__single_insert) -{ - nvlist_t *nvl; - const char *key; - void *value; - size_t size, actual_size; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - key = "testkey"; - size = 73; - value = malloc(size); - ATF_REQUIRE(value != NULL); - - nvlist_move_binary(nvl, key, value, size); - ATF_REQUIRE_EQ(nvlist_get_binary(nvl, key, &actual_size), value); - ATF_REQUIRE_EQ(size, actual_size); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__single_remove); -ATF_TEST_CASE_BODY(nvlist_take_bool__single_remove) -{ - nvlist_t *nvl; - const char *testkey; - bool testval; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - testkey = "boolkey"; - testval = false; - nvlist_add_bool(nvl, testkey, testval); - - ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval); - ATF_REQUIRE(nvlist_empty(nvl)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_bool__other_keys_unchanged); -ATF_TEST_CASE_BODY(nvlist_take_bool__other_keys_unchanged) -{ - nvlist_t *nvl; - const char *testkey, *otherkey1, *otherkey2; - bool testval, otherval1; - nvlist_t *otherval2; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - testkey = "boolkey"; - testval = true; - nvlist_add_bool(nvl, testkey, testval); - - otherkey1 = "key1"; - otherval1 = false; - nvlist_add_bool(nvl, otherkey1, otherval1); - - otherkey2 = "key2"; - otherval2 = create_test_nvlist(); - nvlist_move_nvlist(nvl, otherkey2, otherval2); - - ATF_REQUIRE_EQ(nvlist_take_bool(nvl, testkey), testval); - - ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey1)); - ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey1), otherval1); - - ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey2)); - verify_test_nvlist(nvlist_get_nvlist(nvl, otherkey2)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__single_remove); -ATF_TEST_CASE_BODY(nvlist_take_number__single_remove) -{ - nvlist_t *nvl; - const char *testkey; - uint64_t testval; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - testkey = "numkey"; - testval = std::numeric_limits::max(); - nvlist_add_number(nvl, testkey, testval); - - ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval); - ATF_REQUIRE(nvlist_empty(nvl)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_number__other_keys_unchanged); -ATF_TEST_CASE_BODY(nvlist_take_number__other_keys_unchanged) -{ - nvlist_t *nvl; - const char *testkey, *otherkey1, *otherkey2; - uint64_t testval, otherval1; - const char *otherval2; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - otherkey1 = "key1"; - otherval1 = 5; - nvlist_add_number(nvl, otherkey1, otherval1); - - testkey = "numkey"; - testval = 1654; - nvlist_add_number(nvl, testkey, testval); - - otherkey2 = "key2"; - otherval2 = "string"; - nvlist_add_string(nvl, otherkey2, otherval2); - - ATF_REQUIRE_EQ(nvlist_take_number(nvl, testkey), testval); - - ATF_REQUIRE(nvlist_exists_number(nvl, otherkey1)); - ATF_REQUIRE_EQ(nvlist_get_number(nvl, otherkey1), otherval1); - - ATF_REQUIRE(nvlist_exists_string(nvl, otherkey2)); - ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey2), otherval2), 0); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__single_remove); -ATF_TEST_CASE_BODY(nvlist_take_string__single_remove) -{ - nvlist_t *nvl; - const char *testkey; - const char *testval; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - testkey = "numkey"; - testval = "nvlist"; - nvlist_add_string(nvl, testkey, testval); - - ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0); - ATF_REQUIRE(nvlist_empty(nvl)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_string__other_keys_unchanged); -ATF_TEST_CASE_BODY(nvlist_take_string__other_keys_unchanged) -{ - nvlist_t *nvl; - const char *testkey, *otherkey1, *otherkey2; - const char *testval, *otherval1; - bool otherval2; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - otherkey1 = "key1"; - otherval1 = "fjdifjdk"; - nvlist_add_string(nvl, otherkey1, otherval1); - - otherkey2 = "key2"; - otherval2 = true; - nvlist_add_bool(nvl, otherkey2, otherval2); - - testkey = "strkey"; - testval = "1654"; - nvlist_add_string(nvl, testkey, testval); - - ATF_REQUIRE_EQ(strcmp(nvlist_take_string(nvl, testkey), testval), 0); - - ATF_REQUIRE(nvlist_exists_string(nvl, otherkey1)); - ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, otherkey1), otherval1), 0); - - ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2)); - ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__single_remove); -ATF_TEST_CASE_BODY(nvlist_take_nvlist__single_remove) +ATF_TEST_CASE_WITHOUT_HEAD(nvlist_move_nvlist__child_with_error); +ATF_TEST_CASE_BODY(nvlist_move_nvlist__child_with_error) { - nvlist_t *nvl; - const char *testkey; - nvlist_t *testval; + nvlist_t *nvl, *parent; nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); + parent = nvlist_create(0); - testkey = "numkey"; - testval = create_test_nvlist(); - nvlist_move_nvlist(nvl, testkey, testval); - - verify_test_nvlist(nvlist_take_nvlist(nvl, testkey)); - ATF_REQUIRE(nvlist_empty(nvl)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_nvlist__other_keys_unchanged); -ATF_TEST_CASE_BODY(nvlist_take_nvlist__other_keys_unchanged) -{ - nvlist_t *nvl; - const char *testkey, *otherkey1, *otherkey2; - nvlist_t *testval, *otherval1; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - testkey = "strkey"; - testval = create_test_nvlist(); - nvlist_move_nvlist(nvl, testkey, testval); - - otherkey1 = "key1"; - otherval1 = nvlist_create(0); - nvlist_move_nvlist(nvl, otherkey1, otherval1); - - otherkey2 = "key2"; - nvlist_add_null(nvl, otherkey2); - - verify_test_nvlist(nvlist_take_nvlist(nvl, testkey)); - - ATF_REQUIRE(nvlist_exists_nvlist(nvl, otherkey1)); - ATF_REQUIRE(nvlist_empty(nvlist_get_nvlist(nvl, otherkey1))); - - ATF_REQUIRE(nvlist_exists_null(nvl, otherkey2)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__single_remove); -ATF_TEST_CASE_BODY(nvlist_take_binary__single_remove) -{ - nvlist_t *nvl; - const char *testkey; - void *testval; - const void *actual_val; - size_t testsize, actual_size; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - testkey = "numkey"; - testsize = 457; - testval = malloc(testsize); - memset(testval, '5', testsize); - nvlist_move_binary(nvl, testkey, testval, testsize); - - actual_val = nvlist_take_binary(nvl, testkey, &actual_size); - ATF_REQUIRE_EQ(testsize, actual_size); - ATF_REQUIRE_EQ(memcmp(actual_val, testval, testsize), 0); - ATF_REQUIRE(nvlist_empty(nvl)); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_take_binary__other_keys_unchanged); -ATF_TEST_CASE_BODY(nvlist_take_binary__other_keys_unchanged) -{ - nvlist_t *nvl; - const char *testkey, *otherkey1, *otherkey2; - const void *actual_value; - char testval[] = "gjiertj"; - char otherval1[] = "fdreg"; - size_t testsize, othersize, actual_size; - bool otherval2; - - nvl = nvlist_create(0); - ATF_REQUIRE(nvl != NULL); - - otherkey1 = "key1"; - othersize = sizeof(otherval1); - nvlist_add_binary(nvl, otherkey1, otherval1, othersize); - - otherkey2 = "key2"; - otherval2 = true; - nvlist_add_bool(nvl, otherkey2, otherval2); - - testkey = "strkey"; - testsize = sizeof(testval); - nvlist_add_binary(nvl, testkey, testval, testsize); - - actual_value = nvlist_take_binary(nvl, testkey, &actual_size); - ATF_REQUIRE_EQ(testsize, actual_size); - ATF_REQUIRE_EQ(memcmp(actual_value, testval, testsize), 0); - - ATF_REQUIRE(nvlist_exists_binary(nvl, otherkey1)); - actual_value = nvlist_get_binary(nvl, otherkey1, &actual_size); - ATF_REQUIRE_EQ(othersize, actual_size); - ATF_REQUIRE_EQ(memcmp(actual_value, otherval1, othersize), 0); - - ATF_REQUIRE(nvlist_exists_bool(nvl, otherkey2)); - ATF_REQUIRE_EQ(nvlist_get_bool(nvl, otherkey2), otherval2); - - nvlist_destroy(nvl); -} - -ATF_TEST_CASE_WITHOUT_HEAD(nvlist_free__single_null); -ATF_TEST_CASE_BODY(nvlist_free__single_null) -{ - nvlist_t *nvl; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Wed Dec 23 04:35:03 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D743A4F57B for ; Wed, 23 Dec 2015 04:35:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C4B21C10; Wed, 23 Dec 2015 04:35:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBN4Z2LE085541; Wed, 23 Dec 2015 04:35:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN4Z1SP085538; Wed, 23 Dec 2015 04:35:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230435.tBN4Z1SP085538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 04:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292642 - in user/ngie/stable-10-libnv: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/contrib/opensolaris/common/nvpair X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 04:35:03 -0000 Author: ngie Date: Wed Dec 23 04:35:01 2015 New Revision: 292642 URL: https://svnweb.freebsd.org/changeset/base/292642 Log: Revert r282122 and r288340 I'll reapply them as direct MFCs Modified: user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Wed Dec 23 03:34:43 2015 (r292641) +++ user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Wed Dec 23 04:35:01 2015 (r292642) @@ -55,6 +55,7 @@ #include "zfs_prop.h" #include "zfeature_common.h" +int aok; int libzfs_errno(libzfs_handle_t *hdl) Modified: user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Dec 23 03:34:43 2015 (r292641) +++ user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Dec 23 04:35:01 2015 (r292642) @@ -45,9 +45,7 @@ * Emulation of kernel services in userland. */ -#ifndef __FreeBSD__ int aok; -#endif uint64_t physmem; vnode_t *rootdir = (vnode_t *)0xabcd1234; char hw_serial[HW_HOSTID_LEN]; Modified: user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c ============================================================================== --- user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Wed Dec 23 03:34:43 2015 (r292641) +++ user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Wed Dec 23 04:35:01 2015 (r292642) @@ -44,14 +44,6 @@ #endif #define skip_whitespace(p) while ((*(p) == ' ') || (*(p) == '\t')) p++ -#if defined(__FreeBSD__) && !defined(_KERNEL) -/* - * libnvpair is the lowest commen denominator for ZFS related libraries, - * defining aok here makes it usable by all ZFS related libraries - */ -int aok; -#endif - /* * nvpair.c - Provides kernel & userland interfaces for manipulating * name-value pairs. @@ -1235,7 +1227,6 @@ nvpair_type_is_array(nvpair_t *nvp) data_type_t type = NVP_TYPE(nvp); if ((type == DATA_TYPE_BYTE_ARRAY) || - (type == DATA_TYPE_INT8_ARRAY) || (type == DATA_TYPE_UINT8_ARRAY) || (type == DATA_TYPE_INT16_ARRAY) || (type == DATA_TYPE_UINT16_ARRAY) || From owner-svn-src-user@freebsd.org Wed Dec 23 04:36:17 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5940BA4F5DD for ; Wed, 23 Dec 2015 04:36:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1D81D28; Wed, 23 Dec 2015 04:36:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBN4aG7U085676; Wed, 23 Dec 2015 04:36:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN4aFHu085668; Wed, 23 Dec 2015 04:36:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230436.tBN4aFHu085668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 04:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292643 - in user/ngie/stable-10-libnv: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common cddl/lib/libnvpair sys/cddl/contrib/opensolaris/common/nv... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 04:36:17 -0000 Author: ngie Date: Wed Dec 23 04:36:15 2015 New Revision: 292643 URL: https://svnweb.freebsd.org/changeset/base/292643 Log: MFC r282122,r285339,r288340: r282122 (by avg): nvpair_type_is_array: DATA_TYPE_INT8_ARRAY was not recognized To do: upstream (https://www.illumos.org/issues/5778) r285339 (by oshogbo): Rename zfs nvpair files to not colidate with our nvlist. PR: 201356 Approved by: pjd (mentor) r288340 (by avg): define aok in libnvpair which is linked to all zfs libraries that need aok This removes the circular dependency of libnvpair on libzfs / libzpool. PR: 199811 Obtained from: bapt Added: user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c - copied unchanged from r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c - copied, changed from r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c - copied unchanged from r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c Deleted: user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/nvpair_alloc_fixed.c Modified: user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c user/ngie/stable-10-libnv/cddl/lib/libnvpair/Makefile user/ngie/stable-10-libnv/sys/conf/files user/ngie/stable-10-libnv/sys/modules/zfs/Makefile Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Wed Dec 23 04:35:01 2015 (r292642) +++ user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Wed Dec 23 04:36:15 2015 (r292643) @@ -55,7 +55,6 @@ #include "zfs_prop.h" #include "zfeature_common.h" -int aok; int libzfs_errno(libzfs_handle_t *hdl) Modified: user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Dec 23 04:35:01 2015 (r292642) +++ user/ngie/stable-10-libnv/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Dec 23 04:36:15 2015 (r292643) @@ -45,7 +45,9 @@ * Emulation of kernel services in userland. */ +#ifndef __FreeBSD__ int aok; +#endif uint64_t physmem; vnode_t *rootdir = (vnode_t *)0xabcd1234; char hw_serial[HW_HOSTID_LEN]; Modified: user/ngie/stable-10-libnv/cddl/lib/libnvpair/Makefile ============================================================================== --- user/ngie/stable-10-libnv/cddl/lib/libnvpair/Makefile Wed Dec 23 04:35:01 2015 (r292642) +++ user/ngie/stable-10-libnv/cddl/lib/libnvpair/Makefile Wed Dec 23 04:36:15 2015 (r292643) @@ -7,10 +7,10 @@ LIB= nvpair SRCS= libnvpair.c \ nvpair_alloc_system.c \ - nvpair_alloc_fixed.c \ - nvpair.c \ nvpair_json.c \ - fnvpair.c + opensolaris_fnvpair.c \ + opensolaris_nvpair.c \ + opensolaris_nvpair_alloc_fixed.c WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include Copied: user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c (from r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c Wed Dec 23 04:36:15 2015 (r292643, copy of r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c) @@ -0,0 +1,512 @@ + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#include +#ifndef _KERNEL +#include +#else +#include +#include +#include +#include +#endif + +/* + * "Force" nvlist wrapper. + * + * These functions wrap the nvlist_* functions with assertions that assume + * the operation is successful. This allows the caller's code to be much + * more readable, especially for the fnvlist_lookup_* and fnvpair_value_* + * functions, which can return the requested value (rather than filling in + * a pointer). + * + * These functions use NV_UNIQUE_NAME, encoding NV_ENCODE_NATIVE, and allocate + * with KM_SLEEP. + * + * More wrappers should be added as needed -- for example + * nvlist_lookup_*_array and nvpair_value_*_array. + */ + +nvlist_t * +fnvlist_alloc(void) +{ + nvlist_t *nvl; + VERIFY0(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP)); + return (nvl); +} + +void +fnvlist_free(nvlist_t *nvl) +{ + nvlist_free(nvl); +} + +size_t +fnvlist_size(nvlist_t *nvl) +{ + size_t size; + VERIFY0(nvlist_size(nvl, &size, NV_ENCODE_NATIVE)); + return (size); +} + +/* + * Returns allocated buffer of size *sizep. Caller must free the buffer with + * fnvlist_pack_free(). + */ +char * +fnvlist_pack(nvlist_t *nvl, size_t *sizep) +{ + char *packed = 0; + VERIFY3U(nvlist_pack(nvl, &packed, sizep, NV_ENCODE_NATIVE, + KM_SLEEP), ==, 0); + return (packed); +} + +/*ARGSUSED*/ +void +fnvlist_pack_free(char *pack, size_t size) +{ +#ifdef _KERNEL + kmem_free(pack, size); +#else + free(pack); +#endif +} + +nvlist_t * +fnvlist_unpack(char *buf, size_t buflen) +{ + nvlist_t *rv; + VERIFY0(nvlist_unpack(buf, buflen, &rv, KM_SLEEP)); + return (rv); +} + +nvlist_t * +fnvlist_dup(nvlist_t *nvl) +{ + nvlist_t *rv; + VERIFY0(nvlist_dup(nvl, &rv, KM_SLEEP)); + return (rv); +} + +void +fnvlist_merge(nvlist_t *dst, nvlist_t *src) +{ + VERIFY0(nvlist_merge(dst, src, KM_SLEEP)); +} + +size_t +fnvlist_num_pairs(nvlist_t *nvl) +{ + size_t count = 0; + nvpair_t *pair; + + for (pair = nvlist_next_nvpair(nvl, 0); pair != NULL; + pair = nvlist_next_nvpair(nvl, pair)) + count++; + return (count); +} + +void +fnvlist_add_boolean(nvlist_t *nvl, const char *name) +{ + VERIFY0(nvlist_add_boolean(nvl, name)); +} + +void +fnvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val) +{ + VERIFY0(nvlist_add_boolean_value(nvl, name, val)); +} + +void +fnvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val) +{ + VERIFY0(nvlist_add_byte(nvl, name, val)); +} + +void +fnvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val) +{ + VERIFY0(nvlist_add_int8(nvl, name, val)); +} + +void +fnvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val) +{ + VERIFY0(nvlist_add_uint8(nvl, name, val)); +} + +void +fnvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val) +{ + VERIFY0(nvlist_add_int16(nvl, name, val)); +} + +void +fnvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val) +{ + VERIFY0(nvlist_add_uint16(nvl, name, val)); +} + +void +fnvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val) +{ + VERIFY0(nvlist_add_int32(nvl, name, val)); +} + +void +fnvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val) +{ + VERIFY0(nvlist_add_uint32(nvl, name, val)); +} + +void +fnvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val) +{ + VERIFY0(nvlist_add_int64(nvl, name, val)); +} + +void +fnvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val) +{ + VERIFY0(nvlist_add_uint64(nvl, name, val)); +} + +void +fnvlist_add_string(nvlist_t *nvl, const char *name, const char *val) +{ + VERIFY0(nvlist_add_string(nvl, name, val)); +} + +void +fnvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val) +{ + VERIFY0(nvlist_add_nvlist(nvl, name, val)); +} + +void +fnvlist_add_nvpair(nvlist_t *nvl, nvpair_t *pair) +{ + VERIFY0(nvlist_add_nvpair(nvl, pair)); +} + +void +fnvlist_add_boolean_array(nvlist_t *nvl, const char *name, + boolean_t *val, uint_t n) +{ + VERIFY0(nvlist_add_boolean_array(nvl, name, val, n)); +} + +void +fnvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val, uint_t n) +{ + VERIFY0(nvlist_add_byte_array(nvl, name, val, n)); +} + +void +fnvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val, uint_t n) +{ + VERIFY0(nvlist_add_int8_array(nvl, name, val, n)); +} + +void +fnvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *val, uint_t n) +{ + VERIFY0(nvlist_add_uint8_array(nvl, name, val, n)); +} + +void +fnvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val, uint_t n) +{ + VERIFY0(nvlist_add_int16_array(nvl, name, val, n)); +} + +void +fnvlist_add_uint16_array(nvlist_t *nvl, const char *name, + uint16_t *val, uint_t n) +{ + VERIFY0(nvlist_add_uint16_array(nvl, name, val, n)); +} + +void +fnvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val, uint_t n) +{ + VERIFY0(nvlist_add_int32_array(nvl, name, val, n)); +} + +void +fnvlist_add_uint32_array(nvlist_t *nvl, const char *name, + uint32_t *val, uint_t n) +{ + VERIFY0(nvlist_add_uint32_array(nvl, name, val, n)); +} + +void +fnvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val, uint_t n) +{ + VERIFY0(nvlist_add_int64_array(nvl, name, val, n)); +} + +void +fnvlist_add_uint64_array(nvlist_t *nvl, const char *name, + uint64_t *val, uint_t n) +{ + VERIFY0(nvlist_add_uint64_array(nvl, name, val, n)); +} + +void +fnvlist_add_string_array(nvlist_t *nvl, const char *name, + char * const *val, uint_t n) +{ + VERIFY0(nvlist_add_string_array(nvl, name, val, n)); +} + +void +fnvlist_add_nvlist_array(nvlist_t *nvl, const char *name, + nvlist_t **val, uint_t n) +{ + VERIFY0(nvlist_add_nvlist_array(nvl, name, val, n)); +} + +void +fnvlist_remove(nvlist_t *nvl, const char *name) +{ + VERIFY0(nvlist_remove_all(nvl, name)); +} + +void +fnvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *pair) +{ + VERIFY0(nvlist_remove_nvpair(nvl, pair)); +} + +nvpair_t * +fnvlist_lookup_nvpair(nvlist_t *nvl, const char *name) +{ + nvpair_t *rv; + VERIFY0(nvlist_lookup_nvpair(nvl, name, &rv)); + return (rv); +} + +/* returns B_TRUE if the entry exists */ +boolean_t +fnvlist_lookup_boolean(nvlist_t *nvl, const char *name) +{ + return (nvlist_lookup_boolean(nvl, name) == 0); +} + +boolean_t +fnvlist_lookup_boolean_value(nvlist_t *nvl, const char *name) +{ + boolean_t rv; + VERIFY0(nvlist_lookup_boolean_value(nvl, name, &rv)); + return (rv); +} + +uchar_t +fnvlist_lookup_byte(nvlist_t *nvl, const char *name) +{ + uchar_t rv; + VERIFY0(nvlist_lookup_byte(nvl, name, &rv)); + return (rv); +} + +int8_t +fnvlist_lookup_int8(nvlist_t *nvl, const char *name) +{ + int8_t rv; + VERIFY0(nvlist_lookup_int8(nvl, name, &rv)); + return (rv); +} + +int16_t +fnvlist_lookup_int16(nvlist_t *nvl, const char *name) +{ + int16_t rv; + VERIFY0(nvlist_lookup_int16(nvl, name, &rv)); + return (rv); +} + +int32_t +fnvlist_lookup_int32(nvlist_t *nvl, const char *name) +{ + int32_t rv; + VERIFY0(nvlist_lookup_int32(nvl, name, &rv)); + return (rv); +} + +int64_t +fnvlist_lookup_int64(nvlist_t *nvl, const char *name) +{ + int64_t rv; + VERIFY0(nvlist_lookup_int64(nvl, name, &rv)); + return (rv); +} + +uint8_t +fnvlist_lookup_uint8_t(nvlist_t *nvl, const char *name) +{ + uint8_t rv; + VERIFY0(nvlist_lookup_uint8(nvl, name, &rv)); + return (rv); +} + +uint16_t +fnvlist_lookup_uint16(nvlist_t *nvl, const char *name) +{ + uint16_t rv; + VERIFY0(nvlist_lookup_uint16(nvl, name, &rv)); + return (rv); +} + +uint32_t +fnvlist_lookup_uint32(nvlist_t *nvl, const char *name) +{ + uint32_t rv; + VERIFY0(nvlist_lookup_uint32(nvl, name, &rv)); + return (rv); +} + +uint64_t +fnvlist_lookup_uint64(nvlist_t *nvl, const char *name) +{ + uint64_t rv; + VERIFY0(nvlist_lookup_uint64(nvl, name, &rv)); + return (rv); +} + +char * +fnvlist_lookup_string(nvlist_t *nvl, const char *name) +{ + char *rv; + VERIFY0(nvlist_lookup_string(nvl, name, &rv)); + return (rv); +} + +nvlist_t * +fnvlist_lookup_nvlist(nvlist_t *nvl, const char *name) +{ + nvlist_t *rv; + VERIFY0(nvlist_lookup_nvlist(nvl, name, &rv)); + return (rv); +} + +boolean_t +fnvpair_value_boolean_value(nvpair_t *nvp) +{ + boolean_t rv; + VERIFY0(nvpair_value_boolean_value(nvp, &rv)); + return (rv); +} + +uchar_t +fnvpair_value_byte(nvpair_t *nvp) +{ + uchar_t rv; + VERIFY0(nvpair_value_byte(nvp, &rv)); + return (rv); +} + +int8_t +fnvpair_value_int8(nvpair_t *nvp) +{ + int8_t rv; + VERIFY0(nvpair_value_int8(nvp, &rv)); + return (rv); +} + +int16_t +fnvpair_value_int16(nvpair_t *nvp) +{ + int16_t rv; + VERIFY0(nvpair_value_int16(nvp, &rv)); + return (rv); +} + +int32_t +fnvpair_value_int32(nvpair_t *nvp) +{ + int32_t rv; + VERIFY0(nvpair_value_int32(nvp, &rv)); + return (rv); +} + +int64_t +fnvpair_value_int64(nvpair_t *nvp) +{ + int64_t rv; + VERIFY0(nvpair_value_int64(nvp, &rv)); + return (rv); +} + +uint8_t +fnvpair_value_uint8_t(nvpair_t *nvp) +{ + uint8_t rv; + VERIFY0(nvpair_value_uint8(nvp, &rv)); + return (rv); +} + +uint16_t +fnvpair_value_uint16(nvpair_t *nvp) +{ + uint16_t rv; + VERIFY0(nvpair_value_uint16(nvp, &rv)); + return (rv); +} + +uint32_t +fnvpair_value_uint32(nvpair_t *nvp) +{ + uint32_t rv; + VERIFY0(nvpair_value_uint32(nvp, &rv)); + return (rv); +} + +uint64_t +fnvpair_value_uint64(nvpair_t *nvp) +{ + uint64_t rv; + VERIFY0(nvpair_value_uint64(nvp, &rv)); + return (rv); +} + +char * +fnvpair_value_string(nvpair_t *nvp) +{ + char *rv; + VERIFY0(nvpair_value_string(nvp, &rv)); + return (rv); +} + +nvlist_t * +fnvpair_value_nvlist(nvpair_t *nvp) +{ + nvlist_t *rv; + VERIFY0(nvpair_value_nvlist(nvp, &rv)); + return (rv); +} Copied and modified: user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c (from r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c) ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Thu Jul 9 21:53:40 2015 (r285339, copy source) +++ user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Wed Dec 23 04:36:15 2015 (r292643) @@ -44,6 +44,14 @@ #endif #define skip_whitespace(p) while ((*(p) == ' ') || (*(p) == '\t')) p++ +#if defined(__FreeBSD__) && !defined(_KERNEL) +/* + * libnvpair is the lowest commen denominator for ZFS related libraries, + * defining aok here makes it usable by all ZFS related libraries + */ +int aok; +#endif + /* * nvpair.c - Provides kernel & userland interfaces for manipulating * name-value pairs. Copied: user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c (from r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ngie/stable-10-libnv/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c Wed Dec 23 04:36:15 2015 (r292643, copy of r285339, head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c) @@ -0,0 +1,118 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#if defined(_KERNEL) && !defined(_BOOT) +#include +#else +#include +#include +#endif + +/* + * This allocator is very simple. + * - it uses a pre-allocated buffer for memory allocations. + * - it does _not_ free memory in the pre-allocated buffer. + * + * The reason for the selected implemention is simplicity. + * This allocator is designed for the usage in interrupt context when + * the caller may not wait for free memory. + */ + +/* pre-allocated buffer for memory allocations */ +typedef struct nvbuf { + uintptr_t nvb_buf; /* address of pre-allocated buffer */ + uintptr_t nvb_lim; /* limit address in the buffer */ + uintptr_t nvb_cur; /* current address in the buffer */ +} nvbuf_t; + +/* + * Initialize the pre-allocated buffer allocator. The caller needs to supply + * + * buf address of pre-allocated buffer + * bufsz size of pre-allocated buffer + * + * nv_fixed_init() calculates the remaining members of nvbuf_t. + */ +static int +nv_fixed_init(nv_alloc_t *nva, va_list valist) +{ + uintptr_t base = va_arg(valist, uintptr_t); + uintptr_t lim = base + va_arg(valist, size_t); + nvbuf_t *nvb = (nvbuf_t *)P2ROUNDUP(base, sizeof (uintptr_t)); + + if (base == 0 || (uintptr_t)&nvb[1] > lim) + return (EINVAL); + + nvb->nvb_buf = (uintptr_t)&nvb[0]; + nvb->nvb_cur = (uintptr_t)&nvb[1]; + nvb->nvb_lim = lim; + nva->nva_arg = nvb; + + return (0); +} + +static void * +nv_fixed_alloc(nv_alloc_t *nva, size_t size) +{ + nvbuf_t *nvb = nva->nva_arg; + uintptr_t new = nvb->nvb_cur; + + if (size == 0 || new + size > nvb->nvb_lim) + return (NULL); + + nvb->nvb_cur = P2ROUNDUP(new + size, sizeof (uintptr_t)); + + return ((void *)new); +} + +/*ARGSUSED*/ +static void +nv_fixed_free(nv_alloc_t *nva, void *buf, size_t size) +{ + /* don't free memory in the pre-allocated buffer */ +} + +static void +nv_fixed_reset(nv_alloc_t *nva) +{ + nvbuf_t *nvb = nva->nva_arg; + + nvb->nvb_cur = (uintptr_t)&nvb[1]; +} + +const nv_alloc_ops_t nv_fixed_ops_def = { + nv_fixed_init, /* nv_ao_init() */ + NULL, /* nv_ao_fini() */ + nv_fixed_alloc, /* nv_ao_alloc() */ + nv_fixed_free, /* nv_ao_free() */ + nv_fixed_reset /* nv_ao_reset() */ +}; + +const nv_alloc_ops_t *nv_fixed_ops = &nv_fixed_ops_def; Modified: user/ngie/stable-10-libnv/sys/conf/files ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files Wed Dec 23 04:35:01 2015 (r292642) +++ user/ngie/stable-10-libnv/sys/conf/files Wed Dec 23 04:36:15 2015 (r292643) @@ -126,9 +126,9 @@ cddl/compat/opensolaris/kern/opensolaris cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}" -cddl/contrib/opensolaris/common/nvpair/fnvpair.c optional zfs compile-with "${ZFS_C}" -cddl/contrib/opensolaris/common/nvpair/nvpair.c optional zfs compile-with "${ZFS_C}" -cddl/contrib/opensolaris/common/nvpair/nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/unicode/u8_textprep.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/zfs/zfeature_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/zfs/zfs_comutil.c optional zfs compile-with "${ZFS_C}" Modified: user/ngie/stable-10-libnv/sys/modules/zfs/Makefile ============================================================================== --- user/ngie/stable-10-libnv/sys/modules/zfs/Makefile Wed Dec 23 04:35:01 2015 (r292642) +++ user/ngie/stable-10-libnv/sys/modules/zfs/Makefile Wed Dec 23 04:36:15 2015 (r292643) @@ -17,9 +17,9 @@ SRCS+= acl_common.c .PATH: ${SUNW}/common/avl SRCS+= avl.c .PATH: ${SUNW}/common/nvpair -SRCS+= nvpair.c -SRCS+= nvpair_alloc_fixed.c -SRCS+= fnvpair.c +SRCS+= opensolaris_nvpair.c +SRCS+= opensolaris_nvpair_alloc_fixed.c +SRCS+= opensolaris_fnvpair.c .PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/unicode SRCS+= u8_textprep.c From owner-svn-src-user@freebsd.org Wed Dec 23 09:13:54 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4574A4EC69 for ; Wed, 23 Dec 2015 09:13:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7644D1B28; Wed, 23 Dec 2015 09:13:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBN9DrQM066230; Wed, 23 Dec 2015 09:13:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN9Drjb066229; Wed, 23 Dec 2015 09:13:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230913.tBN9Drjb066229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 09:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r292648 - user/ngie/stable-10-libnv/tools/regression/lib/msun X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 09:13:54 -0000 Author: ngie Date: Wed Dec 23 09:13:53 2015 New Revision: 292648 URL: https://svnweb.freebsd.org/changeset/base/292648 Log: MFC r292327: Use fabsl instead of fabs to mute -Wabsolute-value warnings from clang because `nums[]` is an array of long doubles Sponsored by: EMC / Isilon Storage Division Modified: user/ngie/stable-10-libnv/tools/regression/lib/msun/test-invctrig.c Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/tools/regression/lib/msun/test-invctrig.c ============================================================================== --- user/ngie/stable-10-libnv/tools/regression/lib/msun/test-invctrig.c Wed Dec 23 09:11:18 2015 (r292647) +++ user/ngie/stable-10-libnv/tools/regression/lib/msun/test-invctrig.c Wed Dec 23 09:13:53 2015 (r292648) @@ -281,21 +281,21 @@ test_axes(void) for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { /* Real axis */ z = CMPLXL(nums[i], 0.0); - if (fabs(nums[i]) <= 1) { + if (fabsl(nums[i]) <= 1) { testall_tol(cacosh, z, CMPLXL(0.0, acos(nums[i])), 1); testall_tol(cacos, z, CMPLXL(acosl(nums[i]), -0.0), 1); testall_tol(casin, z, CMPLXL(asinl(nums[i]), 0.0), 1); testall_tol(catanh, z, CMPLXL(atanh(nums[i]), 0.0), 1); } else { testall_tol(cacosh, z, - CMPLXL(acosh(fabs(nums[i])), + CMPLXL(acosh(fabsl(nums[i])), (nums[i] < 0) ? pi : 0), 1); testall_tol(cacos, z, CMPLXL((nums[i] < 0) ? pi : 0, - -acosh(fabs(nums[i]))), 1); + -acosh(fabsl(nums[i]))), 1); testall_tol(casin, z, CMPLXL(copysign(pi / 2, nums[i]), - acosh(fabs(nums[i]))), 1); + acosh(fabsl(nums[i]))), 1); testall_tol(catanh, z, CMPLXL(atanh(1 / nums[i]), pi / 2), 1); }