Date: Mon, 8 Aug 2011 20:16:18 GMT From: Jakub Wojciech Klama <jceel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 197378 for review Message-ID: <201108082016.p78KGIcw029564@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@197378?ac=10 Change 197378 by jceel@jceel_cyclone on 2011/08/08 20:16:06 IFC @197377 Affected files ... .. //depot/projects/soc2011/jceel_lpc/contrib/gdb/FREEBSD-diffs#2 integrate .. //depot/projects/soc2011/jceel_lpc/contrib/gdb/gdb/sparc64fbsd-tdep.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/etc/Makefile#2 integrate .. //depot/projects/soc2011/jceel_lpc/etc/nsswitch.conf#2 integrate .. //depot/projects/soc2011/jceel_lpc/gnu/usr.bin/gdb/arch/sparc64/Makefile#2 integrate .. //depot/projects/soc2011/jceel_lpc/gnu/usr.bin/gdb/arch/sparc64/init.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read_support_compression_uu.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read_support_format_iso9660.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read_support_format_mtree.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_open_fd.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_open_file.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_open_filename.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_set_compression_xz.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_set_format_zip.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/Makefile#3 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_open_failure.c#1 branch .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_read_format_mtree.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_write_compress_lzma.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_write_compress_xz.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libc/net/ethers.3#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libkvm/kvm_ia64.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libthread_db/arch/amd64/libpthread_md.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libthread_db/arch/sparc64/libpthread_md.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/lib/libthread_db/libthr_db.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/release/Makefile.sysinstall#2 integrate .. //depot/projects/soc2011/jceel_lpc/sbin/rcorder/rcorder.8#3 integrate .. //depot/projects/soc2011/jceel_lpc/share/man/man8/diskless.8#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/amd64/conf/GENERIC#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/AVILA#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/BWCT#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/CAMBRIA#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/CNS11XXNAS#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/CRB#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/DB-78XXX#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/DB-88F5XXX#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/DB-88F6XXX#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/DOCKSTAR#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/EP80219#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/GUMSTIX#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/HL200#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/HL201#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/IQ31244#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/KB920X#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/LN2410SBC#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/NSLU#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/QILA9G20#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/SAM9G20EK#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/SHEEVAPLUG#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/SIMICS#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/arm/conf/TS7800#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_dfs/null/dfs_null.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ah.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ah.h#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ah_internal.h#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ah_regdomain.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar5212/ar5212.h#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar5416/ar5416.h#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/if_ath.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/if_athdfs.h#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/dev/ath/if_athvar.h#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/i386/conf/GENERIC#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/i386/conf/XBOX#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/i386/conf/XEN#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/ia64/ia64/dump_machdep.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/ia64/ia64/pmap.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/kern/vfs_mount.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/mips/cavium/asm_octeon.S#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/mips/cavium/octeon_mp.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/net/if_llatbl.h#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/net/route.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/net80211/ieee80211_scan_sta.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/netinet/in.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/netinet/raw_ip.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/netinet6/in6.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/pc98/conf/GENERIC#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/sparc64/conf/GENERIC#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/sparc64/sparc64/dump_machdep.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/sys/sparc64/sparc64/mp_machdep.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/sys/vm/vm_contig.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/tools/regression/netinet/tcpdrop/tcpdrop.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/Makefile#2 integrate .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test.h#2 integrate .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test.t#1 branch .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test_capabilities.c#1 branch .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test_capmode.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test_fcntl.c#1 branch .. //depot/projects/soc2011/jceel_lpc/tools/regression/security/cap_test/cap_test_sysctl.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.bin/ar/write.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.bin/catman/catman.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/usr.bin/man/man.1#3 integrate .. //depot/projects/soc2011/jceel_lpc/usr.bin/xlint/lint1/tree.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.sbin/bsdinstall/scripts/mirrorselect#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.sbin/makefs/cd9660.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.sbin/pmcstat/pmcstat.c#3 integrate .. //depot/projects/soc2011/jceel_lpc/usr.sbin/pmcstat/pmcstat.h#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.sbin/pmcstat/pmcstat_log.c#2 integrate .. //depot/projects/soc2011/jceel_lpc/usr.sbin/service/service.8#2 integrate Differences ... ==== //depot/projects/soc2011/jceel_lpc/contrib/gdb/FREEBSD-diffs#2 (text+ko) ==== @@ -927,3 +927,39 @@ +#include "ia64/tm-ia64.h" + +#endif /* TM_FBSD_H */ +Index: gdb/sparc64fbsd-tdep.c +=================================================================== +--- gdb/sparc64fbsd-tdep.c (revision 223862) ++++ gdb/sparc64fbsd-tdep.c (working copy) +@@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struct regset * + { + sparc64_supply_fpregset (regcache, regnum, fpregs); + } ++ ++void ++supply_gregset (const void *gregs) ++{ ++ sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); ++} ++ ++void ++supply_fpregset (const void *fpregs) ++{ ++ sparc64_supply_fpregset (current_regcache, -1, fpregs); ++} ++ ++void ++fill_gregset (void *gregs, int regnum) ++{ ++ sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, ++ gregs); ++} ++ ++void ++fill_fpregset (void *fpregs, int regnum) ++{ ++ sparc64_collect_fpregset (current_regcache, regnum, fpregs); ++} + + + /* Signal trampolines. */ ==== //depot/projects/soc2011/jceel_lpc/contrib/gdb/gdb/sparc64fbsd-tdep.c#2 (text+ko) ==== @@ -64,6 +64,31 @@ { sparc64_supply_fpregset (regcache, regnum, fpregs); } + +void +supply_gregset (const void *gregs) +{ + sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); +} + +void +supply_fpregset (const void *fpregs) +{ + sparc64_supply_fpregset (current_regcache, -1, fpregs); +} + +void +fill_gregset (void *gregs, int regnum) +{ + sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, + gregs); +} + +void +fill_fpregset (void *fpregs, int regnum) +{ + sparc64_collect_fpregset (current_regcache, regnum, fpregs); +} /* Signal trampolines. */ ==== //depot/projects/soc2011/jceel_lpc/etc/Makefile#2 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $FreeBSD: src/etc/Makefile,v 1.387 2011/02/22 08:13:49 uqs Exp $ +# $FreeBSD: src/etc/Makefile,v 1.389 2011/08/06 09:16:53 dougb Exp $ .include <bsd.own.mk> ==== //depot/projects/soc2011/jceel_lpc/etc/nsswitch.conf#2 (text) ==== @@ -1,15 +1,23 @@ # -# nsswitch.conf(5) - name service switch configuration file -# $FreeBSD: src/etc/nsswitch.conf,v 1.1 2006/05/03 15:14:47 ume Exp $ +# $FreeBSD: src/etc/nsswitch.conf,v 1.2 2011/08/06 09:16:53 dougb Exp $ +# +# To enable NIS the commented entries should replace their uncommented +# equivalents. See nsswitch.conf(5) for more information. # -group: compat -group_compat: nis +group: files +#group_compat: nis +#group: compat + +passwd: files +#passwd_compat: nis +#passwd: compat + +services: files +#services_compat: nis +#services: compat + hosts: files dns networks: files -passwd: compat -passwd_compat: nis shells: files -services: compat -services_compat: nis protocols: files rpc: files ==== //depot/projects/soc2011/jceel_lpc/gnu/usr.bin/gdb/arch/sparc64/Makefile#2 (text+ko) ==== @@ -1,6 +1,7 @@ -# $FreeBSD: src/gnu/usr.bin/gdb/arch/sparc64/Makefile,v 1.3 2004/12/05 06:59:01 marcel Exp $ +# $FreeBSD: src/gnu/usr.bin/gdb/arch/sparc64/Makefile,v 1.4 2011/08/06 17:53:45 marius Exp $ .if !defined(GDB_CROSS_DEBUGGER) +LIBSRCS+= fbsd-threads.c LIBSRCS+= solib.c solib-legacy.c solib-svr4.c LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c .endif ==== //depot/projects/soc2011/jceel_lpc/gnu/usr.bin/gdb/arch/sparc64/init.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/gnu/usr.bin/gdb/arch/sparc64/init.c,v 1.2 2004/12/05 06:59:01 marcel Exp $ */ +/* $FreeBSD: src/gnu/usr.bin/gdb/arch/sparc64/init.c,v 1.3 2011/08/06 17:53:45 marius Exp $ */ /* Do not modify this file. */ /* It is created automatically by the Makefile. */ @@ -11,6 +11,7 @@ extern initialize_file_ftype _initialize_ser_hardwire; extern initialize_file_ftype _initialize_ser_pipe; extern initialize_file_ftype _initialize_ser_tcp; +extern initialize_file_ftype _initialize_thread_db; extern initialize_file_ftype _initialize_sparc64fbsd_nat; extern initialize_file_ftype _initialize_sparc64_nat; extern initialize_file_ftype _initialize_sparc_nat; @@ -124,6 +125,7 @@ _initialize_ser_pipe (); _initialize_ser_tcp (); #ifndef CROSS_DEBUGGER + _initialize_thread_db (); _initialize_sparc64fbsd_nat (); _initialize_sparc64_nat (); _initialize_sparc_nat (); ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.56 2010/11/05 05:11:54 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.57 2011/08/07 08:42:36 mm Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -377,6 +377,12 @@ /* If no bidder, we're done. */ if (best_bidder == NULL) { + /* Verify the final pipelin by asking it for some data. */ + __archive_read_filter_ahead(a->filter, 1, &avail); + if (avail < 0) { + cleanup_filters(a); + return (ARCHIVE_FATAL); + } a->archive.compression_name = a->filter->name; a->archive.compression_code = a->filter->code; return (ARCHIVE_OK); @@ -389,18 +395,12 @@ filter->bidder = best_bidder; filter->archive = a; filter->upstream = a->filter; - r = (best_bidder->init)(filter); + a->filter = filter; + r = (best_bidder->init)(a->filter); if (r != ARCHIVE_OK) { - free(filter); + cleanup_filters(a); return (r); } - a->filter = filter; - /* Verify the filter by asking it for some data. */ - __archive_read_filter_ahead(filter, 1, &avail); - if (avail < 0) { - cleanup_filters(a); - return (ARCHIVE_FATAL); - } } } ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read_support_compression_uu.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_uu.c,v 1.2 2011/07/17 21:27:38 mm Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_uu.c,v 1.3 2011/08/07 08:42:36 mm Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -381,7 +381,17 @@ unsigned char *ptr; size_t newsize; - newsize = uudecode->in_allocated << 1; + /* + * Calculate a new buffer size for in_buff. + * Increase its value until it has enough size we need. + */ + newsize = uudecode->in_allocated; + do { + if (newsize < IN_BUFF_SIZE*32) + newsize <<= 1; + else + newsize += IN_BUFF_SIZE; + } while (size > newsize); ptr = malloc(newsize); if (ptr == NULL || newsize < uudecode->in_allocated) { ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read_support_format_iso9660.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.40 2010/01/23 07:55:53 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.41 2011/08/07 08:42:36 mm Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -709,16 +709,18 @@ /* Location of Occurrence of Type L Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+SVD_type_L_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); - /* Location of Occurrence of Type M Path Table must be - * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + /* The Type M Path Table must be at a valid location (WinISO + * and probably other programs omit this, so we allow zero) + * + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+SVD_type_M_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Read Root Directory Record in Volume Descriptor. */ @@ -781,16 +783,17 @@ /* Location of Occurrence of Type L Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+PVD_type_1_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); /* Location of Occurrence of Type M Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+PVD_type_m_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Reserved field must be 0. */ @@ -862,19 +865,24 @@ * available location, * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+PVD_type_1_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); - /* Location of Occurrence of Type M Path Table must be - * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + /* The Type M Path Table must also be at a valid location + * (although ECMA 119 requires a Type M Path Table, WinISO and + * probably other programs omit it, so we permit a zero here) + * + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+PVD_type_m_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Reserved field must be 0. */ + /* FreeBSD: makefs erroneously created images with 0x20 */ for (i = 0; i < PVD_reserved4_size; ++i) - if (h[PVD_reserved4_offset + i] != 0) + if (h[PVD_reserved4_offset + i] != 0 && + h[PVD_reserved4_offset + i] != 32) return (0); /* Reserved field must be 0. */ @@ -1677,6 +1685,7 @@ const unsigned char *rr_start, *rr_end; const unsigned char *p; size_t dr_len; + uint64_t fsize; int32_t location; int flags; @@ -1685,6 +1694,7 @@ dr_len = (size_t)isodirrec[DR_length_offset]; name_len = (size_t)isodirrec[DR_name_len_offset]; location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that dr_len needs at least 34. */ if (dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -1703,7 +1713,10 @@ * link or file size is zero. As far as I know latest mkisofs * do that. */ - if (location >= iso9660->volume_block) { + if (location > 0 && + (location + ((fsize + iso9660->logical_block_size -1) + / iso9660->logical_block_size)) > + (unsigned int)iso9660->volume_block) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid location of extent of file"); return (NULL); @@ -1719,7 +1732,7 @@ memset(file, 0, sizeof(*file)); file->parent = parent; file->offset = iso9660->logical_block_size * (uint64_t)location; - file->size = toi(isodirrec + DR_size_offset, DR_size_size); + file->size = fsize; file->mtime = isodate7(isodirrec + DR_date_offset); file->ctime = file->atime = file->mtime; ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_read_support_format_mtree.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.18 2011/07/17 21:27:38 mm Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.19 2011/08/07 08:42:36 mm Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -525,6 +525,7 @@ /* Initialize reasonable defaults. */ mtree->filetype = AE_IFREG; archive_entry_set_size(entry, 0); + archive_string_empty(&mtree->contents_name); /* Parse options from this line. */ parsed_kws = 0; @@ -613,9 +614,8 @@ } /* - * If there is a contents file on disk, use that size; - * otherwise leave it as-is (it might have been set from - * the mtree size= keyword). + * Check for a mismatch between the type in the specification and + * the type of the contents object on disk. */ if (st != NULL) { mismatched_type = 0; @@ -660,6 +660,11 @@ } } + /* + * If there is a contents file on disk, pick some of the metadata + * from that file. For most of these, we only set it from the contents + * if it wasn't already parsed from the specification. + */ if (st != NULL) { if ((parsed_kws & MTREE_HAS_DEVICE) == 0 && (archive_entry_filetype(entry) == AE_IFCHR || ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_open_fd.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_fd.c,v 1.10 2009/12/28 02:28:44 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_fd.c,v 1.11 2011/08/07 20:24:32 mm Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -51,7 +51,6 @@ #include "archive.h" struct write_fd_data { - off_t offset; int fd; }; @@ -122,12 +121,16 @@ ssize_t bytesWritten; mine = (struct write_fd_data *)client_data; - bytesWritten = write(mine->fd, buff, length); - if (bytesWritten <= 0) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = write(mine->fd, buff, length); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_open_file.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_file.c,v 1.19 2007/01/09 08:05:56 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_file.c,v 1.20 2011/08/07 20:24:32 mm Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -86,12 +86,16 @@ size_t bytesWritten; mine = client_data; - bytesWritten = fwrite(buff, 1, length, mine->f); - if (bytesWritten < length) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = fwrite(buff, 1, length, mine->f); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_open_filename.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.21 2009/04/17 00:39:35 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.22 2011/08/07 20:24:32 mm Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -142,12 +142,16 @@ ssize_t bytesWritten; mine = (struct write_file_data *)client_data; - bytesWritten = write(mine->fd, buff, length); - if (bytesWritten <= 0) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = write(mine->fd, buff, length); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_set_compression_xz.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_xz.c,v 1.2 2009/12/28 03:28:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_xz.c,v 1.3 2011/08/07 08:42:36 mm Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -421,8 +421,8 @@ archive_set_error(&a->archive, ENOMEM, "lzma compression error: " "%ju MiB would have been needed", - (lzma_memusage(&(state->stream)) + 1024 * 1024 -1) - / (1024 * 1024)); + (uintmax_t)((lzma_memusage(&(state->stream)) + 1024 * 1024 -1) + / (1024 * 1024))); return (ARCHIVE_FATAL); default: /* Any other return value indicates an error. */ ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/archive_write_set_format_zip.c#2 (text+ko) ==== @@ -47,7 +47,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_zip.c,v 1.2 2010/01/23 07:52:44 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_zip.c,v 1.3 2011/08/07 08:42:36 mm Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -502,6 +502,9 @@ int entries; int ret; + if (a->compressor.write == NULL) + return (ARCHIVE_OK); + zip = a->format_data; l = zip->central_directory; ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/lib/libarchive/test/Makefile,v 1.43 2011/07/17 21:27:38 mm Exp $ +# $FreeBSD: src/lib/libarchive/test/Makefile,v 1.44 2011/08/07 08:42:36 mm Exp $ # Where to find the libarchive sources LA_SRCDIR=${.CURDIR}/.. @@ -25,6 +25,7 @@ test_fuzz.c \ test_link_resolver.c \ test_open_fd.c \ + test_open_failure.c \ test_open_file.c \ test_open_filename.c \ test_pax_filename_encoding.c \ ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_read_format_mtree.c#2 (text+ko) ==== @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_mtree.c,v 1.7 2009/12/30 05:59:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_mtree.c,v 1.8 2011/08/07 08:42:36 mm Exp $"); static void test_read_format_mtree1(void) @@ -134,10 +134,53 @@ assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } +/* + * Reported to libarchive.googlecode.com as Issue 121. + */ +static void +test_read_format_mtree3(void) +{ + static char archive[] = + "#mtree\n" + "a type=file contents=file\n" + "b type=link link=a\n" + "c type=file contents=file\n"; + struct archive_entry *ae; + struct archive *a; + assertMakeDir("mtree3", 0777); + assertChdir("mtree3"); + assertMakeFile("file", 0644, "file contents"); + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "a"); + assertEqualInt(archive_entry_filetype(ae), AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "b"); + assertEqualInt(archive_entry_filetype(ae), AE_IFLNK); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "c"); + assertEqualInt(archive_entry_filetype(ae), AE_IFREG); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + + assertChdir(".."); +} + + + DEFINE_TEST(test_read_format_mtree) { test_read_format_mtree1(); test_read_format_mtree2(); + test_read_format_mtree3(); } ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_write_compress_lzma.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress_lzma.c,v 1.1 2009/04/17 01:06:31 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress_lzma.c,v 1.2 2011/08/07 08:42:36 mm Exp $"); /* * A basic exercise of lzma reading and writing. @@ -185,10 +185,15 @@ archive_write_close(a); assert(0 == archive_write_finish(a)); - /* Level 0 really does result in larger data. */ + /* It would be nice to assert that compression-level=0 produced + * consistently larger/smaller results than the default compression, + * but the results here vary a lot depending on the version of liblzma + * being used. */ + /* failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + */ assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_format_all(a)); ==== //depot/projects/soc2011/jceel_lpc/lib/libarchive/test/test_write_compress_xz.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress_xz.c,v 1.1 2009/04/17 01:06:31 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress_xz.c,v 1.2 2011/08/07 08:42:36 mm Exp $"); /* * A basic exercise of xz reading and writing. @@ -193,10 +193,14 @@ archive_write_close(a); assert(0 == archive_write_finish(a)); - /* Level 0 really does result in larger data. */ + /* I would like to assert that compression-level=0 results in + * larger data than the default compression, but that's not true + * for all versions of liblzma. */ + /* failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + */ assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_format_all(a)); ==== //depot/projects/soc2011/jceel_lpc/lib/libc/net/ethers.3#2 (text+ko) ==== @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc/net/ethers.3,v 1.26 2010/08/28 16:32:01 brucec Exp $ +.\" $FreeBSD: src/lib/libc/net/ethers.3,v 1.27 2011/08/08 03:09:03 hrs Exp $ .\" .Dd October 30, 2007 .Dt ETHERS 3 @@ -68,7 +68,7 @@ These functions operate on ethernet addresses using an .Vt ether_addr structure, which is defined in the header file -.In netinet/if_ether.h : +.In net/ethernet.h : .Bd -literal -offset indent /* * The number of bytes in an ethernet (MAC) address. ==== //depot/projects/soc2011/jceel_lpc/lib/libkvm/kvm_ia64.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/lib/libkvm/kvm_ia64.c,v 1.9 2011/01/23 11:08:28 uqs Exp $ */ +/* $FreeBSD: src/lib/libkvm/kvm_ia64.c,v 1.10 2011/08/06 15:59:54 marcel Exp $ */ /* $NetBSD: kvm_alpha.c,v 1.7.2.1 1997/11/02 20:34:26 mellon Exp $ */ /* @@ -33,6 +33,7 @@ #include <sys/mman.h> #include <machine/atomic.h> +#include <machine/bootinfo.h> #include <machine/pte.h> #include <kvm.h> @@ -51,11 +52,16 @@ #define KPTE_DIR0_INDEX(va,ps) ((((va)/(ps)) / NKPTEPG(ps)) / NKPTEDIR(ps)) #define KPTE_DIR1_INDEX(va,ps) ((((va)/(ps)) / NKPTEPG(ps)) % NKPTEDIR(ps)) +#define PBVM_BASE 0x9ffc000000000000UL +#define PBVM_PGSZ (64 * 1024) + struct vmstate { void *mmapbase; size_t mmapsize; size_t pagesize; u_long kptdir; + u_long *pbvm_pgtbl; + u_int pbvm_pgtblsz; }; /* @@ -110,11 +116,28 @@ return (pgsz - ((size_t)pa & (pgsz - 1))); } +static ssize_t +_kvm_read_phys(kvm_t *kd, uint64_t pa, void *buf, size_t bufsz) +{ + off_t ofs; + size_t sz; + + sz = _kvm_pa2off(kd, pa, &ofs, 0); + if (sz < bufsz) + return ((ssize_t)sz); + + if (lseek(kd->pmfd, ofs, 0) == -1) + return (-1); + return (read(kd->pmfd, buf, bufsz)); +} + void _kvm_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; + if (vm->pbvm_pgtbl != NULL) + free(vm->pbvm_pgtbl); if (vm->mmapbase != NULL) munmap(vm->mmapbase, vm->mmapsize); free(vm); @@ -124,10 +147,12 @@ int _kvm_initvtop(kvm_t *kd) { + struct bootinfo bi; struct nlist nl[2]; uint64_t va; Elf64_Ehdr *ehdr; size_t hdrsz; + ssize_t sz; kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); if (kd->vmst == NULL) { @@ -146,6 +171,42 @@ return (-1); /* + * Load the PBVM page table. We need this to resolve PBVM addresses. + * The PBVM page table is obtained from the bootinfo structure, of + * which the physical address is given to us in e_entry. If e_entry + * is 0, then this is assumed to be a pre-PBVM kernel. + */ + if (ehdr->e_entry != 0) { + sz = _kvm_read_phys(kd, ehdr->e_entry, &bi, sizeof(bi)); + if (sz != sizeof(bi)) { + _kvm_err(kd, kd->program, + "cannot read bootinfo from PA %#lx", ehdr->e_entry); + return (-1); + } + if (bi.bi_magic != BOOTINFO_MAGIC) { + _kvm_err(kd, kd->program, "invalid bootinfo"); + return (-1); + } + kd->vmst->pbvm_pgtbl = _kvm_malloc(kd, bi.bi_pbvm_pgtblsz); + if (kd->vmst->pbvm_pgtbl == NULL) { + _kvm_err(kd, kd->program, "cannot allocate page table"); + return (-1); + } + kd->vmst->pbvm_pgtblsz = bi.bi_pbvm_pgtblsz; + sz = _kvm_read_phys(kd, bi.bi_pbvm_pgtbl, kd->vmst->pbvm_pgtbl, + bi.bi_pbvm_pgtblsz); + if (sz != bi.bi_pbvm_pgtblsz) { + _kvm_err(kd, kd->program, + "cannot read page table from PA %#lx", + bi.bi_pbvm_pgtbl); + return (-1); + } + } else { + kd->vmst->pbvm_pgtbl = NULL; + kd->vmst->pbvm_pgtblsz = 0; + } + + /* * At this point we've got enough information to use kvm_read() for * direct mapped (ie region 6 and region 7) address, such as symbol * addresses/values. @@ -174,17 +235,18 @@ } int -_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) +_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs) { struct ia64_lpte pte; - uint64_t pgaddr, pt0addr, pt1addr; + uint64_t pa, pgaddr, pt0addr, pt1addr; size_t pgno, pgsz, pt0no, pt1no; if (va >= REGION_BASE(6)) { /* Regions 6 and 7: direct mapped. */ - return (_kvm_pa2off(kd, REGION_ADDR(va), pa, 0)); + pa = REGION_ADDR(va); + return (_kvm_pa2off(kd, pa, ofs, 0)); } else if (va >= REGION_BASE(5)) { - /* Region 5: virtual. */ + /* Region 5: Kernel Virtual Memory. */ va = REGION_ADDR(va); pgsz = kd->vmst->pagesize; pt0no = KPTE_DIR0_INDEX(va, pgsz); @@ -207,12 +269,24 @@ goto fail; if (!(pte.pte & PTE_PRESENT)) goto fail; - va = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1)); - return (_kvm_pa2off(kd, va, pa, pgsz)); + pa = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1)); + return (_kvm_pa2off(kd, pa, ofs, pgsz)); + } else if (va >= PBVM_BASE) { + /* Region 4: Pre-Boot Virtual Memory (PBVM). */ + va -= PBVM_BASE; + pgsz = PBVM_PGSZ; + pt0no = va / pgsz; + if (pt0no >= (kd->vmst->pbvm_pgtblsz >> 3)) + goto fail; + pt0addr = kd->vmst->pbvm_pgtbl[pt0no]; + if (!(pt0addr & PTE_PRESENT)) + goto fail; + pa = (pt0addr & PTE_PPN_MASK) + va % pgsz; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108082016.p78KGIcw029564>