Date: Tue, 29 Dec 2009 15:48:52 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r201203 - in user/luigi/ipfw3-head: bin/pkill cddl/contrib/opensolaris/cmd/zpool contrib/top lib/libarchive lib/libc/gen lib/libexpat lib/libgssapi lib/librpcsec_gss lib/libulog libexec... Message-ID: <200912291548.nBTFmq7V028689@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Tue Dec 29 15:48:51 2009 New Revision: 201203 URL: http://svn.freebsd.org/changeset/base/201203 Log: merge r201064-201149. Also, modify ipfw and dummynet so they use ip_len and ip_off in network format (this removes the differences between layer2 and layer3 processing) Added: user/luigi/ipfw3-head/lib/libarchive/archive_crc32.h - copied unchanged from r201149, head/lib/libarchive/archive_crc32.h user/luigi/ipfw3-head/lib/libarchive/archive_entry_xattr.c - copied unchanged from r201149, head/lib/libarchive/archive_entry_xattr.c Modified: user/luigi/ipfw3-head/bin/pkill/pkill.c user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/luigi/ipfw3-head/lib/libarchive/Makefile user/luigi/ipfw3-head/lib/libarchive/archive.h user/luigi/ipfw3-head/lib/libarchive/archive_check_magic.c user/luigi/ipfw3-head/lib/libarchive/archive_endian.h user/luigi/ipfw3-head/lib/libarchive/archive_entry.c user/luigi/ipfw3-head/lib/libarchive/archive_entry.h user/luigi/ipfw3-head/lib/libarchive/archive_entry_link_resolver.c user/luigi/ipfw3-head/lib/libarchive/archive_entry_private.h user/luigi/ipfw3-head/lib/libarchive/archive_entry_stat.c user/luigi/ipfw3-head/lib/libarchive/archive_platform.h user/luigi/ipfw3-head/lib/libarchive/archive_private.h user/luigi/ipfw3-head/lib/libarchive/archive_read.c user/luigi/ipfw3-head/lib/libarchive/archive_read_disk_entry_from_file.c user/luigi/ipfw3-head/lib/libarchive/archive_read_disk_private.h user/luigi/ipfw3-head/lib/libarchive/archive_read_disk_set_standard_lookup.c user/luigi/ipfw3-head/lib/libarchive/archive_read_open_fd.c user/luigi/ipfw3-head/lib/libarchive/archive_read_open_file.c user/luigi/ipfw3-head/lib/libarchive/archive_read_open_filename.c user/luigi/ipfw3-head/lib/libarchive/archive_read_private.h user/luigi/ipfw3-head/lib/libarchive/archive_read_support_compression_bzip2.c user/luigi/ipfw3-head/lib/libarchive/archive_read_support_compression_compress.c user/luigi/ipfw3-head/lib/libarchive/archive_read_support_compression_gzip.c user/luigi/ipfw3-head/lib/libarchive/archive_read_support_compression_program.c user/luigi/ipfw3-head/lib/libarchive/archive_read_support_format_ar.c user/luigi/ipfw3-head/lib/libarchive/archive_read_support_format_raw.c user/luigi/ipfw3-head/lib/libarchive/archive_read_support_format_zip.c user/luigi/ipfw3-head/lib/libarchive/archive_string.c user/luigi/ipfw3-head/lib/libarchive/archive_string.h user/luigi/ipfw3-head/lib/libarchive/archive_util.3 user/luigi/ipfw3-head/lib/libarchive/archive_util.c user/luigi/ipfw3-head/lib/libarchive/archive_virtual.c user/luigi/ipfw3-head/lib/libarchive/archive_write.3 user/luigi/ipfw3-head/lib/libarchive/archive_write.c user/luigi/ipfw3-head/lib/libarchive/archive_write_disk_private.h user/luigi/ipfw3-head/lib/libarchive/archive_write_disk_set_standard_lookup.c user/luigi/ipfw3-head/lib/libarchive/archive_write_open_fd.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_compression_bzip2.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_compression_compress.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_compression_gzip.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_compression_none.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_compression_program.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_compression_xz.c user/luigi/ipfw3-head/lib/libarchive/archive_write_set_format_ar.c user/luigi/ipfw3-head/lib/libarchive/config_freebsd.h user/luigi/ipfw3-head/lib/libarchive/filter_fork.h user/luigi/ipfw3-head/lib/libarchive/libarchive-formats.5 user/luigi/ipfw3-head/lib/libarchive/tar.5 user/luigi/ipfw3-head/lib/libc/gen/sem.c user/luigi/ipfw3-head/lib/libexpat/libbsdxml.3 user/luigi/ipfw3-head/lib/libgssapi/gss_mech_switch.c user/luigi/ipfw3-head/lib/librpcsec_gss/rpcsec_gss_conf.c user/luigi/ipfw3-head/lib/librpcsec_gss/svc_rpcsec_gss.c user/luigi/ipfw3-head/lib/libulog/ulog_getutxent.c user/luigi/ipfw3-head/libexec/rpc.rusersd/Makefile user/luigi/ipfw3-head/libexec/rpc.rusersd/rusers_proc.c user/luigi/ipfw3-head/libexec/rpc.rusersd/rusersd.c user/luigi/ipfw3-head/release/picobsd/qemu/PICOBSD user/luigi/ipfw3-head/release/picobsd/qemu/config user/luigi/ipfw3-head/sbin/fsck_ffs/gjournal.c user/luigi/ipfw3-head/sbin/ggate/ggated/ggated.c user/luigi/ipfw3-head/sbin/natd/natd.c user/luigi/ipfw3-head/sbin/routed/if.c user/luigi/ipfw3-head/sbin/umount/Makefile user/luigi/ipfw3-head/sbin/umount/umount.c user/luigi/ipfw3-head/share/man/man4/ifmib.4 user/luigi/ipfw3-head/share/man/man4/termios.4 user/luigi/ipfw3-head/share/man/man4/tty.4 user/luigi/ipfw3-head/share/man/man4/u3g.4 user/luigi/ipfw3-head/share/man/man4/ucom.4 user/luigi/ipfw3-head/sys/boot/ofw/libofw/ofw_disk.c user/luigi/ipfw3-head/sys/cam/ata/ata_all.c user/luigi/ipfw3-head/sys/cam/ata/ata_da.c user/luigi/ipfw3-head/sys/cddl/boot/zfs/zfsimpl.h user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/luigi/ipfw3-head/sys/dev/ksyms/ksyms.c user/luigi/ipfw3-head/sys/dev/led/led.c user/luigi/ipfw3-head/sys/dev/md/md.c user/luigi/ipfw3-head/sys/dev/sound/pcm/channel.c user/luigi/ipfw3-head/sys/dev/sound/pcm/sndstat.c user/luigi/ipfw3-head/sys/dev/usb/quirk/usb_quirk.c user/luigi/ipfw3-head/sys/dev/xen/blkfront/blkfront.c user/luigi/ipfw3-head/sys/geom/gate/g_gate.c user/luigi/ipfw3-head/sys/geom/geom_dev.c user/luigi/ipfw3-head/sys/ia64/ia64/sscdisk.c user/luigi/ipfw3-head/sys/kern/kern_conf.c user/luigi/ipfw3-head/sys/kern/kern_jail.c user/luigi/ipfw3-head/sys/kern/sched_ule.c user/luigi/ipfw3-head/sys/kern/uipc_accf.c user/luigi/ipfw3-head/sys/kern/vfs_mount.c user/luigi/ipfw3-head/sys/kern/vfs_subr.c user/luigi/ipfw3-head/sys/netgraph/atm/uni/ng_uni.c user/luigi/ipfw3-head/sys/netgraph/ng_base.c user/luigi/ipfw3-head/sys/netgraph/ng_ipfw.c user/luigi/ipfw3-head/sys/netgraph/ng_ipfw.h user/luigi/ipfw3-head/sys/netinet/ip_encap.c user/luigi/ipfw3-head/sys/netinet/ip_output.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dummynet.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw2.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_dynamic.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_log.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_nat.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_private.h user/luigi/ipfw3-head/sys/netinet/libalias/alias_mod.c user/luigi/ipfw3-head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c user/luigi/ipfw3-head/sys/sparc64/pci/schizo.c user/luigi/ipfw3-head/sys/sys/ata.h user/luigi/ipfw3-head/sys/sys/file.h user/luigi/ipfw3-head/sys/vm/uma_core.c user/luigi/ipfw3-head/tools/regression/geom/ConfCmp/ConfCmp.c user/luigi/ipfw3-head/usr.bin/finger/Makefile user/luigi/ipfw3-head/usr.bin/finger/extern.h user/luigi/ipfw3-head/usr.bin/finger/finger.c user/luigi/ipfw3-head/usr.bin/finger/finger.h user/luigi/ipfw3-head/usr.bin/finger/lprint.c user/luigi/ipfw3-head/usr.bin/finger/net.c user/luigi/ipfw3-head/usr.bin/finger/sprint.c user/luigi/ipfw3-head/usr.bin/finger/util.c user/luigi/ipfw3-head/usr.sbin/cpucontrol/cpucontrol.c user/luigi/ipfw3-head/usr.sbin/pmcstat/pmcstat_log.c user/luigi/ipfw3-head/usr.sbin/ppp/ppp.8.m4 user/luigi/ipfw3-head/usr.sbin/rpc.umntall/mounttab.c user/luigi/ipfw3-head/usr.sbin/service/service.8 user/luigi/ipfw3-head/usr.sbin/service/service.sh user/luigi/ipfw3-head/usr.sbin/ypserv/yp_main.c Directory Properties: user/luigi/ipfw3-head/ (props changed) user/luigi/ipfw3-head/cddl/contrib/opensolaris/ (props changed) user/luigi/ipfw3-head/contrib/bind9/ (props changed) user/luigi/ipfw3-head/contrib/cpio/ (props changed) user/luigi/ipfw3-head/contrib/csup/ (props changed) user/luigi/ipfw3-head/contrib/ee/ (props changed) user/luigi/ipfw3-head/contrib/expat/ (props changed) user/luigi/ipfw3-head/contrib/file/ (props changed) user/luigi/ipfw3-head/contrib/gdb/ (props changed) user/luigi/ipfw3-head/contrib/gdtoa/ (props changed) user/luigi/ipfw3-head/contrib/less/ (props changed) user/luigi/ipfw3-head/contrib/libpcap/ (props changed) user/luigi/ipfw3-head/contrib/ncurses/ (props changed) user/luigi/ipfw3-head/contrib/netcat/ (props changed) user/luigi/ipfw3-head/contrib/ntp/ (props changed) user/luigi/ipfw3-head/contrib/openbsm/ (props changed) user/luigi/ipfw3-head/contrib/openpam/ (props changed) user/luigi/ipfw3-head/contrib/pf/ (props changed) user/luigi/ipfw3-head/contrib/sendmail/ (props changed) user/luigi/ipfw3-head/contrib/tcpdump/ (props changed) user/luigi/ipfw3-head/contrib/tcsh/ (props changed) user/luigi/ipfw3-head/contrib/top/ (props changed) user/luigi/ipfw3-head/contrib/top/install-sh (props changed) user/luigi/ipfw3-head/contrib/wpa/ (props changed) user/luigi/ipfw3-head/crypto/openssh/ (props changed) user/luigi/ipfw3-head/crypto/openssl/ (props changed) user/luigi/ipfw3-head/lib/libc/ (props changed) user/luigi/ipfw3-head/lib/libc/stdtime/ (props changed) user/luigi/ipfw3-head/lib/libutil/ (props changed) user/luigi/ipfw3-head/sbin/ (props changed) user/luigi/ipfw3-head/sbin/ipfw/ (props changed) user/luigi/ipfw3-head/share/zoneinfo/ (props changed) user/luigi/ipfw3-head/sys/ (props changed) user/luigi/ipfw3-head/sys/amd64/include/xen/ (props changed) user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/ (props changed) user/luigi/ipfw3-head/sys/contrib/dev/acpica/ (props changed) user/luigi/ipfw3-head/sys/contrib/pf/ (props changed) user/luigi/ipfw3-head/sys/dev/xen/xenpci/ (props changed) user/luigi/ipfw3-head/usr.bin/csup/ (props changed) user/luigi/ipfw3-head/usr.bin/procstat/ (props changed) user/luigi/ipfw3-head/usr.sbin/zic/ (props changed) Modified: user/luigi/ipfw3-head/bin/pkill/pkill.c ============================================================================== --- user/luigi/ipfw3-head/bin/pkill/pkill.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/bin/pkill/pkill.c Tue Dec 29 15:48:51 2009 (r201203) @@ -113,14 +113,14 @@ static int cflags = REG_EXTENDED; static kvm_t *kd; static pid_t mypid; -static struct listhead euidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead ruidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead rgidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead pgrplist = SLIST_HEAD_INITIALIZER(list); -static struct listhead ppidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead sidlist = SLIST_HEAD_INITIALIZER(list); -static struct listhead jidlist = SLIST_HEAD_INITIALIZER(list); +static struct listhead euidlist = SLIST_HEAD_INITIALIZER(euidlist); +static struct listhead ruidlist = SLIST_HEAD_INITIALIZER(ruidlist); +static struct listhead rgidlist = SLIST_HEAD_INITIALIZER(rgidlist); +static struct listhead pgrplist = SLIST_HEAD_INITIALIZER(pgrplist); +static struct listhead ppidlist = SLIST_HEAD_INITIALIZER(ppidlist); +static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist); +static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist); +static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist); static void usage(void) __attribute__((__noreturn__)); static int killact(const struct kinfo_proc *); Modified: user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Dec 29 15:48:51 2009 (r201203) @@ -3488,6 +3488,8 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext(" 11 Improved scrub performance\n")); (void) printf(gettext(" 12 Snapshot properties\n")); (void) printf(gettext(" 13 snapused property\n")); + (void) printf(gettext(" 14 passthrough-x aclinherit " + "support\n")); (void) printf(gettext("For more information on a particular " "version, including supported releases, see:\n\n")); (void) printf("http://www.opensolaris.org/os/community/zfs/" Modified: user/luigi/ipfw3-head/lib/libarchive/Makefile ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/Makefile Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/Makefile Tue Dec 29 15:48:51 2009 (r201203) @@ -34,6 +34,7 @@ SRCS= archive_check_magic.c \ archive_entry_stat.c \ archive_entry_strmode.c \ archive_entry_link_resolver.c \ + archive_entry_xattr.c \ archive_read.c \ archive_read_data_into_fd.c \ archive_read_disk.c \ @@ -223,6 +224,7 @@ MLINKS+= archive_util.3 archive_compress MLINKS+= archive_util.3 archive_compression_name.3 MLINKS+= archive_util.3 archive_errno.3 MLINKS+= archive_util.3 archive_error_string.3 +MLINKS+= archive_util.3 archive_file_count.3 MLINKS+= archive_util.3 archive_format.3 MLINKS+= archive_util.3 archive_format_name.3 MLINKS+= archive_util.3 archive_set_error.3 Modified: user/luigi/ipfw3-head/lib/libarchive/archive.h ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive.h Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive.h Tue Dec 29 15:48:51 2009 (r201203) @@ -35,12 +35,16 @@ * this header! If you must conditionalize, use predefined compiler and/or * platform macros. */ +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 +# define __LA_STDINT_H <stdint.h> +#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) +# define __LA_STDINT_H <inttypes.h> +#endif #include <sys/stat.h> #include <sys/types.h> /* Linux requires this for off_t */ -#if !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) -/* Header unavailable on Watcom C or MS Visual C++ or SFU. */ -#include <inttypes.h> /* int64_t, etc. */ +#ifdef __LA_STDINT_H +# include __LA_STDINT_H /* int64_t, etc. */ #endif #include <stdio.h> /* For FILE * */ @@ -53,8 +57,13 @@ # else # define __LA_SSIZE_T long # endif -#define __LA_UID_T unsigned int -#define __LA_GID_T unsigned int +# if defined(__BORLANDC__) +# define __LA_UID_T uid_t +# define __LA_GID_T gid_t +# else +# define __LA_UID_T short +# define __LA_GID_T short +# endif #else #include <unistd.h> /* ssize_t, uid_t, and gid_t */ #define __LA_INT64_T int64_t @@ -704,6 +713,7 @@ __LA_DECL void archive_set_error(struc const char *fmt, ...); __LA_DECL void archive_copy_error(struct archive *dest, struct archive *src); +__LA_DECL int archive_file_count(struct archive *); #ifdef __cplusplus } Modified: user/luigi/ipfw3-head/lib/libarchive/archive_check_magic.c ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_check_magic.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_check_magic.c Tue Dec 29 15:48:51 2009 (r201203) @@ -50,7 +50,16 @@ __FBSDID("$FreeBSD$"); static void errmsg(const char *m) { - write(2, m, strlen(m)); + size_t s = strlen(m); + ssize_t written; + + while (s > 0) { + written = write(2, m, strlen(m)); + if (written <= 0) + return; + m += written; + s -= written; + } } static void @@ -60,8 +69,7 @@ diediedie(void) /* Cause a breakpoint exception */ DebugBreak(); #endif - *(char *)0 = 1; /* Deliberately segfault and force a coredump. */ - _exit(1); /* If that didn't work, just exit with an error. */ + abort(); /* Terminate the program abnormally. */ } static const char * @@ -85,7 +93,7 @@ write_all_states(unsigned int states) unsigned int lowbit; /* A trick for computing the lowest set bit. */ - while ((lowbit = states & (-states)) != 0) { + while ((lowbit = states & (1 + ~states)) != 0) { states &= ~lowbit; /* Clear the low bit. */ errmsg(state_name(lowbit)); if (states != 0) Copied: user/luigi/ipfw3-head/lib/libarchive/archive_crc32.h (from r201149, head/lib/libarchive/archive_crc32.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/ipfw3-head/lib/libarchive/archive_crc32.h Tue Dec 29 15:48:51 2009 (r201203, copy of r201149, head/lib/libarchive/archive_crc32.h) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2009 Joerg Sonnenberger + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 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. + * + * $FreeBSD$ + */ + +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + +/* + * When zlib is unavailable, we should still be able to validate + * uncompressed zip archives. That requires us to be able to compute + * the CRC32 check value. This is a drop-in compatible replacement + * for crc32() from zlib. It's slower than the zlib implementation, + * but still pretty fast: This runs about 300MB/s on my 3GHz P4 + * compared to about 800MB/s for the zlib implementation. + */ +static unsigned long +crc32(unsigned long crc, const void *_p, size_t len) +{ + unsigned long crc2, b, i; + const unsigned char *p = _p; + static volatile int crc_tbl_inited = 0; + static unsigned long crc_tbl[256]; + + if (!crc_tbl_inited) { + for (b = 0; b < 256; ++b) { + crc2 = b; + for (i = 8; i > 0; --i) { + if (crc2 & 1) + crc2 = (crc2 >> 1) ^ 0xedb88320UL; + else + crc2 = (crc2 >> 1); + } + crc_tbl[b] = crc2; + } + crc_tbl_inited = 1; + } + + crc = crc ^ 0xffffffffUL; + while (len--) + crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return (crc ^ 0xffffffffUL); +} Modified: user/luigi/ipfw3-head/lib/libarchive/archive_endian.h ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_endian.h Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_endian.h Tue Dec 29 15:48:51 2009 (r201203) @@ -28,6 +28,10 @@ * Borrowed from FreeBSD's <sys/endian.h> */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + /* Note: This is a purely internal header! */ /* Do not use this outside of libarchive internal code! */ @@ -41,7 +45,7 @@ * - SGI MIPSpro * - Microsoft Visual C++ 6.0 (supposedly newer versions too) */ -#if defined(__WATCOMC__) || defined(__sgi) +#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__) #define inline #elif defined(_MSC_VER) #define inline __inline Modified: user/luigi/ipfw3-head/lib/libarchive/archive_entry.c ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_entry.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_entry.c Tue Dec 29 15:48:51 2009 (r201203) @@ -32,12 +32,12 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef MAJOR_IN_MKDEV +#if MAJOR_IN_MKDEV #include <sys/mkdev.h> -#else -#ifdef MAJOR_IN_SYSMACROS +#define HAVE_MAJOR +#elif MAJOR_IN_SYSMACROS #include <sys/sysmacros.h> -#endif +#define HAVE_MAJOR #endif #ifdef HAVE_LIMITS_H #include <limits.h> @@ -75,6 +75,13 @@ __FBSDID("$FreeBSD$"); #undef max #define max(a, b) ((a)>(b)?(a):(b)) +#if !defined(HAVE_MAJOR) && !defined(major) +/* Replacement for major/minor/makedev. */ +#define major(x) ((int)(0x00ff & ((x) >> 8))) +#define minor(x) ((int)(0xffff00ff & (x))) +#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min))) +#endif + /* Play games to come up with a suitable makedev() definition. */ #ifdef __QNXNTO__ /* QNX. <sigh> */ @@ -215,7 +222,7 @@ static const wchar_t * aes_get_wcs(struct aes *aes) { wchar_t *w; - int r; + size_t r; /* Return WCS form if we already have it. */ if (aes->aes_set & AES_SET_WCS) @@ -233,7 +240,7 @@ aes_get_wcs(struct aes *aes) if (w == NULL) __archive_errx(1, "No memory for aes_get_wcs()"); r = mbstowcs(w, aes->aes_mbs.s, wcs_length); - if (r > 0) { + if (r != (size_t)-1 && r != 0) { w[r] = 0; aes->aes_set |= AES_SET_WCS; return (aes->aes_wcs = w); @@ -618,6 +625,12 @@ archive_entry_ino(struct archive_entry * return (entry->ae_stat.aest_ino); } +int64_t +archive_entry_ino64(struct archive_entry *entry) +{ + return (entry->ae_stat.aest_ino); +} + mode_t archive_entry_mode(struct archive_entry *entry) { @@ -818,6 +831,13 @@ archive_entry_set_ino(struct archive_ent } void +archive_entry_set_ino64(struct archive_entry *entry, int64_t ino) +{ + entry->stat_valid = 0; + entry->ae_stat.aest_ino = ino; +} + +void archive_entry_set_hardlink(struct archive_entry *entry, const char *target) { aes_set_mbs(&entry->ae_hardlink, target); @@ -847,6 +867,16 @@ archive_entry_copy_hardlink_w(struct arc entry->ae_set &= ~AE_SET_HARDLINK; } +int +archive_entry_update_hardlink_utf8(struct archive_entry *entry, const char *target) +{ + if (target != NULL) + entry->ae_set |= AE_SET_HARDLINK; + else + entry->ae_set &= ~AE_SET_HARDLINK; + return (aes_update_utf8(&entry->ae_hardlink, target)); +} + void archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns) { @@ -1095,6 +1125,16 @@ archive_entry_copy_symlink_w(struct arch entry->ae_set &= ~AE_SET_SYMLINK; } +int +archive_entry_update_symlink_utf8(struct archive_entry *entry, const char *linkname) +{ + if (linkname != NULL) + entry->ae_set |= AE_SET_SYMLINK; + else + entry->ae_set &= ~AE_SET_SYMLINK; + return (aes_update_utf8(&entry->ae_symlink, linkname)); +} + void archive_entry_set_uid(struct archive_entry *entry, uid_t u) { @@ -1186,7 +1226,7 @@ archive_entry_acl_add_entry_w(struct arc archive_entry_acl_add_entry_w_len(entry, type, permset, tag, id, name, wcslen(name)); } -void +static void archive_entry_acl_add_entry_w_len(struct archive_entry *entry, int type, int permset, int tag, int id, const wchar_t *name, size_t len) { @@ -1595,7 +1635,7 @@ __archive_entry_acl_parse_w(struct archi const wchar_t *end; } field[4], name; - int fields; + int fields, n; int type, tag, permset, id; wchar_t sep; @@ -1615,6 +1655,10 @@ __archive_entry_acl_parse_w(struct archi ++fields; } while (sep == L':'); + /* Set remaining fields to blank. */ + for (n = fields; n < 4; ++n) + field[n].start = field[n].end = NULL; + /* Check for a numeric ID in field 1 or 3. */ id = -1; isint_w(field[1].start, field[1].end, &id); @@ -1626,7 +1670,7 @@ __archive_entry_acl_parse_w(struct archi * Solaris extension: "defaultuser::rwx" is the * default ACL corresponding to "user::rwx", etc. */ - if (field[0].end-field[0].start > 7 + if (field[0].end - field[0].start > 7 && wmemcmp(field[0].start, L"default", 7) == 0) { type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; field[0].start += 7; @@ -1653,7 +1697,7 @@ __archive_entry_acl_parse_w(struct archi } else if (prefix_w(field[0].start, field[0].end, L"other")) { if (fields == 2 && field[1].start < field[1].end - && ismode_w(field[1].start, field[2].end, &permset)) { + && ismode_w(field[1].start, field[1].end, &permset)) { /* This is Solaris-style "other:rwx" */ } else if (fields == 3 && field[1].start == field[1].end @@ -1687,98 +1731,6 @@ __archive_entry_acl_parse_w(struct archi } /* - * extended attribute handling - */ - -void -archive_entry_xattr_clear(struct archive_entry *entry) -{ - struct ae_xattr *xp; - - while (entry->xattr_head != NULL) { - xp = entry->xattr_head->next; - free(entry->xattr_head->name); - free(entry->xattr_head->value); - free(entry->xattr_head); - entry->xattr_head = xp; - } - - entry->xattr_head = NULL; -} - -void -archive_entry_xattr_add_entry(struct archive_entry *entry, - const char *name, const void *value, size_t size) -{ - struct ae_xattr *xp; - - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - ; - - if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) - /* XXX Error XXX */ - return; - - xp->name = strdup(name); - if ((xp->value = malloc(size)) != NULL) { - memcpy(xp->value, value, size); - xp->size = size; - } else - xp->size = 0; - - xp->next = entry->xattr_head; - entry->xattr_head = xp; -} - - -/* - * returns number of the extended attribute entries - */ -int -archive_entry_xattr_count(struct archive_entry *entry) -{ - struct ae_xattr *xp; - int count = 0; - - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - count++; - - return count; -} - -int -archive_entry_xattr_reset(struct archive_entry * entry) -{ - entry->xattr_p = entry->xattr_head; - - return archive_entry_xattr_count(entry); -} - -int -archive_entry_xattr_next(struct archive_entry * entry, - const char **name, const void **value, size_t *size) -{ - if (entry->xattr_p) { - *name = entry->xattr_p->name; - *value = entry->xattr_p->value; - *size = entry->xattr_p->size; - - entry->xattr_p = entry->xattr_p->next; - - return (ARCHIVE_OK); - } else { - *name = NULL; - *value = NULL; - *size = (size_t)0; - return (ARCHIVE_WARN); - } -} - -/* - * end of xattr handling - */ - -/* * Parse a string to a positive decimal integer. Returns true if * the string is non-empty and consists only of decimal digits, * false otherwise. @@ -1814,6 +1766,8 @@ ismode_w(const wchar_t *start, const wch { const wchar_t *p; + if (start >= end) + return (0); p = start; *permset = 0; while (p < end) { @@ -1988,6 +1942,18 @@ static struct flag { { "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0 }, { "nouunlink", L"nouunlink", UF_NOUNLINK, 0 }, #endif +#ifdef EXT2_UNRM_FL + { "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0}, +#endif + +#ifdef EXT2_BTREE_FL + { "nobtree", L"nobtree", EXT2_BTREE_FL, 0 }, +#endif + +#ifdef EXT2_ECOMPR_FL + { "nocomperr", L"nocomperr", EXT2_ECOMPR_FL, 0 }, +#endif + #ifdef EXT2_COMPR_FL /* 'c' */ { "nocompress", L"nocompress", EXT2_COMPR_FL, 0 }, #endif @@ -1995,6 +1961,46 @@ static struct flag { #ifdef EXT2_NOATIME_FL /* 'A' */ { "noatime", L"noatime", 0, EXT2_NOATIME_FL}, #endif + +#ifdef EXT2_DIRTY_FL + { "nocompdirty",L"nocompdirty", EXT2_DIRTY_FL, 0}, +#endif + +#ifdef EXT2_COMPRBLK_FL +#ifdef EXT2_NOCOMPR_FL + { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL}, +#else + { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, 0}, +#endif +#endif +#ifdef EXT2_DIRSYNC_FL + { "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0}, +#endif +#ifdef EXT2_INDEX_FL + { "nohashidx", L"nohashidx", EXT2_INDEX_FL, 0}, +#endif +#ifdef EXT2_IMAGIC_FL + { "noimagic", L"noimagic", EXT2_IMAGIC_FL, 0}, +#endif +#ifdef EXT3_JOURNAL_DATA_FL + { "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0}, +#endif +#ifdef EXT2_SECRM_FL + { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0}, +#endif +#ifdef EXT2_SYNC_FL + { "nosync", L"nosync", EXT2_SYNC_FL, 0}, +#endif +#ifdef EXT2_NOTAIL_FL + { "notail", L"notail", 0, EXT2_NOTAIL_FL}, +#endif +#ifdef EXT2_TOPDIR_FL + { "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0}, +#endif +#ifdef EXT2_RESERVED_FL + { "noreserved", L"noreserved", EXT2_RESERVED_FL, 0}, +#endif + { NULL, NULL, 0, 0 } }; Modified: user/luigi/ipfw3-head/lib/libarchive/archive_entry.h ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_entry.h Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_entry.h Tue Dec 29 15:48:51 2009 (r201203) @@ -40,14 +40,25 @@ #include <stddef.h> /* for wchar_t */ #include <time.h> +#if defined(_WIN32) && !defined(__CYGWIN__) +#include <windows.h> +#endif + /* Get appropriate definitions of standard POSIX-style types. */ /* These should match the types used in 'struct stat' */ #if defined(_WIN32) && !defined(__CYGWIN__) #define __LA_INT64_T __int64 -#define __LA_UID_T unsigned int -#define __LA_GID_T unsigned int -#define __LA_DEV_T unsigned int -#define __LA_MODE_T unsigned short +# if defined(__BORLANDC__) +# define __LA_UID_T uid_t +# define __LA_GID_T gid_t +# define __LA_DEV_T dev_t +# define __LA_MODE_T mode_t +# else +# define __LA_UID_T short +# define __LA_GID_T short +# define __LA_DEV_T unsigned int +# define __LA_MODE_T unsigned short +# endif #else #include <unistd.h> #define __LA_INT64_T int64_t @@ -194,6 +205,7 @@ __LA_DECL const wchar_t *archive_entry_g __LA_DECL const char *archive_entry_hardlink(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *); __LA_DECL __LA_INO_T archive_entry_ino(struct archive_entry *); +__LA_DECL __LA_INT64_T archive_entry_ino64(struct archive_entry *); __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *); __LA_DECL time_t archive_entry_mtime(struct archive_entry *); __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *); @@ -227,6 +239,10 @@ __LA_DECL const wchar_t *archive_entry_u __LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long); __LA_DECL void archive_entry_unset_atime(struct archive_entry *); +#if defined(_WIN32) && !defined(__CYGWIN__) +__LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, + BY_HANDLE_FILE_INFORMATION *); +#endif __LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long); __LA_DECL void archive_entry_unset_birthtime(struct archive_entry *); __LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long); @@ -251,7 +267,14 @@ __LA_DECL int archive_entry_update_gname __LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *); +#if ARCHIVE_VERSION_NUMBER >= 3000000 +/* Starting with libarchive 3.0, this will be synonym for ino64. */ +__LA_DECL void archive_entry_set_ino(struct archive_entry *, __LA_INT64_T); +#else __LA_DECL void archive_entry_set_ino(struct archive_entry *, unsigned long); +#endif +__LA_DECL void archive_entry_set_ino64(struct archive_entry *, __LA_INT64_T); __LA_DECL void archive_entry_set_link(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *); @@ -274,6 +297,7 @@ __LA_DECL void archive_entry_copy_source __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_set_uid(struct archive_entry *, __LA_UID_T); __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *); Modified: user/luigi/ipfw3-head/lib/libarchive/archive_entry_link_resolver.c ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_entry_link_resolver.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_entry_link_resolver.c Tue Dec 29 15:48:51 2009 (r201203) @@ -249,7 +249,7 @@ find_entry(struct archive_entry_linkreso struct links_entry *le; int hash, bucket; dev_t dev; - ino_t ino; + int64_t ino; /* Free a held entry. */ if (res->spare != NULL) { @@ -264,15 +264,15 @@ find_entry(struct archive_entry_linkreso return (NULL); dev = archive_entry_dev(entry); - ino = archive_entry_ino(entry); - hash = dev ^ ino; + ino = archive_entry_ino64(entry); + hash = (int)(dev ^ ino); /* Try to locate this entry in the links cache. */ bucket = hash % res->number_buckets; for (le = res->buckets[bucket]; le != NULL; le = le->next) { if (le->hash == hash && dev == archive_entry_dev(le->canonical) - && ino == archive_entry_ino(le->canonical)) { + && ino == archive_entry_ino64(le->canonical)) { /* * Decrement link count each time and release * the entry if it hits zero. This saves @@ -350,7 +350,7 @@ insert_entry(struct archive_entry_linkre if (res->number_entries > res->number_buckets * 2) grow_hash(res); - hash = archive_entry_dev(entry) ^ archive_entry_ino(entry); + hash = archive_entry_dev(entry) ^ archive_entry_ino64(entry); bucket = hash % res->number_buckets; /* If we could allocate the entry, record it. */ Modified: user/luigi/ipfw3-head/lib/libarchive/archive_entry_private.h ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_entry_private.h Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_entry_private.h Tue Dec 29 15:48:51 2009 (r201203) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED #define ARCHIVE_ENTRY_PRIVATE_H_INCLUDED @@ -115,7 +119,7 @@ struct archive_entry { int64_t aest_birthtime; uint32_t aest_birthtime_nsec; gid_t aest_gid; - ino_t aest_ino; + int64_t aest_ino; mode_t aest_mode; uint32_t aest_nlink; uint64_t aest_size; Modified: user/luigi/ipfw3-head/lib/libarchive/archive_entry_stat.c ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_entry_stat.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_entry_stat.c Tue Dec 29 15:48:51 2009 (r201203) @@ -72,7 +72,7 @@ archive_entry_stat(struct archive_entry st->st_dev = archive_entry_dev(entry); st->st_gid = archive_entry_gid(entry); st->st_uid = archive_entry_uid(entry); - st->st_ino = archive_entry_ino(entry); + st->st_ino = archive_entry_ino64(entry); st->st_nlink = archive_entry_nlink(entry); st->st_rdev = archive_entry_rdev(entry); st->st_size = archive_entry_size(entry); Copied: user/luigi/ipfw3-head/lib/libarchive/archive_entry_xattr.c (from r201149, head/lib/libarchive/archive_entry_xattr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/luigi/ipfw3-head/lib/libarchive/archive_entry_xattr.c Tue Dec 29 15:48:51 2009 (r201203, copy of r201149, head/lib/libarchive/archive_entry_xattr.c) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 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. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif +#ifdef HAVE_LINUX_FS_H +#include <linux/fs.h> /* for Linux file flags */ +#endif +/* + * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h. + * As the include guards don't agree, the order of include is important. + */ +#ifdef HAVE_LINUX_EXT2_FS_H +#include <linux/ext2_fs.h> /* for Linux file flags */ +#endif +#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__) +#include <ext2fs/ext2_fs.h> /* for Linux file flags */ +#endif +#include <stddef.h> +#include <stdio.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_WCHAR_H +#include <wchar.h> +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_entry_private.h" + +/* + * extended attribute handling + */ + +void +archive_entry_xattr_clear(struct archive_entry *entry) +{ + struct ae_xattr *xp; + + while (entry->xattr_head != NULL) { + xp = entry->xattr_head->next; + free(entry->xattr_head->name); + free(entry->xattr_head->value); + free(entry->xattr_head); + entry->xattr_head = xp; + } + + entry->xattr_head = NULL; +} + +void +archive_entry_xattr_add_entry(struct archive_entry *entry, + const char *name, const void *value, size_t size) +{ + struct ae_xattr *xp; + + for (xp = entry->xattr_head; xp != NULL; xp = xp->next) + ; + + if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) + /* XXX Error XXX */ + return; + + xp->name = strdup(name); + if ((xp->value = malloc(size)) != NULL) { + memcpy(xp->value, value, size); + xp->size = size; + } else + xp->size = 0; + + xp->next = entry->xattr_head; + entry->xattr_head = xp; +} + + +/* + * returns number of the extended attribute entries + */ +int +archive_entry_xattr_count(struct archive_entry *entry) +{ + struct ae_xattr *xp; + int count = 0; + + for (xp = entry->xattr_head; xp != NULL; xp = xp->next) + count++; + + return count; +} + +int +archive_entry_xattr_reset(struct archive_entry * entry) +{ + entry->xattr_p = entry->xattr_head; + + return archive_entry_xattr_count(entry); +} + +int +archive_entry_xattr_next(struct archive_entry * entry, + const char **name, const void **value, size_t *size) +{ + if (entry->xattr_p) { + *name = entry->xattr_p->name; + *value = entry->xattr_p->value; + *size = entry->xattr_p->size; + + entry->xattr_p = entry->xattr_p->next; + + return (ARCHIVE_OK); + } else { + *name = NULL; + *value = NULL; + *size = (size_t)0; + return (ARCHIVE_WARN); + } +} + +/* + * end of xattr handling + */ Modified: user/luigi/ipfw3-head/lib/libarchive/archive_platform.h ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_platform.h Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_platform.h Tue Dec 29 15:48:51 2009 (r201203) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */ + /* * This header is the first thing included in any of the libarchive * source files. As far as possible, platform-specific issues should @@ -50,17 +52,27 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* It should be possible to get rid of this by extending the feature-test + * macros to cover Windows API functions, probably along with non-trivial + * refactoring of code to find structures that sit more cleanly on top of + * either Windows or Posix APIs. */ +#if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) +#include "archive_windows.h" +#endif + /* * The config files define a lot of feature macros. The following * uses those macros to select/define replacements and include key * headers as required. */ -/* No non-FreeBSD platform will have __FBSDID, so just define it here. */ -#ifdef __FreeBSD__ -#include <sys/cdefs.h> /* For __FBSDID */ -#else -/* Just leaving this macro replacement empty leads to a dangling semicolon. */ +/* Get a real definition for __FBSDID if we can */ +#if HAVE_SYS_CDEFS_H +#include <sys/cdefs.h> +#endif + +/* If not, define it so as to avoid dangling semicolons. */ +#ifndef __FBSDID #define __FBSDID(a) struct _undefined_hack #endif @@ -72,6 +84,26 @@ #include <stdint.h> #endif +/* Borland warns about its own constants! */ +#if defined(__BORLANDC__) +# if HAVE_DECL_UINT64_MAX +# undef UINT64_MAX +# undef HAVE_DECL_UINT64_MAX +# endif +# if HAVE_DECL_UINT64_MIN +# undef UINT64_MIN +# undef HAVE_DECL_UINT64_MIN +# endif +# if HAVE_DECL_INT64_MAX +# undef INT64_MAX +# undef HAVE_DECL_INT64_MAX +# endif +# if HAVE_DECL_INT64_MIN +# undef INT64_MIN +# undef HAVE_DECL_INT64_MIN +# endif +#endif + /* Some platforms lack the standard *_MAX definitions. */ #if !HAVE_DECL_SIZE_MAX #define SIZE_MAX (~(size_t)0) Modified: user/luigi/ipfw3-head/lib/libarchive/archive_private.h ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_private.h Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_private.h Tue Dec 29 15:48:51 2009 (r201203) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_PRIVATE_H_INCLUDED #define ARCHIVE_PRIVATE_H_INCLUDED @@ -87,9 +91,11 @@ struct archive { const char *compression_name; /* Position in UNCOMPRESSED data stream. */ - off_t file_position; + int64_t file_position; /* Position in COMPRESSED data stream. */ - off_t raw_position; + int64_t raw_position; + /* Number of file entries processed. */ + int file_count; int archive_error_number; const char *error; @@ -107,4 +113,12 @@ int __archive_parse_options(const char * #define err_combine(a,b) ((a) < (b) ? (a) : (b)) +#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER <= 1300) +# define ARCHIVE_LITERAL_LL(x) x##i64 +# define ARCHIVE_LITERAL_ULL(x) x##ui64 +#else +# define ARCHIVE_LITERAL_LL(x) x##ll +# define ARCHIVE_LITERAL_ULL(x) x##ull +#endif + #endif Modified: user/luigi/ipfw3-head/lib/libarchive/archive_read.c ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_read.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_read.c Tue Dec 29 15:48:51 2009 (r201203) @@ -386,6 +386,7 @@ archive_read_next_header2(struct archive ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, "archive_read_next_header"); + ++_a->file_count; archive_entry_clear(entry); archive_clear_error(&a->archive); Modified: user/luigi/ipfw3-head/lib/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- user/luigi/ipfw3-head/lib/libarchive/archive_read_disk_entry_from_file.c Tue Dec 29 15:48:04 2009 (r201202) +++ user/luigi/ipfw3-head/lib/libarchive/archive_read_disk_entry_from_file.c Tue Dec 29 15:48:51 2009 (r201203) @@ -103,7 +103,7 @@ archive_read_disk_entry_from_file(struct * open file descriptor which we can use in the subsequent lookups. */ if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) { if (fd < 0) - fd = open(pathname, O_RDONLY | O_NONBLOCK); + fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY); if (fd >= 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912291548.nBTFmq7V028689>