From owner-p4-projects@FreeBSD.ORG Thu Feb 21 06:38:12 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3343916A40A; Thu, 21 Feb 2008 06:38:12 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAAF316A401 for ; Thu, 21 Feb 2008 06:38:11 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DD4E313C46B for ; Thu, 21 Feb 2008 06:38:11 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1L6cBXE068295 for ; Thu, 21 Feb 2008 06:38:11 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1L6cBoa068285 for perforce@freebsd.org; Thu, 21 Feb 2008 06:38:11 GMT (envelope-from marcel@freebsd.org) Date: Thu, 21 Feb 2008 06:38:11 GMT Message-Id: <200802210638.m1L6cBoa068285@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 135877 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2008 06:38:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=135877 Change 135877 by marcel@marcel_xcllnt on 2008/02/21 06:38:09 IFC @135869 Affected files ... .. //depot/projects/e500/ObsoleteFiles.inc#9 integrate .. //depot/projects/e500/UPDATING#8 integrate .. //depot/projects/e500/bin/sh/mksyntax.c#2 integrate .. //depot/projects/e500/contrib/traceroute/as.c#1 branch .. //depot/projects/e500/contrib/traceroute/as.h#1 branch .. //depot/projects/e500/contrib/traceroute/traceroute.8#2 integrate .. //depot/projects/e500/contrib/traceroute/traceroute.c#3 integrate .. //depot/projects/e500/games/fortune/strfile/strfile.c#2 integrate .. //depot/projects/e500/gnu/usr.bin/man/man/man.c#3 integrate .. //depot/projects/e500/gnu/usr.bin/man/manpath/manpath.c#2 integrate .. //depot/projects/e500/lib/libarchive/archive_entry_strmode.c#2 integrate .. //depot/projects/e500/lib/libarchive/archive_platform.h#4 integrate .. //depot/projects/e500/lib/libarchive/archive_read_open_filename.c#3 integrate .. //depot/projects/e500/lib/libarchive/archive_read_support_compression_bzip2.c#3 integrate .. //depot/projects/e500/lib/libarchive/archive_read_support_compression_gzip.c#3 integrate .. //depot/projects/e500/lib/libarchive/archive_read_support_format_ar.c#4 integrate .. //depot/projects/e500/lib/libarchive/archive_read_support_format_iso9660.c#4 integrate .. //depot/projects/e500/lib/libarchive/archive_read_support_format_mtree.c#2 integrate .. //depot/projects/e500/lib/libarchive/archive_write_disk.c#7 integrate .. //depot/projects/e500/lib/libarchive/archive_write_open_filename.c#2 integrate .. //depot/projects/e500/lib/libarchive/archive_write_set_compression_gzip.c#4 integrate .. //depot/projects/e500/lib/libarchive/config_freebsd.h#3 integrate .. //depot/projects/e500/lib/libarchive/test/main.c#5 integrate .. //depot/projects/e500/lib/libarchive/test/test.h#5 integrate .. //depot/projects/e500/lib/libc/db/test/btree.tests/main.c#2 integrate .. //depot/projects/e500/lib/libc/db/test/dbtest.c#2 integrate .. //depot/projects/e500/lib/libc/regex/grot/main.c#2 integrate .. //depot/projects/e500/lib/msun/Makefile#9 integrate .. //depot/projects/e500/lib/msun/Symbol.map#8 integrate .. //depot/projects/e500/lib/msun/ld80/k_tanl.c#2 integrate .. //depot/projects/e500/lib/msun/man/j0.3#2 integrate .. //depot/projects/e500/lib/msun/man/lgamma.3#2 integrate .. //depot/projects/e500/lib/msun/src/e_exp.c#3 integrate .. //depot/projects/e500/lib/msun/src/e_rem_pio2.c#3 integrate .. //depot/projects/e500/lib/msun/src/e_rem_pio2f.c#3 integrate .. //depot/projects/e500/lib/msun/src/k_cos.c#3 integrate .. //depot/projects/e500/lib/msun/src/k_sin.c#2 integrate .. //depot/projects/e500/lib/msun/src/math.h#5 integrate .. //depot/projects/e500/lib/msun/src/s_cos.c#3 integrate .. //depot/projects/e500/lib/msun/src/s_sin.c#3 integrate .. //depot/projects/e500/lib/msun/src/s_tan.c#3 integrate .. //depot/projects/e500/lib/msun/src/s_tgammaf.c#1 branch .. //depot/projects/e500/release/Makefile#6 integrate .. //depot/projects/e500/sbin/ipfw/ipfw.8#6 integrate .. //depot/projects/e500/sbin/ipfw/ipfw2.c#8 integrate .. //depot/projects/e500/sbin/mount_nfs/mount_nfs.c#3 integrate .. //depot/projects/e500/sbin/sconfig/sconfig.c#2 integrate .. //depot/projects/e500/secure/usr.bin/bdes/bdes.c#2 integrate .. //depot/projects/e500/share/man/man4/Makefile#11 integrate .. //depot/projects/e500/share/man/man4/geom_linux_lvm.4#1 branch .. //depot/projects/e500/share/man/man4/geom_lvm.4#2 delete .. //depot/projects/e500/sys/amd64/conf/GENERIC#11 integrate .. //depot/projects/e500/sys/cam/scsi/scsi_ses.c#3 integrate .. //depot/projects/e500/sys/conf/NOTES#12 integrate .. //depot/projects/e500/sys/conf/files#13 integrate .. //depot/projects/e500/sys/conf/options#11 integrate .. //depot/projects/e500/sys/dev/ti/if_ti.c#4 integrate .. //depot/projects/e500/sys/fs/msdosfs/msdosfs_vfsops.c#7 integrate .. //depot/projects/e500/sys/geom/linux_lvm/g_linux_lvm.c#1 branch .. //depot/projects/e500/sys/geom/linux_lvm/g_linux_lvm.h#1 branch .. //depot/projects/e500/sys/geom/lvm/g_lvm.c#2 delete .. //depot/projects/e500/sys/geom/lvm/g_lvm.h#2 delete .. //depot/projects/e500/sys/kern/vfs_mount.c#8 integrate .. //depot/projects/e500/sys/modules/geom/Makefile#4 integrate .. //depot/projects/e500/sys/modules/geom/geom_linux_lvm/Makefile#1 branch .. //depot/projects/e500/sys/modules/geom/geom_lvm/Makefile#2 delete .. //depot/projects/e500/sys/nfsclient/nfs_vfsops.c#7 integrate .. //depot/projects/e500/tools/regression/fsx/fsx.c#3 integrate .. //depot/projects/e500/tools/regression/lib/msun/Makefile#5 integrate .. //depot/projects/e500/tools/regression/lib/msun/test-exponential.c#2 integrate .. //depot/projects/e500/tools/regression/lib/msun/test-trig.c#1 branch .. //depot/projects/e500/tools/regression/lib/msun/test-trig.t#1 branch .. //depot/projects/e500/usr.bin/calendar/calendars/calendar.dutch#3 integrate .. //depot/projects/e500/usr.bin/ncplogin/ncplogin.c#2 integrate .. //depot/projects/e500/usr.bin/quota/quota.c#2 integrate .. //depot/projects/e500/usr.bin/tar/write.c#3 integrate .. //depot/projects/e500/usr.sbin/cdcontrol/cdcontrol.c#2 integrate .. //depot/projects/e500/usr.sbin/powerd/powerd.c#3 integrate .. //depot/projects/e500/usr.sbin/syslogd/syslogd.c#3 integrate .. //depot/projects/e500/usr.sbin/traceroute/Makefile#2 integrate .. //depot/projects/e500/usr.sbin/zic/zdump.c#2 integrate Differences ... ==== //depot/projects/e500/ObsoleteFiles.inc#9 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/ObsoleteFiles.inc,v 1.130 2008/02/06 19:45:25 delphij Exp $ +# $FreeBSD: src/ObsoleteFiles.inc,v 1.131 2008/02/20 11:28:28 thompsa Exp $ # # This file lists old files (OLD_FILES), libraries (OLD_LIBS) and # directories (OLD_DIRS) which should get removed at an update. Recently @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20080220: geom_lvm rename to geom_linux_lvm +OLD_FILES+=usr/share/man/man4/geom_lvm.4.gz # 20080126: oldcard.4 removal OLD_FILES+=usr/share/man/man4/card.4.gz OLD_FILES+=usr/share/man/man4/oldcard.4.gz ==== //depot/projects/e500/UPDATING#8 (text+ko) ==== @@ -22,6 +22,10 @@ to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20080220: + The new geom_lvm(4) geom class has been renamed to geom_linux_lvm(4), + likewise the kernel option is now GEOM_LINUX_LVM. + 20080211: The default NFS mount mode has changed from UDP to TCP for increased reliability. If you rely on (insecurely) NFS @@ -979,4 +983,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.519 2008/02/11 23:23:20 kris Exp $ +$FreeBSD: src/UPDATING,v 1.520 2008/02/20 07:50:12 thompsa Exp $ ==== //depot/projects/e500/bin/sh/mksyntax.c#2 (text+ko) ==== @@ -42,7 +42,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.24 2005/08/13 15:47:13 stefanf Exp $"); +__FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.25 2008/02/18 20:01:33 marcel Exp $"); /* * This program creates syntax.h and syntax.c. @@ -139,10 +139,7 @@ /* Determine the characteristics of chars. */ c = -1; - if (c < 0) - sign = 1; - else - sign = 0; + sign = (c > 0) ? 0 : 1; for (nbits = 1 ; ; nbits++) { d = (1 << nbits) - 1; if (d == c) ==== //depot/projects/e500/contrib/traceroute/traceroute.8#2 (text+ko) ==== @@ -14,9 +14,9 @@ .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ -.\" $FreeBSD: src/contrib/traceroute/traceroute.8,v 1.16 2006/10/15 17:44:49 dwmalone Exp $ +.\" $FreeBSD: src/contrib/traceroute/traceroute.8,v 1.17 2008/02/20 23:29:52 rpaulo Exp $ .\" -.TH TRACEROUTE 8 "21 September 2000" +.TH TRACEROUTE 8 "19 February 2008" .UC 6 .SH NAME traceroute \- print the route packets take to network host @@ -24,7 +24,7 @@ .na .B traceroute [ -.B \-dDeFISnrvx +.B \-adDeFISnrvx ] [ .B \-f .I first_ttl @@ -71,6 +71,9 @@ .B \-w .I waittime ] [ +.B \-A +.I as_server +] [ .B \-z .I pausemsecs ] @@ -98,6 +101,13 @@ .PP Other options are: .TP +.B \-a +Turn on AS# lookups for each hop encountered. +.TP +.B -A +Turn on AS# lookups and use the given server instead of the +default. +.TP .B \-e Firewall evasion mode. Use fixed destination ports for UDP and TCP probes. @@ -443,3 +453,7 @@ router that's filtering packets), but this is not implemented yet. .PP Please send bug reports to traceroute@ee.lbl.gov. +.PP +The AS number capability reports information that may sometimes be +inaccurate due to discrepancies between the contents of the +routing database server and the current state of the Internet. ==== //depot/projects/e500/contrib/traceroute/traceroute.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ "@(#)$Id: traceroute.c,v 1.68 2000/12/14 08:04:33 leres Exp $ (LBL)"; #endif static const char rcsid[] = - "$FreeBSD: src/contrib/traceroute/traceroute.c,v 1.34 2007/07/01 12:08:05 gnn Exp $"; + "$FreeBSD: src/contrib/traceroute/traceroute.c,v 1.35 2008/02/20 23:29:52 rpaulo Exp $"; #endif /* @@ -263,6 +263,7 @@ #include "findsaddr.h" #include "ifaddrlist.h" +#include "as.h" #include "traceroute.h" /* Maximum number of gateways (include room for one noop) */ @@ -350,6 +351,9 @@ int verbose; int waittime = 5; /* time to wait for response (in seconds) */ int nflag; /* print addresses numerically */ +int as_path; /* print as numbers for each hop */ +char *as_server = NULL; +void *asn; #ifdef CANT_HACK_IPCKSUM int doipcksum = 0; /* don't calculate ip checksums by default */ #else @@ -535,9 +539,17 @@ prog = argv[0]; opterr = 0; - while ((op = getopt(argc, argv, "edDFInrSvxf:g:i:M:m:P:p:q:s:t:w:z:")) != EOF) + while ((op = getopt(argc, argv, "aA:edDFInrSvxf:g:i:M:m:P:p:q:s:t:w:z:")) != EOF) switch (op) { - + case 'a': + as_path = 1; + break; + + case 'A': + as_path = 1; + as_server = optarg; + break; + case 'd': options |= SO_DEBUG; break; @@ -913,6 +925,16 @@ exit (1); } + if (as_path) { + asn = as_setup(as_server); + if (asn == NULL) { + Fprintf(stderr, "%s: as_setup failed, AS# lookups" + " disabled\n", prog); + (void)fflush(stderr); + as_path = 0; + } + } + #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) if (setpolicy(sndsock, "in bypass") < 0) errx(1, "%s", ipsec_strerror()); @@ -1118,6 +1140,8 @@ (unreachable > 0 && unreachable >= nprobes - 1)) break; } + if (as_path) + as_shutdown(asn); exit(0); } @@ -1458,6 +1482,9 @@ hlen = ip->ip_hl << 2; cc -= hlen; + if (as_path) + Printf(" [AS%d]", as_lookup(asn, &from->sin_addr)); + if (nflag) Printf(" %s", inet_ntoa(from->sin_addr)); else @@ -1764,8 +1791,8 @@ Fprintf(stderr, "Version %s\n", version); Fprintf(stderr, - "Usage: %s [-dDeFInrSvx] [-f first_ttl] [-g gateway] [-i iface]\n" + "Usage: %s [-adDeFInrSvx] [-f first_ttl] [-g gateway] [-i iface]\n" "\t[-m max_ttl] [-p port] [-P proto] [-q nqueries] [-s src_addr]\n" - "\t[-t tos] [-w waittime] [-z pausemsecs] host [packetlen]\n", prog); + "\t[-t tos] [-w waittime] [-A as_server] [-z pausemsecs] host [packetlen]\n", prog); exit(1); } ==== //depot/projects/e500/games/fortune/strfile/strfile.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: src/games/fortune/strfile/strfile.c,v 1.28 2005/02/17 18:06:37 ru Exp $"); +__FBSDID("$FreeBSD: src/games/fortune/strfile/strfile.c,v 1.29 2008/02/19 07:09:17 ru Exp $"); # include # include @@ -270,7 +270,7 @@ { int ch; - while ((ch = getopt(argc, argv, "Cc:iorsx")) != EOF) + while ((ch = getopt(argc, argv, "Cc:iorsx")) != -1) switch(ch) { case 'C': /* embedded comments */ Cflag++; ==== //depot/projects/e500/gnu/usr.bin/man/man/man.c#3 (text+ko) ==== @@ -16,7 +16,7 @@ #ifndef lint static const char rcsid[] = - "$FreeBSD: src/gnu/usr.bin/man/man/man.c,v 1.65 2007/09/25 21:41:22 edwin Exp $"; + "$FreeBSD: src/gnu/usr.bin/man/man/man.c,v 1.66 2008/02/19 07:09:17 ru Exp $"; #endif /* not lint */ #define MAN_MAIN @@ -324,7 +324,7 @@ extern void downcase (); extern char *manpath (); - while ((c = getopt (argc, argv, args)) != EOF) + while ((c = getopt (argc, argv, args)) != -1) { switch (c) { ==== //depot/projects/e500/gnu/usr.bin/man/manpath/manpath.c#2 (text+ko) ==== @@ -13,7 +13,7 @@ * The University of Texas at Austin * Austin, Texas 78712 * - * $FreeBSD: src/gnu/usr.bin/man/manpath/manpath.c,v 1.13 2002/10/27 02:12:52 kris Exp $ + * $FreeBSD: src/gnu/usr.bin/man/manpath/manpath.c,v 1.14 2008/02/19 07:09:18 ru Exp $ */ #define MANPATH_MAIN @@ -78,7 +78,7 @@ prognam = mkprogname (argv[0]); - while ((c = getopt (argc, argv, "dhLq?")) != EOF) + while ((c = getopt (argc, argv, "dhLq?")) != -1) { switch (c) { ==== //depot/projects/e500/lib/libarchive/archive_entry_strmode.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.1 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.2 2008/02/19 05:49:02 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -65,15 +65,15 @@ bp[i+1] = '-'; if (mode & S_ISUID) { - if (mode & S_IXUSR) bp[3] = 's'; + if (mode & 0100) bp[3] = 's'; else bp[3] = 'S'; } if (mode & S_ISGID) { - if (mode & S_IXGRP) bp[6] = 's'; + if (mode & 0010) bp[6] = 's'; else bp[6] = 'S'; } if (mode & S_ISVTX) { - if (mode & S_IXOTH) bp[9] = 't'; + if (mode & 0001) bp[9] = 't'; else bp[9] = 'T'; } if (archive_entry_acl_count(entry, ARCHIVE_ENTRY_ACL_TYPE_ACCESS)) ==== //depot/projects/e500/lib/libarchive/archive_platform.h#4 (text+ko) ==== @@ -22,7 +22,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. * - * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.28 2007/12/30 04:58:21 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.29 2008/02/19 06:06:13 kientzle Exp $ */ /* @@ -36,7 +36,10 @@ #ifndef ARCHIVE_PLATFORM_H_INCLUDED #define ARCHIVE_PLATFORM_H_INCLUDED -#if defined(PLATFORM_CONFIG_H) +#ifdef _WIN32 +#include "config_windows.h" +#include "archive_windows.h" +#elif defined(PLATFORM_CONFIG_H) /* Use hand-built config.h in environments that need it. */ #include PLATFORM_CONFIG_H #elif defined(HAVE_CONFIG_H) ==== //depot/projects/e500/lib/libarchive/archive_read_open_filename.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.20 2007/06/26 03:06:48 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.21 2008/02/19 06:10:48 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -47,6 +47,10 @@ #include "archive.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + struct read_file_data { int fd; size_t block_size; @@ -113,7 +117,7 @@ return (ARCHIVE_FATAL); } if (mine->filename[0] != '\0') - mine->fd = open(mine->filename, O_RDONLY); + mine->fd = open(mine->filename, O_RDONLY | O_BINARY); else mine->fd = 0; /* Fake "open" for stdin. */ if (mine->fd < 0) { ==== //depot/projects/e500/lib/libarchive/archive_read_support_compression_bzip2.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.16 2007/05/29 01:00:18 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.17 2008/02/19 05:44:59 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include @@ -145,7 +145,7 @@ (void)buff; /* UNUSED */ (void)n; /* UNUSED */ - archive_set_error(a, -1, + archive_set_error(&a->archive, -1, "This version of libarchive was compiled without bzip2 support"); return (ARCHIVE_FATAL); } ==== //depot/projects/e500/lib/libarchive/archive_read_support_compression_gzip.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.15 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.16 2008/02/19 05:44:59 kientzle Exp $"); #ifdef HAVE_ERRNO_H @@ -146,7 +146,7 @@ (void)buff; /* UNUSED */ (void)n; /* UNUSED */ - archive_set_error(a, -1, + archive_set_error(&a->archive, -1, "This version of libarchive was compiled without gzip support"); return (ARCHIVE_FATAL); } ==== //depot/projects/e500/lib/libarchive/archive_read_support_format_ar.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.7 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.8 2008/02/19 05:54:24 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -268,8 +268,7 @@ /* This must come before any call to _read_ahead. */ ar_parse_common_header(ar, entry, h); archive_entry_copy_pathname(entry, filename); - archive_entry_set_mode(entry, - S_IFREG | (archive_entry_mode(entry) & 0777)); + archive_entry_set_filetype(entry, AE_IFREG); /* Get the size of the filename table. */ number = ar_atol10(h + AR_size_offset, AR_size_size); if (number > SIZE_MAX) { @@ -375,8 +374,7 @@ /* Parse the time, owner, mode, size fields. */ r = ar_parse_common_header(ar, entry, h); /* Force the file type to a regular file. */ - archive_entry_set_mode(entry, - S_IFREG | (archive_entry_mode(entry) & 0777)); + archive_entry_set_filetype(entry, AE_IFREG); return (r); } ==== //depot/projects/e500/lib/libarchive/archive_read_support_format_iso9660.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.24 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.25 2008/02/19 06:02:01 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include @@ -1064,24 +1064,28 @@ if (t->tm_isdst) t->tm_hour -= 1; return (mktime(t)); /* Re-convert. */ -#else - /* - * If you don't have tm_gmtoff, let's try resetting the timezone - * (yecch!). - */ +#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV) && defined(HAVE_TZSET) + /* No timegm() and no tm_gmtoff, let's try forcing mktime() to UTC. */ time_t ret; char *tz; + /* Reset the timezone, remember the old one. */ tz = getenv("TZ"); setenv("TZ", "UTC 0", 1); tzset(); + ret = mktime(t); + + /* Restore the previous timezone. */ if (tz) setenv("TZ", tz, 1); else unsetenv("TZ"); tzset(); return ret; +#else + /* We have no choice but to use localtime instead of UTC. */ + return (mktime(t)); #endif } ==== //depot/projects/e500/lib/libarchive/archive_read_support_format_mtree.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.1 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.2 2008/02/19 06:07:10 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -50,6 +50,10 @@ #include "archive_read_private.h" #include "archive_string.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + struct mtree_entry { struct mtree_entry *next; char *name; @@ -371,7 +375,8 @@ * the contents file on disk.) */ if (archive_strlen(&mtree->contents_name) > 0) { - mtree->fd = open(mtree->contents_name.s, O_RDONLY); + mtree->fd = open(mtree->contents_name.s, + O_RDONLY | O_BINARY); if (mtree->fd < 0) { archive_set_error(&a->archive, errno, "Can't open content=\"%s\"", @@ -380,7 +385,8 @@ } } else { /* If the specified path opens, use it. */ - mtree->fd = open(mtree->current_dir.s, O_RDONLY); + mtree->fd = open(mtree->current_dir.s, + O_RDONLY | O_BINARY); /* But don't fail if it's not there. */ } ==== //depot/projects/e500/lib/libarchive/archive_write_disk.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.21 2008/01/18 06:16:08 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.22 2008/02/19 05:39:35 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include @@ -45,6 +45,9 @@ #ifdef HAVE_SYS_TIME_H #include #endif +#ifdef HAVE_SYS_UTIME_H +#include +#endif #ifdef HAVE_EXT2FS_EXT2_FS_H #include /* for Linux file flags */ @@ -89,6 +92,10 @@ #include "archive_entry.h" #include "archive_private.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + struct fixup_entry { struct fixup_entry *next; mode_t mode; @@ -636,7 +643,9 @@ a->archive.vtable = archive_write_disk_vtable(); a->lookup_uid = trivial_lookup_uid; a->lookup_gid = trivial_lookup_gid; +#ifdef HAVE_GETEUID a->user_uid = geteuid(); +#endif /* HAVE_GETEUID */ if (archive_string_ensure(&a->path_safe, 512) == NULL) { free(a); return (NULL); @@ -667,7 +676,7 @@ return; /* Try to record our starting dir. */ - a->restore_pwd = open(".", O_RDONLY); + a->restore_pwd = open(".", O_RDONLY | O_BINARY); if (a->restore_pwd < 0) return; @@ -705,6 +714,14 @@ int ret = ARCHIVE_OK, en; if (a->flags & ARCHIVE_EXTRACT_UNLINK && !S_ISDIR(a->mode)) { + /* + * TODO: Fix this. Apparently, there are platforms + * that still allow root to hose the entire filesystem + * by unlinking a dir. The S_ISDIR() test above + * prevents us from using unlink() here if the new + * object is a dir, but that doesn't mean the old + * object isn't a dir. + */ if (unlink(a->name) == 0) { /* We removed it, we're done. */ } else if (errno == ENOENT) { @@ -851,7 +868,7 @@ * for hardlink entries. */ if (r == 0 && a->filesize > 0) { - a->fd = open(a->name, O_WRONLY | O_TRUNC); + a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY); if (a->fd < 0) r = errno; } @@ -876,24 +893,38 @@ */ mode = final_mode & 0777; - switch (a->mode & S_IFMT) { + switch (a->mode & AE_IFMT) { default: /* POSIX requires that we fall through here. */ /* FALLTHROUGH */ - case S_IFREG: + case AE_IFREG: a->fd = open(a->name, - O_WRONLY | O_CREAT | O_EXCL, mode); + O_WRONLY | O_CREAT | O_EXCL | O_BINARY, mode); r = (a->fd < 0); break; - case S_IFCHR: + case AE_IFCHR: +#ifdef HAVE_MKNOD + /* Note: we use AE_IFCHR for the case label, and + * S_IFCHR for the mknod() call. This is correct. */ r = mknod(a->name, mode | S_IFCHR, archive_entry_rdev(a->entry)); +#else + /* TODO: Find a better way to warn about our inability + * to restore a char device node. */ + return (EINVAL); +#endif /* HAVE_MKNOD */ break; - case S_IFBLK: + case AE_IFBLK: +#ifdef HAVE_MKNOD r = mknod(a->name, mode | S_IFBLK, archive_entry_rdev(a->entry)); +#else + /* TODO: Find a better way to warn about our inability + * to restore a block device node. */ + return (EINVAL); +#endif /* HAVE_MKNOD */ break; - case S_IFDIR: + case AE_IFDIR: mode = (mode | MINIMUM_DIR_MODE) & MAXIMUM_DIR_MODE; r = mkdir(a->name, mode); if (r == 0) { @@ -906,8 +937,14 @@ a->todo &= ~TODO_MODE; } break; - case S_IFIFO: + case AE_IFIFO: +#ifdef HAVE_MKFIFO r = mkfifo(a->name, mode); +#else + /* TODO: Find a better way to warn about our inability + * to restore a fifo. */ + return (EINVAL); +#endif /* HAVE_MKFIFO */ break; } @@ -1453,28 +1490,34 @@ } #ifdef HAVE_FCHOWN - if (a->fd >= 0 && fchown(a->fd, a->uid, a->gid) == 0) - goto success; + /* If we have an fd, we can avoid a race. */ + if (a->fd >= 0 && fchown(a->fd, a->uid, a->gid) == 0) { + /* We've set owner and know uid/gid are correct. */ + a->todo &= ~(TODO_OWNER | TODO_SGID_CHECK | TODO_SUID_CHECK); + return (ARCHIVE_OK); + } #endif + /* We prefer lchown() but will use chown() if that's all we have. */ + /* Of course, if we have neither, this will always fail. */ #ifdef HAVE_LCHOWN - if (lchown(a->name, a->uid, a->gid) == 0) - goto success; -#else - if (!S_ISLNK(a->mode) && chown(a->name, a->uid, a->gid) == 0) - goto success; + if (lchown(a->name, a->uid, a->gid) == 0) { + /* We've set owner and know uid/gid are correct. */ + a->todo &= ~(TODO_OWNER | TODO_SGID_CHECK | TODO_SUID_CHECK); + return (ARCHIVE_OK); + } +#elif HAVE_CHOWN + if (!S_ISLNK(a->mode) && chown(a->name, a->uid, a->gid) == 0) { + /* We've set owner and know uid/gid are correct. */ + a->todo &= ~(TODO_OWNER | TODO_SGID_CHECK | TODO_SUID_CHECK); + return (ARCHIVE_OK); + } #endif archive_set_error(&a->archive, errno, "Can't set user=%d/group=%d for %s", a->uid, a->gid, a->name); return (ARCHIVE_WARN); -success: - a->todo &= ~TODO_OWNER; - /* We know the user/group are correct now. */ - a->todo &= ~TODO_SGID_CHECK; - a->todo &= ~TODO_SUID_CHECK; - return (ARCHIVE_OK); } #ifdef HAVE_UTIMES @@ -1812,7 +1855,7 @@ /* If we weren't given an fd, open it ourselves. */ if (myfd < 0) - myfd = open(name, O_RDONLY|O_NONBLOCK); + myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY); if (myfd < 0) return (ARCHIVE_OK); ==== //depot/projects/e500/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.19 2007/01/09 08:05:56 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.20 2008/02/19 05:46:58 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -47,6 +47,10 @@ #include "archive.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + struct write_file_data { int fd; char filename[1]; @@ -95,7 +99,7 @@ struct stat st; mine = (struct write_file_data *)client_data; - flags = O_WRONLY | O_CREAT | O_TRUNC; + flags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY; /* * Open the file. ==== //depot/projects/e500/lib/libarchive/archive_write_set_compression_gzip.c#4 (text+ko) ==== @@ -28,7 +28,7 @@ /* Don't compile this if we don't have zlib. */ #if HAVE_ZLIB_H -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.15 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.16 2008/02/21 03:21:50 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include @@ -106,6 +106,21 @@ return (ret); } + /* + * The next check is a temporary workaround until the gzip + * code can be overhauled some. The code should not require + * that compressed_buffer_size == bytes_per_block. Removing + * this assumption will allow us to compress larger chunks at + * a time, which should improve overall performance + * marginally. As a minor side-effect, such a cleanup would + * allow us to support truly arbitrary block sizes. + */ + if (a->bytes_per_block < 10) { + archive_set_error(&a->archive, EINVAL, + "GZip compressor requires a minimum 10 byte block size"); + return (ARCHIVE_FATAL); + } + state = (struct private_data *)malloc(sizeof(*state)); if (state == NULL) { archive_set_error(&a->archive, ENOMEM, @@ -114,6 +129,10 @@ } memset(state, 0, sizeof(*state)); + /* + * See comment above. We should set compressed_buffer_size to + * max(bytes_per_block, 65536), but the code can't handle that yet. + */ state->compressed_buffer_size = a->bytes_per_block; state->compressed = (unsigned char *)malloc(state->compressed_buffer_size); state->crc = crc32(0L, NULL, 0); ==== //depot/projects/e500/lib/libarchive/config_freebsd.h#3 (text+ko) ==== @@ -22,7 +22,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. * - * $FreeBSD: src/lib/libarchive/config_freebsd.h,v 1.5 2007/05/29 01:00:20 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/config_freebsd.h,v 1.6 2008/02/19 05:40:28 kientzle Exp $ */ /* FreeBSD 5.0 and later have ACL support. */ @@ -37,6 +37,7 @@ #define HAVE_BZLIB_H 1 #define HAVE_CHFLAGS 1 +#define HAVE_CHOWN 1 #define HAVE_DECL_INT64_MAX 1 #define HAVE_DECL_INT64_MIN 1 #define HAVE_DECL_SIZE_MAX 1 @@ -53,6 +54,7 @@ #define HAVE_FCNTL_H 1 #define HAVE_FSEEKO 1 #define HAVE_FUTIMES 1 +#define HAVE_GETEUID 1 #define HAVE_GRP_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_LCHFLAGS 1 @@ -65,10 +67,12 @@ #define HAVE_MEMSET 1 #define HAVE_MKDIR 1 #define HAVE_MKFIFO 1 +#define HAVE_MKNOD 1 #define HAVE_POLL 1 #define HAVE_POLL_H 1 #define HAVE_PWD_H 1 #define HAVE_SELECT 1 +#define HAVE_SETENV 1 #define HAVE_STDINT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRCHR 1 @@ -87,9 +91,12 @@ #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TYPES_H 1 +#undef HAVE_SYS_UTIME_H #define HAVE_SYS_WAIT_H 1 #define HAVE_TIMEGM 1 +#define HAVE_TZSET 1 #define HAVE_UNISTD_H 1 +#define HAVE_UNSETENV 1 #define HAVE_UTIME 1 #define HAVE_UTIMES 1 #define HAVE_UTIME_H 1 ==== //depot/projects/e500/lib/libarchive/test/main.c#5 (text+ko) ==== @@ -34,16 +34,13 @@ */ #define PROGRAM "LIBARCHIVE" -/* - * Various utility routines useful for test programs. - * Each test program is linked against this file. - */ #include +#include #include #include #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.9 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.10 2008/02/19 05:52:30 kientzle Exp $"); /* * "list.h" is simply created by "grep DEFINE_TEST"; it has @@ -226,20 +223,21 @@ } /* Generic assert() just displays the failed condition. */ -void +int test_assert(const char *file, int line, int value, const char *condition, void *extra) { ++assertions; if (value) { msg[0] = '\0'; - return; + return (value); } failures ++; if (previous_failures(file, line)) - return; + return (value); fprintf(stderr, "%s:%d: Assertion failed\n", file, line); fprintf(stderr, " Condition: %s\n", condition); report_failure(extra); + return (value); } /* assertEqualInt() displays the values of the two integers. */ @@ -553,6 +551,8 @@ tests[i].name); exit(1); } + /* Explicitly reset the locale before each test. */ + setlocale(LC_ALL, "C"); /* Run the actual test. */ (*tests[i].func)(); /* Summarize the results of this test. */ >>> TRUNCATED FOR MAIL (1000 lines) <<<