From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 27 06:02:49 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C66DD105; Mon, 27 Apr 2015 06:02:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2F671359; Mon, 27 Apr 2015 06:02:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3R62nmx033092; Mon, 27 Apr 2015 06:02:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3R62lAg033082; Mon, 27 Apr 2015 06:02:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201504270602.t3R62lAg033082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 27 Apr 2015 06:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282053 - stable/9/usr.bin/gzip X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2015 06:02:49 -0000 Author: delphij Date: Mon Apr 27 06:02:47 2015 New Revision: 282053 URL: https://svnweb.freebsd.org/changeset/base/282053 Log: MFC r222211,r222287,r225845,r226184,r226418,r236596,r267773,r267887,r273507, r281500,r281540,r281626: Sync with HEAD: xz support, bug fixes, etc. Added: stable/9/usr.bin/gzip/unxz.c - copied, changed from r226184, head/usr.bin/gzip/unxz.c Modified: stable/9/usr.bin/gzip/Makefile stable/9/usr.bin/gzip/gzip.1 stable/9/usr.bin/gzip/gzip.c stable/9/usr.bin/gzip/zmore stable/9/usr.bin/gzip/zmore.1 stable/9/usr.bin/gzip/zuncompress.c Directory Properties: stable/9/usr.bin/gzip/ (props changed) Modified: stable/9/usr.bin/gzip/Makefile ============================================================================== --- stable/9/usr.bin/gzip/Makefile Mon Apr 27 05:49:18 2015 (r282052) +++ stable/9/usr.bin/gzip/Makefile Mon Apr 27 06:02:47 2015 (r282053) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2009/04/14 22:15:20 lukem Exp $ +# $NetBSD: Makefile,v 1.18 2013/11/13 11:12:24 pettai Exp $ # $FreeBSD$ .include @@ -6,8 +6,8 @@ PROG= gzip MAN= gzip.1 gzexe.1 zdiff.1 zforce.1 zmore.1 znew.1 -DPADD= ${LIBZ} -LDADD= -lz +DPADD= ${LIBZ} ${LIBLZMA} +LDADD= -lz -llzma .if ${MK_BZIP2_SUPPORT} != "no" DPADD+= ${LIBBZ2} @@ -21,7 +21,8 @@ SCRIPTS= gzexe zdiff zforce zmore znew MLINKS+= gzip.1 gunzip.1 \ gzip.1 gzcat.1 \ gzip.1 zcat.1 \ - zdiff.1 zcmp.1 + zdiff.1 zcmp.1 \ + zmore.1 zless.1 LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip \ ${BINDIR}/gzip ${BINDIR}/gzcat \ Modified: stable/9/usr.bin/gzip/gzip.1 ============================================================================== --- stable/9/usr.bin/gzip/gzip.1 Mon Apr 27 05:49:18 2015 (r282052) +++ stable/9/usr.bin/gzip/gzip.1 Mon Apr 27 06:02:47 2015 (r282053) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.20 2009/04/01 08:15:37 mrg Exp $ +.\" $NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd May 23, 2011 +.Dd April 6, 2015 .Dt GZIP 1 .Os .Sh NAME @@ -105,9 +105,10 @@ options are enabled. This version of .Nm is also capable of decompressing files compressed using -.Xr compress 1 +.Xr compress 1 , +.Xr bzip2 1 , or -.Xr bzip2 1 . +.Xr xz 1 . .Sh OPTIONS The following options are available: .Bl -tag -width XXrXXXrecursiveX @@ -185,6 +186,7 @@ Options on the command line will overrid .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , +.Xr xz 1 , .Xr fts 3 , .Xr zlib 3 .Sh HISTORY @@ -213,9 +215,9 @@ and first appeared in This implementation of .Nm was written by -.An Matthew R. Green Aq mrg@eterna.com.au +.An Matthew R. Green Aq Mt mrg@eterna.com.au with unpack support written by -.An Xin LI Aq delphij@FreeBSD.org . +.An Xin LI Aq Mt delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit integer, therefore, it can not represent files larger than 4GB. Modified: stable/9/usr.bin/gzip/gzip.c ============================================================================== --- stable/9/usr.bin/gzip/gzip.c Mon Apr 27 05:49:18 2015 (r282052) +++ stable/9/usr.bin/gzip/gzip.c Mon Apr 27 06:02:47 2015 (r282053) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $ */ +/* $NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -77,6 +77,9 @@ enum filetype { #ifndef NO_PACK_SUPPORT FT_PACK, #endif +#ifndef NO_XZ_SUPPORT + FT_XZ, +#endif FT_LAST, FT_UNKNOWN }; @@ -97,6 +100,12 @@ enum filetype { #define PACK_MAGIC "\037\036" #endif +#ifndef NO_XZ_SUPPORT +#include +#define XZ_SUFFIX ".xz" +#define XZ_MAGIC "\3757zXZ" +#endif + #define GZ_SUFFIX ".gz" #define BUFLEN (64 * 1024) @@ -139,6 +148,9 @@ static suffixes_t suffixes[] = { #ifndef NO_COMPRESS_SUPPORT SUFFIX(Z_SUFFIX, ""), #endif +#ifndef NO_XZ_SUPPORT + SUFFIX(XZ_SUFFIX, ""), +#endif SUFFIX(GZ_SUFFIX, ""), /* Overwritten by -S "" */ #endif /* SMALL */ #undef SUFFIX @@ -146,7 +158,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20110523"; +static const char gzip_version[] = "FreeBSD gzip 20150413"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -199,16 +211,13 @@ static int exit_value = 0; /* exit valu static char *infile; /* name of file coming in */ -static void maybe_err(const char *fmt, ...) __dead2 - __attribute__((__format__(__printf__, 1, 2))); -#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) -static void maybe_errx(const char *fmt, ...) __dead2 - __attribute__((__format__(__printf__, 1, 2))); -#endif -static void maybe_warn(const char *fmt, ...) - __attribute__((__format__(__printf__, 1, 2))); -static void maybe_warnx(const char *fmt, ...) - __attribute__((__format__(__printf__, 1, 2))); +static void maybe_err(const char *fmt, ...) __printflike(1, 2) __dead2; +#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \ + !defined(NO_XZ_SUPPORT) +static void maybe_errx(const char *fmt, ...) __printflike(1, 2) __dead2; +#endif +static void maybe_warn(const char *fmt, ...) __printflike(1, 2); +static void maybe_warnx(const char *fmt, ...) __printflike(1, 2); static enum filetype file_gettype(u_char *); #ifdef SMALL #define gz_compress(if, of, sz, fn, tm) gz_compress(if, of, sz) @@ -223,8 +232,8 @@ static void handle_stdin(void); static void handle_stdout(void); static void print_ratio(off_t, off_t, FILE *); static void print_list(int fd, off_t, const char *, time_t); -static void usage(void); -static void display_version(void); +static void usage(void) __dead2; +static void display_version(void) __dead2; #ifndef SMALL static void display_license(void); static void sigint_handler(int); @@ -257,7 +266,9 @@ static off_t zuncompress(FILE *, FILE *, static off_t unpack(int, int, char *, size_t, off_t *); #endif -int main(int, char **p); +#ifndef NO_XZ_SUPPORT +static off_t unxz(int, int, char *, size_t, off_t *); +#endif #ifdef SMALL #define getopt_long(a,b,c,d,e) getopt(a,b,c) @@ -456,7 +467,8 @@ maybe_err(const char *fmt, ...) exit(2); } -#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) +#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \ + !defined(NO_XZ_SUPPORT) /* ... without an errno. */ void maybe_errx(const char *fmt, ...) @@ -1122,6 +1134,11 @@ file_gettype(u_char *buf) return FT_PACK; else #endif +#ifndef NO_XZ_SUPPORT + if (memcmp(buf, XZ_MAGIC, 4) == 0) /* XXX: We only have 4 bytes */ + return FT_XZ; + else +#endif return FT_UNKNOWN; } @@ -1337,7 +1354,7 @@ file_uncompress(char *file, char *outfil #ifndef SMALL ssize_t rv; time_t timestamp = 0; - unsigned char name[PATH_MAX + 1]; + char name[PATH_MAX + 1]; #endif /* gather the old name info */ @@ -1369,7 +1386,6 @@ file_uncompress(char *file, char *outfil } method = file_gettype(header1); - #ifndef SMALL if (fflag == 0 && method == FT_UNKNOWN) { maybe_warnx("%s: not in gzip format", file); @@ -1393,21 +1409,33 @@ file_uncompress(char *file, char *outfil timestamp = ts[3] << 24 | ts[2] << 16 | ts[1] << 8 | ts[0]; if (header1[3] & ORIG_NAME) { - rbytes = pread(fd, name, sizeof name, GZIP_ORIGNAME); + rbytes = pread(fd, name, sizeof(name) - 1, GZIP_ORIGNAME); if (rbytes < 0) { maybe_warn("can't read %s", file); goto lose; } - if (name[0] != 0) { + if (name[0] != '\0') { + char *dp, *nf; + + /* Make sure that name is NUL-terminated */ + name[rbytes] = '\0'; + + /* strip saved directory name */ + nf = strrchr(name, '/'); + if (nf == NULL) + nf = name; + else + nf++; + /* preserve original directory name */ - char *dp = strrchr(file, '/'); + dp = strrchr(file, '/'); if (dp == NULL) dp = file; else dp++; snprintf(outfile, outsize, "%.*s%.*s", (int) (dp - file), - file, (int) rbytes, name); + file, (int) rbytes, nf); } } } @@ -1447,9 +1475,9 @@ file_uncompress(char *file, char *outfil } else zfd = STDOUT_FILENO; + switch (method) { #ifndef NO_BZIP2_SUPPORT - if (method == FT_BZIP2) { - + case FT_BZIP2: /* XXX */ if (lflag) { maybe_warnx("no -l with bzip2 files"); @@ -1457,11 +1485,11 @@ file_uncompress(char *file, char *outfil } size = unbzip2(fd, zfd, NULL, 0, NULL); - } else + break; #endif #ifndef NO_COMPRESS_SUPPORT - if (method == FT_Z) { + case FT_Z: { FILE *in, *out; /* XXX */ @@ -1494,30 +1522,42 @@ file_uncompress(char *file, char *outfil unlink(outfile); goto lose; } - } else + break; + } #endif #ifndef NO_PACK_SUPPORT - if (method == FT_PACK) { + case FT_PACK: if (lflag) { maybe_warnx("no -l with packed files"); goto lose; } size = unpack(fd, zfd, NULL, 0, NULL); - } else + break; +#endif + +#ifndef NO_XZ_SUPPORT + case FT_XZ: + if (lflag) { + maybe_warnx("no -l with xz files"); + goto lose; + } + + size = unxz(fd, zfd, NULL, 0, NULL); + break; #endif #ifndef SMALL - if (method == FT_UNKNOWN) { + case FT_UNKNOWN: if (lflag) { maybe_warnx("no -l for unknown filetypes"); goto lose; } size = cat_fd(NULL, 0, NULL, fd); - } else + break; #endif - { + default: if (lflag) { print_list(fd, isb.st_size, outfile, isb.st_mtime); close(fd); @@ -1525,6 +1565,7 @@ file_uncompress(char *file, char *outfil } size = gz_uncompress(fd, zfd, NULL, 0, NULL, file); + break; } if (close(fd) != 0) @@ -1697,7 +1738,8 @@ handle_stdin(void) return; } - usize = zuncompress(in, stdout, (char *)header1, sizeof header1, &gsize); + usize = zuncompress(in, stdout, (char *)header1, + sizeof header1, &gsize); fclose(in); break; #endif @@ -1707,6 +1749,12 @@ handle_stdin(void) (char *)header1, sizeof header1, &gsize); break; #endif +#ifndef NO_XZ_SUPPORT + case FT_XZ: + usize = unxz(STDIN_FILENO, STDOUT_FILENO, + (char *)header1, sizeof header1, &gsize); + break; +#endif } #ifndef SMALL @@ -1733,7 +1781,7 @@ handle_stdout(void) return; } #endif - /* If stdin is a file use it's mtime, otherwise use current time */ + /* If stdin is a file use its mtime, otherwise use current time */ ret = fstat(STDIN_FILENO, &sb); #ifndef SMALL @@ -2074,7 +2122,7 @@ static void display_license(void) { - fprintf(stderr, "%s (based on NetBSD gzip 20091011)\n", gzip_version); + fprintf(stderr, "%s (based on NetBSD gzip 20150113)\n", gzip_version); fprintf(stderr, "%s\n", gzip_copyright); exit(0); } @@ -2098,6 +2146,9 @@ display_version(void) #ifndef NO_PACK_SUPPORT #include "unpack.c" #endif +#ifndef NO_XZ_SUPPORT +#include "unxz.c" +#endif static ssize_t read_retry(int fd, void *buf, size_t sz) Copied and modified: stable/9/usr.bin/gzip/unxz.c (from r226184, head/usr.bin/gzip/unxz.c) ============================================================================== --- head/usr.bin/gzip/unxz.c Mon Oct 10 06:37:32 2011 (r226184, copy source) +++ stable/9/usr.bin/gzip/unxz.c Mon Apr 27 06:02:47 2015 (r282053) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/9/usr.bin/gzip/zmore ============================================================================== --- stable/9/usr.bin/gzip/zmore Mon Apr 27 05:49:18 2015 (r282052) +++ stable/9/usr.bin/gzip/zmore Mon Apr 27 06:02:47 2015 (r282053) @@ -1,7 +1,8 @@ #!/bin/sh - # -# $NetBSD: zmore,v 1.3 2004/03/29 09:59:42 wiz Exp $ -# $OpenBSD: zmore,v 1.4 2003/07/29 07:42:45 otto Exp $ +# $NetBSD: zmore,v 1.5 2013/12/06 13:33:15 pettai Exp $ +# +# $OpenBSD: zmore,v 1.6 2008/08/20 09:22:02 mpf Exp $ # #- # Copyright (c) 2003 Todd C. Miller @@ -42,15 +43,21 @@ while test $# -ne 0; do esac done +if [ `basename $0` = "zless" ] ; then + pager=${PAGER-less} +else + pager=${PAGER-more} +fi + # No files means read from stdin if [ $# -eq 0 ]; then - gzip -cdfq 2>&1 | ${PAGER-more} $flags + gzip -cdfq 2>&1 | $pager $flags exit 0 fi oterm=`stty -g 2>/dev/null` while test $# -ne 0; do - gzip -cdfq "$1" 2>&1 | ${PAGER-more} $flags + gzip -cdfq "$1" 2>&1 | $pager $flags prev="$1" shift if tty -s && test -n "$oterm" -a $# -gt 0; then Modified: stable/9/usr.bin/gzip/zmore.1 ============================================================================== --- stable/9/usr.bin/gzip/zmore.1 Mon Apr 27 05:49:18 2015 (r282052) +++ stable/9/usr.bin/gzip/zmore.1 Mon Apr 27 06:02:47 2015 (r282053) @@ -1,5 +1,5 @@ -.\" $NetBSD: zmore.1,v 1.3 2003/12/28 12:47:52 wiz Exp $ -.\" $OpenBSD: zmore.1,v 1.3 2003/06/23 21:00:48 deraadt Exp $ +.\" $NetBSD: zmore.1,v 1.4 2013/11/12 21:58:37 pettai Exp $ +.\" $OpenBSD: zmore.1,v 1.10 2009/08/16 09:41:08 sobrado Exp $ .\" .\" Copyright (c) 2003 Todd C. Miller .\" @@ -20,16 +20,20 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd February 6, 2011 +.Dd October 22, 2014 .Dt ZMORE 1 .Os .Sh NAME -.Nm zmore +.Nm zmore , +.Nm zless .Nd view compressed files .Sh SYNOPSIS .Nm zmore .Op Ar flags -.Op Ar file ... +.Op Ar +.Nm zless +.Op Ar flags +.Op Ar .Sh DESCRIPTION .Nm is a filter that allows the viewing of files compressed with Lempel-Ziv @@ -51,6 +55,14 @@ that are specified are passed to the use .Pa /usr/bin/more by default). .Pp +.Nm zless +is equivalent to +.Nm zmore +but uses +.Xr less 1 +as a pager instead of +.Xr more 1 . +.Pp When multiple files are specified, .Nm will pause at the end of each file and present the following prompt to the user: @@ -86,7 +98,11 @@ style compression since there is no suff Program used to display files. If unset, .Pa /usr/bin/more -is used. +is used +.Pq Nm zmore +or +.Pa /usr/bin/less +.Pq Nm zless . .El .Sh SEE ALSO .Xr compress 1 , Modified: stable/9/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/9/usr.bin/gzip/zuncompress.c Mon Apr 27 05:49:18 2015 (r282052) +++ stable/9/usr.bin/gzip/zuncompress.c Mon Apr 27 06:02:47 2015 (r282053) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.8 2010/11/06 21:42:32 mrg Exp $ */ +/* $NetBSD: zuncompress.c,v 1.11 2011/08/16 13:55:02 joerg Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 @@ -146,7 +146,7 @@ zuncompress(FILE *in, FILE *out, char *p else compressed_pre = NULL; - while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) { + while ((bin = fread(buf, 1, BUFSIZE, in)) != 0) { if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) { free(buf); return -1; From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 27 15:00:17 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A51DE03; Mon, 27 Apr 2015 15:00:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4880D1F96; Mon, 27 Apr 2015 15:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3RF0H6F008972; Mon, 27 Apr 2015 15:00:17 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3RF0HBg008971; Mon, 27 Apr 2015 15:00:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504271500.t3RF0HBg008971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 27 Apr 2015 15:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282095 - stable/9/sys/geom/uncompress X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2015 15:00:17 -0000 Author: pfg Date: Mon Apr 27 15:00:16 2015 New Revision: 282095 URL: https://svnweb.freebsd.org/changeset/base/282095 Log: MFC r281769: g_uncompress_taste: prevent a double free. Found by: Clang Static Analyzer Modified: stable/9/sys/geom/uncompress/g_uncompress.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/uncompress/g_uncompress.c ============================================================================== --- stable/9/sys/geom/uncompress/g_uncompress.c Mon Apr 27 14:59:31 2015 (r282094) +++ stable/9/sys/geom/uncompress/g_uncompress.c Mon Apr 27 15:00:16 2015 (r282095) @@ -565,6 +565,7 @@ g_uncompress_taste(struct g_class *mp, s sc->offsets[i] = be64toh(((uint64_t *) (buf+sizeof(struct cloop_header)))[i]); } + buf = NULL; DPRINTF(("%s: done reading offsets\n", gp->name)); mtx_init(&sc->last_mtx, "geom_uncompress cache", NULL, MTX_DEF); sc->last_blk = -1; From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 29 15:28:05 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4007130; Wed, 29 Apr 2015 15:28:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 919B91DBE; Wed, 29 Apr 2015 15:28:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TFS5C4063492; Wed, 29 Apr 2015 15:28:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3TFS50o063491; Wed, 29 Apr 2015 15:28:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504291528.t3TFS50o063491@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 29 Apr 2015 15:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282223 - stable/9/lib/libgeom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 15:28:05 -0000 Author: pfg Date: Wed Apr 29 15:28:04 2015 New Revision: 282223 URL: https://svnweb.freebsd.org/changeset/base/282223 Log: MFC r281875: libgeom: plug memory leak in EndElement. CID: 1016696 Found by: Clang static checker Modified: stable/9/lib/libgeom/geom_xml2tree.c Directory Properties: stable/9/lib/libgeom/ (props changed) Modified: stable/9/lib/libgeom/geom_xml2tree.c ============================================================================== --- stable/9/lib/libgeom/geom_xml2tree.c Wed Apr 29 15:26:58 2015 (r282222) +++ stable/9/lib/libgeom/geom_xml2tree.c Wed Apr 29 15:28:04 2015 (r282223) @@ -257,6 +257,7 @@ EndElement(void *userData, const char *n if (!strcmp(name, "config")) { mt->config = NULL; + free(p); return; } From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 29 15:33:56 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2DDE56E; Wed, 29 Apr 2015 15:33:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E10F71EAE; Wed, 29 Apr 2015 15:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TFXtRC068289; Wed, 29 Apr 2015 15:33:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3TFXt9a068288; Wed, 29 Apr 2015 15:33:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504291533.t3TFXt9a068288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 29 Apr 2015 15:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282225 - stable/9/lib/libthr/thread X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 15:33:56 -0000 Author: pfg Date: Wed Apr 29 15:33:55 2015 New Revision: 282225 URL: https://svnweb.freebsd.org/changeset/base/282225 Log: MFC r281857: _pthread_cleanup_push: fix allocator sizeof operand mismatch Same fix appears to be in DragonFly's libthread_xu. Found by: Clang Static Analyzer Modified: stable/9/lib/libthr/thread/thr_clean.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_clean.c ============================================================================== --- stable/9/lib/libthr/thread/thr_clean.c Wed Apr 29 15:33:07 2015 (r282224) +++ stable/9/lib/libthr/thread/thr_clean.c Wed Apr 29 15:33:55 2015 (r282225) @@ -84,7 +84,7 @@ _pthread_cleanup_push(void (*routine) (v curthread->unwind_disabled = 1; #endif if ((newbuf = (struct pthread_cleanup *) - malloc(sizeof(struct _pthread_cleanup_info))) != NULL) { + malloc(sizeof(struct pthread_cleanup))) != NULL) { newbuf->routine = routine; newbuf->routine_arg = arg; newbuf->onheap = 1; From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 29 18:57:22 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19DA8C5F; Wed, 29 Apr 2015 18:57:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF6D618C8; Wed, 29 Apr 2015 18:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TIvLfo069984; Wed, 29 Apr 2015 18:57:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3TIvLG3069981; Wed, 29 Apr 2015 18:57:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201504291857.t3TIvLG3069981@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 29 Apr 2015 18:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282243 - in stable: 10/etc/defaults 10/etc/periodic/daily 10/share/man/man5 9/etc/defaults 9/etc/periodic/daily 9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 18:57:22 -0000 Author: jhb Date: Wed Apr 29 18:57:19 2015 New Revision: 282243 URL: https://svnweb.freebsd.org/changeset/base/282243 Log: MFC 280721: Allow additional flags to be passed to netstat -i in the daily status check. In particular, this allows an administrator to specify "-h" for human readable output if that is preferred. The default setting passes "-d", so that can be excluded by using a custom setting. Modified: stable/9/etc/defaults/periodic.conf stable/9/etc/periodic/daily/420.status-network stable/9/share/man/man5/periodic.conf.5 Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man5/ (props changed) Changes in other areas also in this revision: Modified: stable/10/etc/defaults/periodic.conf stable/10/etc/periodic/daily/420.status-network stable/10/share/man/man5/periodic.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/9/etc/defaults/periodic.conf ============================================================================== --- stable/9/etc/defaults/periodic.conf Wed Apr 29 18:07:58 2015 (r282242) +++ stable/9/etc/defaults/periodic.conf Wed Apr 29 18:57:19 2015 (r282243) @@ -119,6 +119,7 @@ daily_status_gconcat_enable="NO" # Che # 420.status-network daily_status_network_enable="YES" # Check network status daily_status_network_usedns="YES" # DNS lookups are ok +daily_status_network_netstat_flags="-d" # netstat(1) flags # 430.status-rwho daily_status_rwho_enable="YES" # Check system status Modified: stable/9/etc/periodic/daily/420.status-network ============================================================================== --- stable/9/etc/periodic/daily/420.status-network Wed Apr 29 18:07:58 2015 (r282242) +++ stable/9/etc/periodic/daily/420.status-network Wed Apr 29 18:57:19 2015 (r282243) @@ -16,12 +16,14 @@ case "$daily_status_network_enable" in echo "" echo "Network interface status:" + flags="${daily_status_network_netstat_flags}" case "$daily_status_network_usedns" in [Yy][Ee][Ss]) - netstat -id && rc=0 || rc=3;; + ;; *) - netstat -idn && rc=0 || rc=3;; - esac;; + flags="${flags} -n";; + esac + netstat -i ${flags} && rc=0 || rc=3;; *) rc=0;; esac Modified: stable/9/share/man/man5/periodic.conf.5 ============================================================================== --- stable/9/share/man/man5/periodic.conf.5 Wed Apr 29 18:07:58 2015 (r282242) +++ stable/9/share/man/man5/periodic.conf.5 Wed Apr 29 18:57:19 2015 (r282243) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2015 +.Dd March 26, 2015 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -410,6 +410,16 @@ Set to .Dq Li YES if you want to run .Nm netstat Fl i . +.It Va daily_status_network_netstat_flags +.Pq Vt str +Set to additional arguments for the +.Xr netstat 1 +utility when +.Va daily_status_network_enable +is set to +.Dq Li YES . +The default is +.Fl d . .It Va daily_status_network_usedns .Pq Vt bool Set to From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 30 18:11:44 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36732B0A; Thu, 30 Apr 2015 18:11:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 247CB1A66; Thu, 30 Apr 2015 18:11:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3UIBins066006; Thu, 30 Apr 2015 18:11:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3UIBhQE066005; Thu, 30 Apr 2015 18:11:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201504301811.t3UIBhQE066005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 30 Apr 2015 18:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282279 - stable/9/usr.bin/wc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 18:11:44 -0000 Author: bdrewery Date: Thu Apr 30 18:11:43 2015 New Revision: 282279 URL: https://svnweb.freebsd.org/changeset/base/282279 Log: MFC r281617: wc: Fix SIGINFO race causing final results to be lost to stderr. Relnotes: yes Modified: stable/9/usr.bin/wc/wc.c Directory Properties: stable/9/usr.bin/wc/ (props changed) Modified: stable/9/usr.bin/wc/wc.c ============================================================================== --- stable/9/usr.bin/wc/wc.c Thu Apr 30 18:07:48 2015 (r282278) +++ stable/9/usr.bin/wc/wc.c Thu Apr 30 18:11:43 2015 (r282279) @@ -74,6 +74,14 @@ siginfo_handler(int sig __unused) siginfo = 1; } +static void +reset_siginfo(void) +{ + + signal(SIGINFO, SIG_DFL); + siginfo = 0; +} + int main(int argc, char *argv[]) { @@ -207,6 +215,7 @@ cnt(const char *file) } else tmpll++; } + reset_siginfo(); tlinect += linect; if (dochar) tcharct += charct; @@ -229,6 +238,7 @@ cnt(const char *file) return (1); } if (S_ISREG(sb.st_mode)) { + reset_siginfo(); charct = sb.st_size; show_cnt(file, linect, wordct, charct, llct); tcharct += charct; @@ -289,6 +299,7 @@ word: gotsp = 1; } } } + reset_siginfo(); if (domulti && MB_CUR_MAX > 1) if (mbrtowc(NULL, NULL, 0, &mbs) == (size_t)-1 && !warned) warn("%s", file != NULL ? file : "stdin"); From owner-svn-src-stable-9@FreeBSD.ORG Fri May 1 17:36:14 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5348F260; Fri, 1 May 2015 17:36:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB8915D6; Fri, 1 May 2015 17:36:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t41HaEUJ069633; Fri, 1 May 2015 17:36:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t41HaEOj069632; Fri, 1 May 2015 17:36:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505011736.t41HaEOj069632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 1 May 2015 17:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282311 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2015 17:36:14 -0000 Author: mav Date: Fri May 1 17:36:13 2015 New Revision: 282311 URL: https://svnweb.freebsd.org/changeset/base/282311 Log: MFC r281923, r281924: Add link to mvs(4). Modified: stable/9/share/man/man4/ada.4 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ada.4 ============================================================================== --- stable/9/share/man/man4/ada.4 Fri May 1 17:35:10 2015 (r282310) +++ stable/9/share/man/man4/ada.4 Fri May 1 17:36:13 2015 (r282311) @@ -142,6 +142,7 @@ ATA device nodes .Xr ahci 4 , .Xr cam 4 , .Xr da 4 , +.Xr mvs 4 , .Xr siis 4 .Sh HISTORY The From owner-svn-src-stable-9@FreeBSD.ORG Sat May 2 12:58:05 2015 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8896E350; Sat, 2 May 2015 12:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 742991711; Sat, 2 May 2015 12:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t42Cw5RH050752; Sat, 2 May 2015 12:58:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t42Cw5th050751; Sat, 2 May 2015 12:58:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201505021258.t42Cw5th050751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 2 May 2015 12:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282343 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 May 2015 12:58:05 -0000 Author: rmacklem Date: Sat May 2 12:58:04 2015 New Revision: 282343 URL: https://svnweb.freebsd.org/changeset/base/282343 Log: MFC: r281962 Fix the NFS server's handling of a bogus NFSv2 ROOT RPC. The ROOT RPC is deprecated in the NFSv2 RFC, RFC-1094 and should never be used by a client. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat May 2 12:22:24 2015 (r282342) +++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat May 2 12:58:04 2015 (r282343) @@ -120,7 +120,8 @@ nfssvc_program(struct svc_req *rqst, SVC memset(&nd, 0, sizeof(nd)); if (rqst->rq_vers == NFS_VER2) { - if (rqst->rq_proc > NFSV2PROC_STATFS) { + if (rqst->rq_proc > NFSV2PROC_STATFS || + newnfs_nfsv3_procid[rqst->rq_proc] == NFSPROC_NOOP) { svcerr_noproc(rqst); svc_freereq(rqst); goto out;