PERFORCE change 52174 for review
Robert Watson
rwatson at FreeBSD.org
Mon May 3 22:48:06 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=52174
Change 52174 by rwatson at rwatson_tislabs on 2004/05/03 15:47:15
Integrate TrustedBSD base branch from FreeBSD vendor branch:
ls(1) now does multi-byte characters.
libarchive(3) now compiles and is usable on Linux.
libc(3) can now be built without floating point support.
geom gate(4) allows export and import of storage devices over
TCP/IP.
route(4) routing sockets and miibus updated to allow routing
messages to track link state changes on ethernet devices.
GPT(4) support on non-ia64 systems.
Various pf(4) updates from OpenBSD.
asr(4) cleaned up.
MAC_STATIC kernel option avoids cost of MAC Framework
synchronization for statically configured systems, looped back
from trustedbsd_mac branch.
ip_fastfwd cleaned up.
ip_claim_next_hop() -> m_claim_next()
saorder_state_valid for FAST_IPSEC.
mac_test(4) now handles NULL mbuf pointer, looped back from
trustedbsd_mac branch.
du(1) hard link tracking efficiency improvements.
Affected files ...
.. //depot/projects/trustedbsd/mac/bin/ls/extern.h#10 integrate
.. //depot/projects/trustedbsd/mac/bin/ls/ls.1#24 integrate
.. //depot/projects/trustedbsd/mac/bin/ls/print.c#23 integrate
.. //depot/projects/trustedbsd/mac/bin/ls/util.c#13 integrate
.. //depot/projects/trustedbsd/mac/gnu/usr.bin/gzip/gzip.c#2 integrate
.. //depot/projects/trustedbsd/mac/gnu/usr.bin/gzip/gzip.h#2 integrate
.. //depot/projects/trustedbsd/mac/gnu/usr.bin/gzip/unzip.c#2 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive.h#3 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive_entry.c#3 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive_entry.h#3 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive_platform.h#3 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive_private.h#3 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive_read_support_format_cpio.c#3 integrate
.. //depot/projects/trustedbsd/mac/lib/libarchive/archive_string.h#2 integrate
.. //depot/projects/trustedbsd/mac/lib/libc/Makefile#13 integrate
.. //depot/projects/trustedbsd/mac/lib/libc/gen/fmtcheck.c#5 integrate
.. //depot/projects/trustedbsd/mac/lib/libc/stdio/vfprintf.c#18 integrate
.. //depot/projects/trustedbsd/mac/lib/libc/stdio/vfscanf.c#17 integrate
.. //depot/projects/trustedbsd/mac/lib/libc/stdio/vfwprintf.c#10 integrate
.. //depot/projects/trustedbsd/mac/lib/libc/stdio/vfwscanf.c#9 integrate
.. //depot/projects/trustedbsd/mac/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#70 integrate
.. //depot/projects/trustedbsd/mac/release/scripts/print-cdrom-packages.sh#24 integrate
.. //depot/projects/trustedbsd/mac/sbin/Makefile#25 integrate
.. //depot/projects/trustedbsd/mac/sbin/gconcat/Makefile#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggatec/Makefile#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggatec/ggatec.8#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggatec/ggatec.c#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggated/Makefile#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggated/ggated.c#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggatel/Makefile#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggatel/ggatel.8#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/ggatel/ggatel.c#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/ggate/shared/ggate.c#2 integrate
.. //depot/projects/trustedbsd/mac/sbin/route/route.c#10 integrate
.. //depot/projects/trustedbsd/mac/secure/Makefile#6 integrate
.. //depot/projects/trustedbsd/mac/share/man/man4/asr.4#4 integrate
.. //depot/projects/trustedbsd/mac/share/man/man4/atapicam.4#4 integrate
.. //depot/projects/trustedbsd/mac/share/man/man4/hme.4#2 integrate
.. //depot/projects/trustedbsd/mac/share/man/man4/rl.4#8 integrate
.. //depot/projects/trustedbsd/mac/share/misc/bsd-family-tree#15 integrate
.. //depot/projects/trustedbsd/mac/sys/alpha/conf/GENERIC#29 integrate
.. //depot/projects/trustedbsd/mac/sys/amd64/conf/GENERIC#10 integrate
.. //depot/projects/trustedbsd/mac/sys/cam/scsi/scsi_da.c#36 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/NOTES#53 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/files#105 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/files.i386#37 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/files.pc98#33 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/majors#30 integrate
.. //depot/projects/trustedbsd/mac/sys/conf/options#64 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/pf/net/pf.c#3 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/pf/net/pf_ioctl.c#3 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/pf/net/pf_norm.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/asr/asr.c#16 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/cy/cy_isa.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/cy/cy_pci.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/led/led.c#6 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/brgphy.c#16 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/dcphy.c#13 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/e1000phy.c#9 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/mii.c#11 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/mii_physubr.c#10 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/mlphy.c#10 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/rgephy.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/ruephy.c#3 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/tlphy.c#11 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/mii/xmphy.c#12 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/usb/usbdevs#32 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/usb/usbdevs.h#32 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/usb/usbdevs_data.h#32 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/usb/uvscom.c#14 integrate
.. //depot/projects/trustedbsd/mac/sys/geom/gate/g_gate.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/geom/gate/g_gate.h#2 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/conf/GENERIC#36 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/conf/NOTES#46 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/i386/mptable_pci.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/include/legacyvar.h#3 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/isa/atpic.c#7 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/isa/cy.c#15 delete
.. //depot/projects/trustedbsd/mac/sys/i386/isa/cyreg.h#2 delete
.. //depot/projects/trustedbsd/mac/sys/i386/isa/ic/cd1400.h#2 delete
.. //depot/projects/trustedbsd/mac/sys/i386/pci/pci_bus.c#21 integrate
.. //depot/projects/trustedbsd/mac/sys/ia64/conf/GENERIC#29 integrate
.. //depot/projects/trustedbsd/mac/sys/ia64/conf/SKI#14 integrate
.. //depot/projects/trustedbsd/mac/sys/ia64/ia64/trap.c#25 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/kern_clock.c#23 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#438 integrate
.. //depot/projects/trustedbsd/mac/sys/modules/geom/Makefile#4 integrate
.. //depot/projects/trustedbsd/mac/sys/net/if.h#22 integrate
.. //depot/projects/trustedbsd/mac/sys/net/if_var.h#24 integrate
.. //depot/projects/trustedbsd/mac/sys/net/if_vlan.c#22 integrate
.. //depot/projects/trustedbsd/mac/sys/net/rtsock.c#25 integrate
.. //depot/projects/trustedbsd/mac/sys/netinet/ip_fastfwd.c#5 integrate
.. //depot/projects/trustedbsd/mac/sys/netinet/ip_input.c#44 integrate
.. //depot/projects/trustedbsd/mac/sys/netinet/ip_output.c#39 integrate
.. //depot/projects/trustedbsd/mac/sys/netinet/ip_var.h#23 integrate
.. //depot/projects/trustedbsd/mac/sys/netinet/raw_ip.c#33 integrate
.. //depot/projects/trustedbsd/mac/sys/netinet/tcp_input.c#52 integrate
.. //depot/projects/trustedbsd/mac/sys/netipsec/key.c#8 integrate
.. //depot/projects/trustedbsd/mac/sys/pc98/conf/GENERIC#32 integrate
.. //depot/projects/trustedbsd/mac/sys/pc98/conf/NOTES#13 integrate
.. //depot/projects/trustedbsd/mac/sys/pci/cy_pci.c#8 delete
.. //depot/projects/trustedbsd/mac/sys/powerpc/conf/GENERIC#20 integrate
.. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#132 integrate
.. //depot/projects/trustedbsd/mac/sys/sparc64/conf/GENERIC#34 integrate
.. //depot/projects/trustedbsd/mac/sys/sys/mbuf.h#38 integrate
.. //depot/projects/trustedbsd/mac/tools/regression/geom_gate/Makefile#1 branch
.. //depot/projects/trustedbsd/mac/tools/regression/geom_gate/runtests.sh#1 branch
.. //depot/projects/trustedbsd/mac/tools/regression/geom_gate/test-1.sh#1 branch
.. //depot/projects/trustedbsd/mac/tools/regression/geom_gate/test-2.sh#1 branch
.. //depot/projects/trustedbsd/mac/tools/regression/geom_gate/test-3.sh#1 branch
.. //depot/projects/trustedbsd/mac/tools/tools/nanobsd/i386.diskimage#3 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/du/du.c#10 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/rpcgen/rpc_main.c#6 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/tar/bsdtar.c#2 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/tar/bsdtar.h#2 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/tar/bsdtar_platform.h#2 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/tar/read.c#2 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/tar/util.c#2 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/tar/write.c#2 integrate
.. //depot/projects/trustedbsd/mac/usr.sbin/jail/jail.8#16 integrate
Differences ...
==== //depot/projects/trustedbsd/mac/bin/ls/extern.h#10 (text+ko) ====
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*
* from: @(#)extern.h 8.1 (Berkeley) 5/31/93
- * $FreeBSD: src/bin/ls/extern.h,v 1.22 2004/04/06 20:06:47 markm Exp $
+ * $FreeBSD: src/bin/ls/extern.h,v 1.23 2004/05/02 11:25:37 tjr Exp $
*/
int acccmp(const FTSENT *, const FTSENT *);
@@ -45,6 +45,7 @@
void printscol(const DISPLAY *);
void printstream(const DISPLAY *);
void usage(void);
+int prn_normal(const char *);
size_t len_octal(const char *, int);
int prn_octal(const char *);
int prn_printable(const char *);
==== //depot/projects/trustedbsd/mac/bin/ls/ls.1#24 (text+ko) ====
@@ -29,9 +29,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
-.\" $FreeBSD: src/bin/ls/ls.1,v 1.79 2004/04/06 20:06:47 markm Exp $
+.\" $FreeBSD: src/bin/ls/ls.1,v 1.80 2004/05/02 11:25:37 tjr Exp $
.\"
-.Dd March 21, 2004
+.Dd May 2, 2004
.Dt LS 1
.Os
.Sh NAME
@@ -673,7 +673,3 @@
.Sh BUGS
To maintain backward compatibility, the relationships between the many
options are quite complex.
-.Pp
-The
-.Nm
-utility does not recognize multibyte characters in filenames.
==== //depot/projects/trustedbsd/mac/bin/ls/print.c#23 (text+ko) ====
@@ -36,7 +36,7 @@
#endif /* not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ls/print.c,v 1.70 2004/04/06 20:06:47 markm Exp $");
+__FBSDID("$FreeBSD: src/bin/ls/print.c,v 1.71 2004/05/02 11:25:37 tjr Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -147,7 +147,7 @@
else if (f_nonprint)
return prn_printable(name);
else
- return printf("%s", name);
+ return prn_normal(name);
}
void
@@ -239,6 +239,7 @@
for (p = dp->list, chcnt = 0; p; p = p->fts_link) {
if (p->fts_number == NO_PRINT)
continue;
+ /* XXX strlen does not take octal escapes into account. */
if (strlen(p->fts_name) + chcnt +
(p->fts_link ? 2 : 0) >= (unsigned)termwidth) {
putchar('\n');
==== //depot/projects/trustedbsd/mac/bin/ls/util.c#13 (text+ko) ====
@@ -36,7 +36,7 @@
#endif /* not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ls/util.c,v 1.33 2004/04/06 20:06:47 markm Exp $");
+__FBSDID("$FreeBSD: src/bin/ls/util.c,v 1.35 2004/05/03 11:48:55 tjr Exp $");
#include <sys/types.h>
#include <sys/stat.h>
@@ -44,25 +44,82 @@
#include <ctype.h>
#include <err.h>
#include <fts.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
#include "ls.h"
#include "extern.h"
int
+prn_normal(const char *s)
+{
+ mbstate_t mbs;
+ wchar_t wc;
+ int i, n;
+ size_t clen;
+
+ memset(&mbs, 0, sizeof(mbs));
+ n = 0;
+ while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
+ if (clen == (size_t)-2) {
+ n += printf("%s", s);
+ break;
+ }
+ if (clen == (size_t)-1) {
+ memset(&mbs, 0, sizeof(mbs));
+ putchar((unsigned char)*s);
+ s++;
+ n++;
+ continue;
+ }
+ for (i = 0; i < (int)clen; i++)
+ putchar((unsigned char)s[i]);
+ s += clen;
+ if (iswprint(wc))
+ n += wcwidth(wc);
+ }
+ return (n);
+}
+
+int
prn_printable(const char *s)
{
- char c;
- int n;
+ mbstate_t mbs;
+ wchar_t wc;
+ int i, n;
+ size_t clen;
- for (n = 0; (c = *s) != '\0'; ++s, ++n)
- if (isprint((unsigned char)c))
- putchar(c);
- else
+ memset(&mbs, 0, sizeof(mbs));
+ n = 0;
+ while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
+ if (clen == (size_t)-1) {
+ putchar('?');
+ s++;
+ n++;
+ memset(&mbs, 0, sizeof(mbs));
+ continue;
+ }
+ if (clen == (size_t)-2) {
+ putchar('?');
+ n++;
+ break;
+ }
+ if (!iswprint(wc)) {
putchar('?');
- return n;
+ s += clen;
+ n++;
+ continue;
+ }
+ for (i = 0; i < (int)clen; i++)
+ putchar((unsigned char)s[i]);
+ s += clen;
+ n += wcwidth(wc);
+ }
+ return (n);
}
/*
@@ -81,70 +138,83 @@
size_t
len_octal(const char *s, int len)
{
- size_t r = 0;
+ mbstate_t mbs;
+ wchar_t wc;
+ size_t clen, r;
- while (len--)
- if (isprint((unsigned const char)*s++)) r++; else r += 4;
- return r;
+ memset(&mbs, 0, sizeof(mbs));
+ r = 0;
+ while (len != 0 && (clen = mbrtowc(&wc, s, len, &mbs)) != 0) {
+ if (clen == (size_t)-1) {
+ r += 4;
+ s++;
+ len--;
+ memset(&mbs, 0, sizeof(mbs));
+ continue;
+ }
+ if (clen == (size_t)-2) {
+ r += 4 * len;
+ break;
+ }
+ if (iswprint(wc))
+ r++;
+ else
+ r += 4 * clen;
+ s += clen;
+ }
+ return (r);
}
int
prn_octal(const char *s)
{
- unsigned char ch;
- int len = 0;
+ static const char esc[] = "\\\\\"\"\aa\bb\ff\nn\rr\tt\vv";
+ const char *p;
+ mbstate_t mbs;
+ wchar_t wc;
+ size_t clen;
+ unsigned char ch;
+ int goodchar, i, len, prtlen;
- while ((ch = (unsigned char)*s++)) {
- if (isprint(ch) && (ch != '\"') && (ch != '\\'))
- putchar(ch), len++;
- else if (f_octal_escape) {
- putchar('\\');
- switch (ch) {
- case '\\':
- putchar('\\');
- break;
- case '\"':
- putchar('"');
- break;
- case '\a':
- putchar('a');
- break;
- case '\b':
- putchar('b');
- break;
- case '\f':
- putchar('f');
- break;
- case '\n':
- putchar('n');
- break;
- case '\r':
- putchar('r');
- break;
- case '\t':
- putchar('t');
- break;
- case '\v':
- putchar('v');
- break;
- default:
+ memset(&mbs, 0, sizeof(mbs));
+ len = 0;
+ while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
+ goodchar = clen != (size_t)-1 && clen != (size_t)-2;
+ if (goodchar && iswprint(wc) && wc != L'\"' && wc != L'\\') {
+ for (i = 0; i < (int)clen; i++)
+ putchar((unsigned char)s[i]);
+ len += wcwidth(wc);
+ } else if (goodchar && f_octal_escape && wc >= 0 &&
+ wc <= (wchar_t)UCHAR_MAX &&
+ (p = strchr(esc, (char)wc)) != NULL) {
+ putchar('\\');
+ putchar(p[1]);
+ len += 2;
+ } else {
+ if (goodchar)
+ prtlen = clen;
+ else if (clen == (size_t)-1)
+ prtlen = 1;
+ else
+ prtlen = strlen(s);
+ for (i = 0; i < prtlen; i++) {
+ ch = (unsigned char)s[i];
+ putchar('\\');
putchar('0' + (ch >> 6));
putchar('0' + ((ch >> 3) & 7));
putchar('0' + (ch & 7));
- len += 2;
- break;
- }
- len += 2;
- }
- else {
- putchar('\\');
- putchar('0' + (ch >> 6));
- putchar('0' + ((ch >> 3) & 7));
- putchar('0' + (ch & 7));
- len += 4;
+ len += 4;
+ }
}
+ if (clen == (size_t)-2)
+ break;
+ if (clen == (size_t)-1) {
+ memset(&mbs, 0, sizeof(mbs));
+ s++;
+ } else
+ s += clen;
}
- return len;
+ return (len);
}
void
==== //depot/projects/trustedbsd/mac/gnu/usr.bin/gzip/gzip.c#2 (text+ko) ====
@@ -45,7 +45,7 @@
*/
#ifdef RCSID
-static char rcsid[] = "$FreeBSD: src/gnu/usr.bin/gzip/gzip.c,v 1.10 1999/08/27 23:35:50 peter Exp $";
+static char rcsid[] = "$FreeBSD: src/gnu/usr.bin/gzip/gzip.c,v 1.11 2004/05/03 10:29:23 obrien Exp $";
#endif
#include <ctype.h>
@@ -1011,14 +1011,15 @@
#ifdef NO_MULTIPLE_DOTS
char *dot; /* pointer to ifname extension, or NULL */
#endif
+ int max_suffix_len = (z_len > 3 ? z_len : 3);
- if (strlen(iname) >= sizeof(ifname) - 3) {
+ /* Leave enough room in ifname or ofname for suffix: */
+ if (strlen(iname) >= sizeof(ifname) - max_suffix_len) {
errno = ENAMETOOLONG;
perror(iname);
exit_code = ERROR;
return ERROR;
}
-
strcpy(ifname, iname);
/* If input file exists, return OK. */
==== //depot/projects/trustedbsd/mac/gnu/usr.bin/gzip/gzip.h#2 (text+ko) ====
@@ -2,6 +2,8 @@
* Copyright (C) 1992-1993 Jean-loup Gailly.
* This is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License, see the file COPYING.
+ *
+ * $FreeBSD: src/gnu/usr.bin/gzip/gzip.h,v 1.4 2004/05/02 23:07:49 obrien Exp $
*/
#if defined(__STDC__) || defined(PROTO)
@@ -41,9 +43,10 @@
#define local static
-typedef unsigned char uch;
-typedef unsigned short ush;
-typedef unsigned long ulg;
+#include <stdint.h>
+typedef uint8_t uch;
+typedef uint16_t ush;
+typedef uint32_t ulg;
/* Return codes from gzip */
#define OK 0
==== //depot/projects/trustedbsd/mac/gnu/usr.bin/gzip/unzip.c#2 (text+ko) ====
@@ -14,8 +14,10 @@
*/
#ifdef RCSID
-static char rcsid[] = "$FreeBSD: src/gnu/usr.bin/gzip/unzip.c,v 1.6 1999/08/27 23:35:54 peter Exp $";
+static char rcsid[] = "$Id: unzip.c,v 0.13 1993/06/10 13:29:00 jloup Exp $";
#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/gnu/usr.bin/gzip/unzip.c,v 1.8 2004/05/03 10:33:27 obrien Exp $");
#include "tailor.h"
#include "gzip.h"
@@ -35,6 +37,7 @@
#define LOCEXT 28 /* offset of extra field length */
#define LOCHDR 30 /* size of local header, including sig */
#define EXTHDR 16 /* size of extended local header, inc sig */
+#define RAND_HEAD_LEN 12 /* length of encryption random header */
/* Globals */
@@ -103,6 +106,7 @@
ulg orig_len = 0; /* original uncompressed length */
int n;
uch buf[EXTHDR]; /* extended local header */
+ int err = OK;
ifd = in;
ofd = out;
@@ -136,9 +140,6 @@
}
while (n--) {
uch c = (uch)get_byte();
-#ifdef CRYPT
- if (decrypt) zdecode(c);
-#endif
put_ubyte(c);
}
flush_window();
@@ -172,10 +173,14 @@
/* Validate decompression */
if (orig_crc != updcrc(outbuf, 0)) {
- error("invalid compressed data--crc error");
+ fprintf(stderr, "\n%s: %s: invalid compressed data--crc error\n",
+ progname, ifname);
+ err = ERROR;
}
- if (orig_len != (ulg)bytes_out) {
- error("invalid compressed data--length error");
+ if (((orig_len - (ulg)bytes_out) & 0x0ffffffffL) != 0) {
+ fprintf(stderr, "\n%s: %s: invalid compressed data--length error\n",
+ progname, ifname);
+ err = ERROR;
}
/* Check if there are more entries in a pkzip file */
@@ -189,11 +194,12 @@
fprintf(stderr,
"%s: %s has more than one entry -- unchanged\n",
progname, ifname);
- exit_code = ERROR;
- ext_header = pkzip = 0;
- return ERROR;
+ err = ERROR;
}
}
ext_header = pkzip = 0; /* for next file */
- return OK;
+ if (err == OK) return OK;
+ exit_code = ERROR;
+ if (!test) abort_gzip();
+ return err;
}
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive.h#3 (text+ko) ====
@@ -23,7 +23,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.h,v 1.7 2004/04/28 04:41:26 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive.h,v 1.8 2004/05/03 01:40:34 kientzle Exp $
*/
#ifndef ARCHIVE_H_INCLUDED
@@ -58,11 +58,11 @@
* platform-dependent error code.
*/
/* Unrecognized or invalid file format. */
-/* #define ARCHIVE_ERRNO_FILE_FORMAT */
+/* #define ARCHIVE_ERRNO_FILE_FORMAT */
/* Illegal usage of the library. */
-/* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */
+/* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */
/* Unknown or unclassified error. */
-/* #define ARCHIVE_ERRNO_MISC */
+/* #define ARCHIVE_ERRNO_MISC */
/*
* Callbacks are invoked to automatically read/write/open/close the archive.
@@ -96,9 +96,9 @@
#define ARCHIVE_FORMAT_BASE_MASK 0xff0000U
#define ARCHIVE_FORMAT_CPIO 0x10000
#define ARCHIVE_FORMAT_CPIO_POSIX (ARCHIVE_FORMAT_CPIO | 1)
-#define ARCHIVE_FORMAT_SHAR 0x20000
-#define ARCHIVE_FORMAT_SHAR_BASE (ARCHIVE_FORMAT_SHAR | 1)
-#define ARCHIVE_FORMAT_SHAR_DUMP (ARCHIVE_FORMAT_SHAR | 2)
+#define ARCHIVE_FORMAT_SHAR 0x20000
+#define ARCHIVE_FORMAT_SHAR_BASE (ARCHIVE_FORMAT_SHAR | 1)
+#define ARCHIVE_FORMAT_SHAR_DUMP (ARCHIVE_FORMAT_SHAR | 2)
#define ARCHIVE_FORMAT_TAR 0x30000
#define ARCHIVE_FORMAT_TAR_USTAR (ARCHIVE_FORMAT_TAR | 1)
#define ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE (ARCHIVE_FORMAT_TAR | 2)
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive_entry.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.10 2004/04/26 23:37:54 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.12 2004/05/03 01:40:34 kientzle Exp $");
#include <sys/stat.h>
#include <sys/types.h>
@@ -35,6 +35,10 @@
#include <string.h>
#include <wchar.h>
+#ifdef LINUX
+#include <ext2fs/ext2_fs.h> /* for Linux file flags */
+#endif
+
#include "archive.h"
#include "archive_entry.h"
@@ -1337,8 +1341,8 @@
#endif
{ NULL, NULL, 0, 0 }
};
-#define longestflaglen 12
-#define nmappings (sizeof(mapping) / sizeof(mapping[0]))
+#define longestflaglen 12
+#define nmappings (sizeof(mapping) / sizeof(mapping[0]))
/*
* fflagstostr --
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive_entry.h#3 (text+ko) ====
@@ -23,7 +23,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_entry.h,v 1.7 2004/04/26 23:37:54 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.8 2004/05/03 01:40:34 kientzle Exp $
*/
#ifndef ARCHIVE_ENTRY_H_INCLUDED
@@ -130,9 +130,9 @@
* "permset"/"perm" abstract type nonsense. A permset is just a simple
* bitmap, following long-standing Unix tradition.
*/
-#define ARCHIVE_ENTRY_ACL_EXECUTE 1
-#define ARCHIVE_ENTRY_ACL_WRITE 2
-#define ARCHIVE_ENTRY_ACL_READ 4
+#define ARCHIVE_ENTRY_ACL_EXECUTE 1
+#define ARCHIVE_ENTRY_ACL_WRITE 2
+#define ARCHIVE_ENTRY_ACL_READ 4
/* We need to be able to specify either or both of these. */
#define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 256
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive_platform.h#3 (text+ko) ====
@@ -23,7 +23,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.7 2004/04/21 05:13:42 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.8 2004/05/03 01:40:34 kientzle Exp $
*/
/*
@@ -48,24 +48,24 @@
#include <inttypes.h> /* For int64_t, etc. */
#if __FreeBSD__ > 4
-#define HAVE_POSIX_ACL 1
+#define HAVE_POSIX_ACL 1
#endif
-#define HAVE_CHFLAGS 1
-#define HAVE_LUTIMES 1
-#define HAVE_LCHMOD 1
-#define HAVE_STRERROR_R 1
-#define ARCHIVE_ERRNO_FILE_FORMAT EFTYPE
-#define ARCHIVE_ERRNO_PROGRAMMER EINVAL
-#define ARCHIVE_ERRNO_MISC (-1)
+#define HAVE_CHFLAGS 1
+#define HAVE_LUTIMES 1
+#define HAVE_LCHMOD 1
+#define HAVE_STRERROR_R 1
+#define ARCHIVE_ERRNO_FILE_FORMAT EFTYPE
+#define ARCHIVE_ERRNO_PROGRAMMER EINVAL
+#define ARCHIVE_ERRNO_MISC (-1)
/* Fetch/set high-resolution time data through a struct stat pointer. */
-#define ARCHIVE_STAT_ATIME_NANOS(st) (st)->st_atimespec.tv_nsec
-#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctimespec.tv_nsec
-#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtimespec.tv_nsec
-#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) (st)->st_atimespec.tv_nsec = (n)
-#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) (st)->st_ctimespec.tv_nsec = (n)
-#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) (st)->st_mtimespec.tv_nsec = (n)
+#define ARCHIVE_STAT_ATIME_NANOS(st) (st)->st_atimespec.tv_nsec
+#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctimespec.tv_nsec
+#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtimespec.tv_nsec
+#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) (st)->st_atimespec.tv_nsec = (n)
+#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) (st)->st_ctimespec.tv_nsec = (n)
+#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) (st)->st_mtimespec.tv_nsec = (n)
/*
* Older versions of inttypes.h don't have INT64_MAX, etc. Since
@@ -76,11 +76,11 @@
#ifndef INT64_MAX
/* XXX Is this really necessary? XXX */
#ifdef __i386__
-#define INT64_MAX 0x7fffffffffffffffLL
-#define UINT64_MAX 0xffffffffffffffffULL
+#define INT64_MAX 0x7fffffffffffffffLL
+#define UINT64_MAX 0xffffffffffffffffULL
#else /* __alpha__ */
-#define INT64_MAX 0x7fffffffffffffffL
-#define UINT64_MAX 0xffffffffffffffffUL
+#define INT64_MAX 0x7fffffffffffffffL
+#define UINT64_MAX 0xffffffffffffffffUL
#endif
#endif /* ! INT64_MAX */
@@ -88,35 +88,35 @@
/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
#ifndef __FreeBSD__
-#define __FBSDID(a) /* null */
+#define __FBSDID(a) /* null */
#endif
/* Linux */
#ifdef LINUX
-#define _FILE_OFFSET_BITS 64 /* Needed for 64-bit file size handling. */
+#define _FILE_OFFSET_BITS 64 /* Needed for 64-bit file size handling. */
#include <inttypes.h>
-#define ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
-#define ARCHIVE_ERRNO_PROGRAMMER EINVAL
-#define ARCHIVE_ERRNO_MISC (-1)
-#define HAVE_STRERROR_R 1
-#define STRERROR_R_CHAR_P 1
+#define ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
+#define ARCHIVE_ERRNO_PROGRAMMER EINVAL
+#define ARCHIVE_ERRNO_MISC (-1)
+#define HAVE_STRERROR_R 1
+#define STRERROR_R_CHAR_P 1
#ifdef HAVE_STRUCT_STAT_TIMESPEC
/* Fetch the nanosecond portion of the timestamp from a struct stat pointer. */
-#define ARCHIVE_STAT_ATIME_NANOS(pstat) (pstat)->st_atim.tv_nsec
-#define ARCHIVE_STAT_CTIME_NANOS(pstat) (pstat)->st_ctim.tv_nsec
-#define ARCHIVE_STAT_MTIME_NANOS(pstat) (pstat)->st_mtim.tv_nsec
-#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) (st)->st_atim.tv_nsec = (n)
-#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) (st)->st_ctim.tv_nsec = (n)
-#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) (st)->st_mtim.tv_nsec = (n)
+#define ARCHIVE_STAT_ATIME_NANOS(pstat) (pstat)->st_atim.tv_nsec
+#define ARCHIVE_STAT_CTIME_NANOS(pstat) (pstat)->st_ctim.tv_nsec
+#define ARCHIVE_STAT_MTIME_NANOS(pstat) (pstat)->st_mtim.tv_nsec
+#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) (st)->st_atim.tv_nsec = (n)
+#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) (st)->st_ctim.tv_nsec = (n)
+#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) (st)->st_mtim.tv_nsec = (n)
#else
/* High-res timestamps aren't available, so just use stubs here. */
-#define ARCHIVE_STAT_ATIME_NANOS(pstat) 0
-#define ARCHIVE_STAT_CTIME_NANOS(pstat) 0
-#define ARCHIVE_STAT_MTIME_NANOS(pstat) 0
-#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n)
-#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n)
-#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n)
+#define ARCHIVE_STAT_ATIME_NANOS(pstat) 0
+#define ARCHIVE_STAT_CTIME_NANOS(pstat) 0
+#define ARCHIVE_STAT_MTIME_NANOS(pstat) 0
+#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n)
+#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n)
+#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n)
#endif
#endif
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive_private.h#3 (text+ko) ====
@@ -23,7 +23,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_private.h,v 1.7 2004/04/28 04:41:26 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_private.h,v 1.8 2004/05/03 01:40:34 kientzle Exp $
*/
#ifndef ARCHIVE_PRIVATE_H_INCLUDED
@@ -209,7 +209,7 @@
#define ARCHIVE_STATE_NEW 1U
#define ARCHIVE_STATE_HEADER 2U
#define ARCHIVE_STATE_DATA 4U
-#define ARCHIVE_STATE_EOF 8U
+#define ARCHIVE_STATE_EOF 8U
#define ARCHIVE_STATE_CLOSED 0x10U
#define ARCHIVE_STATE_FATAL 0x8000U
@@ -231,6 +231,6 @@
int (*bid)(const void *, size_t),
int (*init)(struct archive *, const void *, size_t));
-#define err_combine(a,b) ((a) < (b) ? (a) : (b))
+#define err_combine(a,b) ((a) < (b) ? (a) : (b))
#endif
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive_read_support_format_cpio.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.8 2004/04/28 03:44:08 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.9 2004/05/03 01:40:34 kientzle Exp $");
#include <sys/stat.h>
@@ -94,7 +94,7 @@
char *name;
};
-#define CPIO_MAGIC 0x13141516
+#define CPIO_MAGIC 0x13141516
struct cpio {
int magic;
int (*read_header)(struct archive *, struct stat *,
==== //depot/projects/trustedbsd/mac/lib/libarchive/archive_string.h#2 (text+ko) ====
@@ -23,7 +23,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_string.h,v 1.2 2004/03/19 22:37:06 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_string.h,v 1.3 2004/05/03 01:40:34 kientzle Exp $
*
*/
@@ -51,7 +51,7 @@
};
/* Initialize an archive_string object on the stack or elsewhere. */
-#define archive_string_init(a) \
+#define archive_string_init(a) \
do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
/* Append a C char to an archive_string, resizing as necessary. */
@@ -102,11 +102,11 @@
/* Like 'vsprintf', but resizes the underlying string as necessary. */
void __archive_string_vsprintf(struct archive_string *, const char *,
va_list);
-#define archive_string_vsprintf __archive_string_vsprintf
+#define archive_string_vsprintf __archive_string_vsprintf
/* Like 'sprintf', but resizes the underlying string as necessary. */
void __archive_string_sprintf(struct archive_string *, const char *, ...);
-#define archive_string_sprintf __archive_string_sprintf
+#define archive_string_sprintf __archive_string_sprintf
#endif
==== //depot/projects/trustedbsd/mac/lib/libc/Makefile#13 (text+ko) ====
@@ -1,5 +1,5 @@
# @(#)Makefile 8.2 (Berkeley) 2/3/94
-# $FreeBSD: src/lib/libc/Makefile,v 1.50 2004/01/19 16:16:53 nectar Exp $
+# $FreeBSD: src/lib/libc/Makefile,v 1.51 2004/05/02 10:55:07 das Exp $
#
# All library objects contain FreeBSD revision strings by default; they may be
# excluded as a space-saving measure. To produce a library that does
@@ -64,6 +64,9 @@
.if !defined(NO_HESIOD_LIBC)
CFLAGS+= -DHESIOD
.endif
+.if defined(NO_FP_LIBC)
+CFLAGS+= -DNO_FLOATING_POINT
+.endif
# If there are no machine dependent sources, append all the
# machine-independent sources:
==== //depot/projects/trustedbsd/mac/lib/libc/gen/fmtcheck.c#5 (text+ko) ====
@@ -35,7 +35,7 @@
/* $NetBSD: fmtcheck.c,v 1.2 2000/11/01 01:17:20 briggs Exp $ */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/fmtcheck.c,v 1.6 2003/06/29 01:11:31 das Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/fmtcheck.c,v 1.7 2004/05/02 10:55:05 das Exp $");
#include <stdio.h>
#include <string.h>
@@ -57,8 +57,10 @@
FMTCHECK_QUADPOINTER,
FMTCHECK_PTRDIFFTPOINTER,
FMTCHECK_SIZETPOINTER,
+#ifndef NO_FLOATING_POINT
FMTCHECK_DOUBLE,
FMTCHECK_LONGDOUBLE,
+#endif
FMTCHECK_STRING,
FMTCHECK_WIDTH,
FMTCHECK_PRECISION,
@@ -149,6 +151,7 @@
RETURN(pf,f,FMTCHECK_UNKNOWN);
RETURN(pf,f,FMTCHECK_LONG);
}
+#ifndef NO_FLOATING_POINT
if (strchr("aAeEfFgG", *f)) {
if (longdouble)
RETURN(pf,f,FMTCHECK_LONGDOUBLE);
@@ -156,6 +159,7 @@
RETURN(pf,f,FMTCHECK_UNKNOWN);
RETURN(pf,f,FMTCHECK_DOUBLE);
}
+#endif
if (*f == 'c') {
if (sh + lg + quad + longdouble + ptrdifft + sizet)
RETURN(pf,f,FMTCHECK_UNKNOWN);
==== //depot/projects/trustedbsd/mac/lib/libc/stdio/vfprintf.c#18 (text+ko) ====
@@ -38,7 +38,7 @@
static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.64 2004/04/22 11:35:12 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.65 2004/05/02 10:55:05 das Exp $");
/*
* Actual printf innards.
@@ -66,10 +66,6 @@
#include "local.h"
#include "fvwrite.h"
-/* Define FLOATING_POINT to get floating point, HEXFLOAT to get %a. */
-#define FLOATING_POINT
-#define HEXFLOAT
-
union arg {
int intarg;
u_int uintarg;
@@ -91,7 +87,7 @@
ptrdiff_t *pptrdiffarg;
size_t *psizearg;
intmax_t *pintmaxarg;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
double doublearg;
long double longdoublearg;
#endif
@@ -411,7 +407,7 @@
return (ret);
}
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
#define dtoa __dtoa
#define freedtoa __freedtoa
@@ -425,7 +421,7 @@
static int exponent(char *, int, int);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list