From owner-svn-src-stable-8@FreeBSD.ORG Sun May 26 17:00:16 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29AE58B7; Sun, 26 May 2013 17:00:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFA2294; Sun, 26 May 2013 17:00:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QH0Fmh097147; Sun, 26 May 2013 17:00:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QH0F99097145; Sun, 26 May 2013 17:00:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305261700.r4QH0F99097145@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 26 May 2013 17:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251002 - stable/8/lib/libfetch X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 17:00:16 -0000 Author: des Date: Sun May 26 17:00:15 2013 New Revision: 251002 URL: http://svnweb.freebsd.org/changeset/base/251002 Log: MFH (r230478): fix a couple of nits in r230307 (r231248) MFH (r243149): fix indentation MFH (r249431): use CONNECT to proxy HTTPS over HTTP PR: bin/80176 Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/http.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Sun May 26 16:48:51 2013 (r251001) +++ stable/8/lib/libfetch/common.c Sun May 26 17:00:15 2013 (r251002) @@ -418,7 +418,6 @@ fetch_cache_data(conn_t *conn, char *src if (conn->cache.size < nbytes) { tmp = realloc(conn->cache.buf, nbytes); if (tmp == NULL) { - errno = ENOMEM; fetch_syserr(); return (-1); } @@ -481,7 +480,7 @@ fetch_read(conn_t *conn, char *buf, size conn->cache.len -= total; conn->cache.pos += total; len -= total; - buf+= total; + buf += total; } while (len > 0) { Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Sun May 26 16:48:51 2013 (r251001) +++ stable/8/lib/libfetch/http.c Sun May 26 17:00:15 2013 (r251002) @@ -1373,6 +1373,7 @@ http_authorize(conn_t *conn, const char static conn_t * http_connect(struct url *URL, struct url *purl, const char *flags) { + struct url *curl; conn_t *conn; int verbose; int af, val; @@ -1391,17 +1392,21 @@ http_connect(struct url *URL, struct url af = AF_INET6; #endif - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { - URL = purl; - } else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) { - /* can't talk http to an ftp server */ - /* XXX should set an error code */ - return (NULL); - } + curl = (purl != NULL) ? purl : URL; - if ((conn = fetch_connect(URL->host, URL->port, af, verbose)) == NULL) + if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); + if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", + URL->host, URL->port); + http_cmd(conn, ""); + if (http_get_reply(conn) != HTTP_OK) { + fetch_close(conn); + return (NULL); + } + http_get_reply(conn); + } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, verbose) == -1) { fetch_close(conn); @@ -1752,11 +1757,11 @@ http_request(struct url *URL, const char /* get headers. http_next_header expects one line readahead */ if (fetch_getln(conn) == -1) { - fetch_syserr(); - goto ouch; + fetch_syserr(); + goto ouch; } do { - switch ((h = http_next_header(conn, &headerbuf, &p))) { + switch ((h = http_next_header(conn, &headerbuf, &p))) { case hdr_syserror: fetch_syserr(); goto ouch; @@ -1785,7 +1790,7 @@ http_request(struct url *URL, const char conn->err != HTTP_USE_PROXY) { n = 1; break; - } + } if (new) free(new); if (verbose) From owner-svn-src-stable-8@FreeBSD.ORG Sun May 26 18:30:07 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC17CE22; Sun, 26 May 2013 18:30:07 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE4C4791; Sun, 26 May 2013 18:30:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIU7LY025574; Sun, 26 May 2013 18:30:07 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIU7V5025567; Sun, 26 May 2013 18:30:07 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261830.r4QIU7V5025567@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251005 - in stable/8/sbin: hastctl hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:30:08 -0000 Author: trociny Date: Sun May 26 18:30:07 2013 New Revision: 251005 URL: http://svnweb.freebsd.org/changeset/base/251005 Log: MFC r250503: Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd Modified: stable/8/sbin/hastctl/Makefile stable/8/sbin/hastd/Makefile stable/8/sbin/hastd/token.l Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/Makefile ============================================================================== --- stable/8/sbin/hastctl/Makefile Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastctl/Makefile Sun May 26 18:30:07 2013 (r251005) @@ -29,8 +29,8 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/8/sbin/hastd/Makefile ============================================================================== --- stable/8/sbin/hastd/Makefile Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastd/Makefile Sun May 26 18:30:07 2013 (r251005) @@ -29,7 +29,7 @@ CFLAGS+=-DINET6 .endif DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +LDADD= -lgeom -lbsdxml -lsbuf -lpthread -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/8/sbin/hastd/token.l ============================================================================== --- stable/8/sbin/hastd/token.l Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastd/token.l Sun May 26 18:30:07 2013 (r251005) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } From owner-svn-src-stable-8@FreeBSD.ORG Sun May 26 18:37:21 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1244E299; Sun, 26 May 2013 18:37:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 048787E0; Sun, 26 May 2013 18:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIbKr3028446; Sun, 26 May 2013 18:37:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIbKsQ028444; Sun, 26 May 2013 18:37:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261837.r4QIbKsQ028444@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251007 - in stable/8/usr.sbin/bsnmpd/modules: . snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:37:21 -0000 Author: trociny Date: Sun May 26 18:37:20 2013 New Revision: 251007 URL: http://svnweb.freebsd.org/changeset/base/251007 Log: MFC r250379, r250503: HAST module for bsnmpd(1). Reviewed by: harti, pjd Added: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/ - copied from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/ Modified: stable/8/usr.sbin/bsnmpd/modules/Makefile stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:35:52 2013 (r251006) +++ stable/8/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:37:20 2013 (r251007) @@ -10,6 +10,7 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ + snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Wed May 8 20:03:37 2013 (r250379) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:37:20 2013 (r251007) @@ -29,8 +29,8 @@ CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def From owner-svn-src-stable-8@FreeBSD.ORG Sun May 26 18:39:34 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57FA6597; Sun, 26 May 2013 18:39:34 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3127F3; Sun, 26 May 2013 18:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIdYHn028877; Sun, 26 May 2013 18:39:34 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIdYX5028876; Sun, 26 May 2013 18:39:34 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261839.r4QIdYX5028876@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251009 - stable/8/contrib/bsnmp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:39:34 -0000 Author: trociny Date: Sun May 26 18:39:33 2013 New Revision: 251009 URL: http://svnweb.freebsd.org/changeset/base/251009 Log: MFC r250380: Register OID for HAST module. Modified: stable/8/contrib/bsnmp/oid-list Directory Properties: stable/8/contrib/bsnmp/ (props changed) Modified: stable/8/contrib/bsnmp/oid-list ============================================================================== --- stable/8/contrib/bsnmp/oid-list Sun May 26 18:38:46 2013 (r251008) +++ stable/8/contrib/bsnmp/oid-list Sun May 26 18:39:33 2013 (r251009) @@ -17,6 +17,7 @@ enterprises 200 BEGEMOT-PF snmpd PF module (phillip@freebsd.org) 201 BEGEMOT-NTP snmpd NTP module 202 BEGEMOT-HOSTRES snmpd HOSTRES module private stuff + 220 begemotHast HAST module 300 BEGEMOT-ACM DLR ACM project If you need an OID and don't know where to stuck it in, I can assign you one - From owner-svn-src-stable-8@FreeBSD.ORG Sun May 26 18:54:51 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F2E0C62; Sun, 26 May 2013 18:54:51 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC9D873; Sun, 26 May 2013 18:54:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIsoGx034610; Sun, 26 May 2013 18:54:50 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIso5o034608; Sun, 26 May 2013 18:54:50 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261854.r4QIso5o034608@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251011 - stable/8/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:54:51 -0000 Author: trociny Date: Sun May 26 18:54:50 2013 New Revision: 251011 URL: http://svnweb.freebsd.org/changeset/base/251011 Log: MFC r250405: Move snmp_hast manual to section 3, where all other manual pages for bsnmp modules are located. Section 3 (Library Functions) looks wrong for this manual page, which contains only module description, that is why initially it was located to section 8 (System Manager's Manual). On the other hand manual pages for all other bsnmpd modules are already located in the section 3, and having all pages in one section looks more consistent. Also, currently, similarly to manuals for other modules, snmp_hast manual contains LIBRARY section, which is not good style for section 8. Added: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 - copied unchanged from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Deleted: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:05 2013 (r251010) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:50 2013 (r251011) @@ -13,7 +13,7 @@ SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l SRCS+= y.tab.h -MAN= snmp_hast.8 +MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= Copied: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 (from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sun May 26 18:54:50 2013 (r251011, copy of r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) @@ -0,0 +1,69 @@ +.\"- +.\" Copyright (c) 2013 Mikolaj Golub +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 9, 2013 +.Dt SNMP_HAST 3 +.Os +.Sh NAME +.Nm snmp_hast +.Nd "HAST module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."hast" = "/usr/lib/snmp_hast.so" +.Sh DESCRIPTION +The +.Nm snmp_hast +module implements a private BEGEMOT-HAST-MIB, which allows +management of HAST resources. +.Pp +The module uses +.Xr hastd 8 +control socket to communicate with the daemon. +.Va hastConfigFile +variable can be used to specify the location of +.Xr hast.conf 5 +file to find the address of the control connection. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/hast_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt +The private BEGEMOT-HAST-MIB that is implemented by this module. +.It Pa /etc/hast.conf +The default +.Xr hastd 8 +configuration file. +.El +.Sh SEE ALSO +.Xr bsnmpd 1 , +.Xr gensnmptree 1 , +.Xr hastctl 8 , +.Xr hastd 8 , +.Xr snmpmod 3 +.Sh AUTHORS +.An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-stable-8@FreeBSD.ORG Mon May 27 13:51:57 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EED2378D; Mon, 27 May 2013 13:51:57 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0D3E3DC; Mon, 27 May 2013 13:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RDpvSg013329; Mon, 27 May 2013 13:51:57 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RDpvar013326; Mon, 27 May 2013 13:51:57 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201305271351.r4RDpvar013326@svn.freebsd.org> From: Dmitry Morozovsky Date: Mon, 27 May 2013 13:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251026 - in stable/8: . sbin/hastctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 13:51:58 -0000 Author: marck (doc committer) Date: Mon May 27 13:51:57 2013 New Revision: 251026 URL: http://svnweb.freebsd.org/changeset/base/251026 Log: Preparation for MFC revs r248291 and r249741: Add 'list' command, for now the exact equivalent of 'status', so users of the latter could change their scripts. This is direct commit to stable, and is temporary. Requested by: Pete French Approved by: trociny 2B cleaned after: 6 weeks Modified: stable/8/UPDATING stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon May 27 13:49:55 2013 (r251025) +++ stable/8/UPDATING Mon May 27 13:51:57 2013 (r251026) @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130524: + `list' command has been added to hastctl(8). For now, it is full + equivalent of `status' command. + WARNING: in the near future the output of hastctl's status command + will change to more terse format. If you use `hastctl status' + for parsing in your scripts, switch to `hastctl list'. + 20130429: Fix a bug that allows NFS clients to issue READDIR on files. Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Mon May 27 13:49:55 2013 (r251025) +++ stable/8/sbin/hastctl/hastctl.8 Mon May 27 13:51:57 2013 (r251026) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd May 24, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -49,6 +49,11 @@ .Aq init | primary | secondary .Ar all | name ... .Nm +.Cm list +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm .Cm status .Op Fl d .Op Fl c Ar config @@ -139,8 +144,19 @@ GEOM provider .Pa /dev/hast/ will not be created on secondary node. .El +.It Cm list .It Cm status -Present status of the configured resources. +Present verbose status of the configured resources. +For now, list and status commands are equivalent. +In the near future the output of +.Nm +status command will change to more terse format. +If you use ` +.Nm +status' for parsing in your scripts, switch to ` +.Nm +list'. + .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Mon May 27 13:49:55 2013 (r251025) +++ stable/8/sbin/hastctl/hastctl.c Mon May 27 13:51:57 2013 (r251026) @@ -70,7 +70,8 @@ enum { CMD_CREATE, CMD_ROLE, CMD_STATUS, - CMD_DUMP + CMD_DUMP, + CMD_LIST }; static __dead2 void @@ -85,6 +86,9 @@ usage(void) " %s role [-d] [-c config] all | name ...\n", getprogname()); fprintf(stderr, + " %s list [-d] [-c config] [all | name ...]\n", + getprogname()); + fprintf(stderr, " %s status [-d] [-c config] [all | name ...]\n", getprogname()); fprintf(stderr, @@ -381,6 +385,9 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "role") == 0) { cmd = CMD_ROLE; optstr = "c:dh"; + } else if (strcmp(argv[1], "list") == 0) { + cmd = CMD_LIST; + optstr = "c:dh"; } else if (strcmp(argv[1], "status") == 0) { cmd = CMD_STATUS; optstr = "c:dh"; @@ -469,6 +476,7 @@ main(int argc, char *argv[]) for (ii = 0; ii < argc - 1; ii++) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; + case CMD_LIST: case CMD_STATUS: /* Obtain status of the given resources. */ nv = nv_alloc(); @@ -524,6 +532,7 @@ main(int argc, char *argv[]) case CMD_ROLE: error = control_set_role(nv, argv[0]); break; + case CMD_LIST: case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-stable-8@FreeBSD.ORG Mon May 27 22:41:44 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB90A5EC; Mon, 27 May 2013 22:41:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CE39183; Mon, 27 May 2013 22:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMfiER090356; Mon, 27 May 2013 22:41:44 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMfiwV090353; Mon, 27 May 2013 22:41:44 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305272241.r4RMfiwV090353@svn.freebsd.org> From: Kirk McKusick Date: Mon, 27 May 2013 22:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251045 - stable/8/sbin/dumpfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:41:44 -0000 Author: mckusick Date: Mon May 27 22:41:43 2013 New Revision: 251045 URL: http://svnweb.freebsd.org/changeset/base/251045 Log: MFC of 250708: Clean up trailing whitespace. Submitted by: Andy Kosela MFC of 250710: (delete addition of -k which does not exist in 8-stable) When running the -m option to generate a newfs(8) command suitable for recreating the filesystem, check for and output the -i, -k, and -l options if appropriate. Note the remaining deficiencies of the -m option in the dumpfs(8) manual page. Specifically that newfs(8) options -E, -R, -S, and -T options are not handled and that -p is not useful so is omitted. Also document that newfs(8) options -n and -r are neither checked for nor output but should be. The -r flag is needed if the filesystem uses gjournal(8). PR: bin/163992 Reported by: Dieter Submitted by: Andy Kosela Modified: stable/8/sbin/dumpfs/dumpfs.8 stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.8 Mon May 27 22:19:01 2013 (r251044) +++ stable/8/sbin/dumpfs/dumpfs.8 Mon May 27 22:41:43 2013 (r251045) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Jul 14, 2011 +.Dd May 16, 2013 .Dt DUMPFS 8 .Os .Sh NAME @@ -76,6 +76,27 @@ is specified, a .Xr newfs 8 command is printed that can be used to generate a new file system with equivalent settings. +Please note that +.Xr newfs 8 +options +.Fl E , +.Fl R , +.Fl S , +and +.Fl T +are not handled and +.Fl p +is not useful in this case so is omitted. +.Xr Newfs 8 +options +.Fl n +and +.Fl r +are neither checked for nor output but should be. +The +.Fl r +flag is needed if the filesystem uses +.Xr gjournal 8 . .Sh SEE ALSO .Xr disktab 5 , .Xr fs 5 , Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Mon May 27 22:19:01 2013 (r251044) +++ stable/8/sbin/dumpfs/dumpfs.c Mon May 27 22:41:43 2013 (r251045) @@ -197,15 +197,15 @@ dumpfs(const char *name) "maxbsize", afs.fs_maxbsize, afs.fs_maxbpg, afs.fs_maxcontig, afs.fs_contigsumsize); printf("nbfree\t%jd\tndir\t%jd\tnifree\t%jd\tnffree\t%jd\n", - (intmax_t)afs.fs_cstotal.cs_nbfree, + (intmax_t)afs.fs_cstotal.cs_nbfree, (intmax_t)afs.fs_cstotal.cs_ndir, - (intmax_t)afs.fs_cstotal.cs_nifree, + (intmax_t)afs.fs_cstotal.cs_nifree, (intmax_t)afs.fs_cstotal.cs_nffree); printf("bpg\t%d\tfpg\t%d\tipg\t%d\tunrefs\t%jd\n", afs.fs_fpg / afs.fs_frag, afs.fs_fpg, afs.fs_ipg, (intmax_t)afs.fs_unrefs); printf("nindir\t%d\tinopb\t%d\tmaxfilesize\t%ju\n", - afs.fs_nindir, afs.fs_inopb, + afs.fs_nindir, afs.fs_inopb, (uintmax_t)afs.fs_maxfilesize); printf("sbsize\t%d\tcgsize\t%d\tcsaddr\t%jd\tcssize\t%d\n", afs.fs_sbsize, afs.fs_cgsize, (intmax_t)afs.fs_csaddr, @@ -416,8 +416,13 @@ marshal(const char *name) printf("-f %d ", fs->fs_fsize); printf("-g %d ", fs->fs_avgfilesize); printf("-h %d ", fs->fs_avgfpdir); - /* -i is dumb */ - /* -j..l unimplemented */ + printf("-i %jd ", fragroundup(fs, lblktosize(fs, fragstoblks(fs, + fs->fs_fpg)) / fs->fs_ipg)); + /* -j..k unimplemented */ + if (fs->fs_flags & FS_GJOURNAL) + printf("-J "); + if (fs->fs_flags & FS_MULTILABEL) + printf("-l "); printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ printf("-o "); From owner-svn-src-stable-8@FreeBSD.ORG Tue May 28 18:43:58 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2FE2736; Tue, 28 May 2013 18:43:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5A8E68; Tue, 28 May 2013 18:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SIhwa0094514; Tue, 28 May 2013 18:43:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SIhwr8094512; Tue, 28 May 2013 18:43:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305281843.r4SIhwr8094512@svn.freebsd.org> From: John Baldwin Date: Tue, 28 May 2013 18:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251064 - stable/8/sys/dev/cpufreq X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 18:43:58 -0000 Author: jhb Date: Tue May 28 18:43:58 2013 New Revision: 251064 URL: http://svnweb.freebsd.org/changeset/base/251064 Log: MFC 247332: Add a quirk to disable this driver for certain older laptops with an ICH2 southbridge and an Intel 82815_MC host bridge where the host bridge's revision is less than 5 Modified: stable/8/sys/dev/cpufreq/ichss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cpufreq/ (props changed) Modified: stable/8/sys/dev/cpufreq/ichss.c ============================================================================== --- stable/8/sys/dev/cpufreq/ichss.c Tue May 28 18:13:08 2013 (r251063) +++ stable/8/sys/dev/cpufreq/ichss.c Tue May 28 18:43:58 2013 (r251064) @@ -67,7 +67,7 @@ struct ichss_softc { #define PCI_DEV_82801BA 0x244c /* ICH2M */ #define PCI_DEV_82801CA 0x248c /* ICH3M */ #define PCI_DEV_82801DB 0x24cc /* ICH4M */ -#define PCI_DEV_82815BA 0x1130 /* Unsupported/buggy part */ +#define PCI_DEV_82815_MC 0x1130 /* Unsupported/buggy part */ /* PCI config registers for finding PMBASE and enabling SpeedStep. */ #define ICHSS_PMBASE_OFFSET 0x40 @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_ * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM * I/O Controller Hub 2 Mobile (ICH2-M). - * - * TODO: add a quirk to disable if we see the 82815_MC along - * with the 82801BA and revision < 5. */ ich_device = pci_find_bsf(0, 0x1f, 0); if (ich_device == NULL || @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_ pci_get_device(ich_device) != PCI_DEV_82801DB)) return; + /* + * Certain systems with ICH2 and an Intel 82815_MC host bridge + * where the host bridge's revision is < 5 lockup if SpeedStep + * is used. + */ + if (pci_get_device(ich_device) == PCI_DEV_82801BA) { + device_t hostb; + + hostb = pci_find_bsf(0, 0, 0); + if (hostb != NULL && + pci_get_vendor(hostb) == PCI_VENDOR_INTEL && + pci_get_device(hostb) == PCI_DEV_82815_MC && + pci_get_revid(hostb) < 5) + return; + } + /* Find the PMBASE register from our PCI config header. */ pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET, sizeof(pmbase)); From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 04:10:57 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C99AAAE; Wed, 29 May 2013 04:10:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9BA232; Wed, 29 May 2013 04:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4Avh3095749; Wed, 29 May 2013 04:10:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4Avqs095748; Wed, 29 May 2013 04:10:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290410.r4T4Avqs095748@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251093 - stable/8/sys/dev/mps X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:10:57 -0000 Author: mav Date: Wed May 29 04:10:57 2013 New Revision: 251093 URL: http://svnweb.freebsd.org/changeset/base/251093 Log: MFC r250900: Fix NULL-dereference kernel panic in case of mps_attach() failure. Modified: stable/8/sys/dev/mps/mps_user.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mps/ (props changed) Modified: stable/8/sys/dev/mps/mps_user.c ============================================================================== --- stable/8/sys/dev/mps/mps_user.c Wed May 29 04:09:32 2013 (r251092) +++ stable/8/sys/dev/mps/mps_user.c Wed May 29 04:10:57 2013 (r251093) @@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc) { /* XXX: do a purge of pending requests? */ - destroy_dev(sc->mps_cdev); - + if (sc->mps_cdev != NULL) + destroy_dev(sc->mps_cdev); } static int From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 04:14:41 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDC47DFF; Wed, 29 May 2013 04:14:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D069925D; Wed, 29 May 2013 04:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4EfQt096554; Wed, 29 May 2013 04:14:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4Efh4096553; Wed, 29 May 2013 04:14:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290414.r4T4Efh4096553@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251095 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:14:41 -0000 Author: mav Date: Wed May 29 04:14:41 2013 New Revision: 251095 URL: http://svnweb.freebsd.org/changeset/base/251095 Log: MFC r250819: Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit. In some cases it could cause kernel panic during failed drive replacement. Modified: stable/8/sys/geom/raid/md_ddf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_ddf.c ============================================================================== --- stable/8/sys/geom/raid/md_ddf.c Wed May 29 04:12:53 2013 (r251094) +++ stable/8/sys/geom/raid/md_ddf.c Wed May 29 04:14:41 2013 (r251095) @@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta * int i, bvd, pos; i = 0; - for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) { + for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { if (vmeta->bvdc[bvd] == NULL) { i += GET16(vmeta, vdc->Primary_Element_Count); // XXX continue; From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 04:18:03 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1632120D; Wed, 29 May 2013 04:18:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED647292; Wed, 29 May 2013 04:18:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4I2p6097293; Wed, 29 May 2013 04:18:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4I28Y097292; Wed, 29 May 2013 04:18:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290418.r4T4I28Y097292@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251097 - stable/8/sys/cam/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:18:03 -0000 Author: mav Date: Wed May 29 04:18:02 2013 New Revision: 251097 URL: http://svnweb.freebsd.org/changeset/base/251097 Log: MFC r250508: Disable sending Early R_OK on SiI3726/SiI3826 port multipliers. With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Modified: stable/8/sys/cam/ata/ata_pmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Wed May 29 04:17:05 2013 (r251096) +++ stable/8/sys/cam/ata/ata_pmp.c Wed May 29 04:18:02 2013 (r251097) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, + PMP_STATE_PM_QUIRKS_1, + PMP_STATE_PM_QUIRKS_2, + PMP_STATE_PM_QUIRKS_3, PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, @@ -319,7 +322,11 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PRECONFIG; + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); xpt_schedule(periph, CAM_PRIORITY_DEV); } else @@ -434,7 +441,10 @@ pmpstart(struct cam_periph *periph, unio if (softc->restart) { softc->restart = 0; - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); } /* Fetch user wanted device speed. */ if (softc->state == PMP_STATE_RESET || @@ -464,6 +474,32 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; + + case PMP_STATE_PM_QUIRKS_1: + case PMP_STATE_PM_QUIRKS_3: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_read_cmd(ataio, 129, 15); + break; + + case PMP_STATE_PM_QUIRKS_2: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 129, 15, softc->caps & ~0x1); + break; + case PMP_STATE_PRECONFIG: /* Get/update host SATA capabilities. */ bzero(&cts, sizeof(cts)); @@ -473,6 +509,8 @@ pmpstart(struct cam_periph *periph, unio xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) softc->caps = cts.xport_specific.sata.caps; + else + softc->caps = 0; cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -582,7 +620,10 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -623,10 +664,48 @@ pmpdone(struct cam_periph *periph, union printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_1: + softc->caps = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + if (softc->caps & 0x1) + softc->state = PMP_STATE_PM_QUIRKS_2; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_2: + if (bootverbose) + softc->state = PMP_STATE_PM_QUIRKS_3; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_3: + res = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + printf("%s%d: Disabling SiI3x26 R_OK in GSCR_POLL: %x->%x\n", + periph->periph_name, periph->unit_number, softc->caps, res); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 16:55:33 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAA611D2; Wed, 29 May 2013 16:55:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC8C599E; Wed, 29 May 2013 16:55:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TGtX9K062743; Wed, 29 May 2013 16:55:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TGtXDx062742; Wed, 29 May 2013 16:55:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305291655.r4TGtXDx062742@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 16:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251104 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 16:55:33 -0000 Author: des Date: Wed May 29 16:55:33 2013 New Revision: 251104 URL: http://svnweb.freebsd.org/changeset/base/251104 Log: MF9 (r248915): remove harmless duplicate entry for VersionAddendum. Modified: stable/8/crypto/openssh/servconf.c Modified: stable/8/crypto/openssh/servconf.c ============================================================================== --- stable/8/crypto/openssh/servconf.c Wed May 29 16:51:03 2013 (r251103) +++ stable/8/crypto/openssh/servconf.c Wed May 29 16:55:33 2013 (r251104) @@ -499,7 +499,6 @@ static struct { { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, { "ipqos", sIPQoS, SSHCFG_ALL }, { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, - { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, { "hpndisabled", sHPNDisabled, SSHCFG_ALL }, { "hpnbuffersize", sHPNBufferSize, SSHCFG_ALL }, { "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL }, From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 17:31:35 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9E978A8; Wed, 29 May 2013 17:31:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ABBEEAFD; Wed, 29 May 2013 17:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4THVZ9p076227; Wed, 29 May 2013 17:31:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4THVZWJ076226; Wed, 29 May 2013 17:31:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305291731.r4THVZWJ076226@svn.freebsd.org> From: Bryan Drewery Date: Wed, 29 May 2013 17:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251106 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 17:31:35 -0000 Author: bdrewery (ports committer) Date: Wed May 29 17:31:34 2013 New Revision: 251106 URL: http://svnweb.freebsd.org/changeset/base/251106 Log: MFH r250595: The HPN patch added a new BUG bit for SSH_BUG_LARGEWINDOW and the update to 6.1 added SSH_BUG_DYNAMIC_RPORT with the same value. Fix the HPN SSH_BUG_LARGEWINDOW bit so it is unique. Modified: stable/8/crypto/openssh/compat.h Directory Properties: stable/8/crypto/openssh/ (props changed) Modified: stable/8/crypto/openssh/compat.h ============================================================================== --- stable/8/crypto/openssh/compat.h Wed May 29 17:04:43 2013 (r251105) +++ stable/8/crypto/openssh/compat.h Wed May 29 17:31:34 2013 (r251106) @@ -60,7 +60,7 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x08000000 +#define SSH_BUG_LARGEWINDOW 0x10000000 void enable_compat13(void); void enable_compat20(void); From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 21:08:23 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E1418EAB; Wed, 29 May 2013 21:08:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4216965; Wed, 29 May 2013 21:08:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TL8N1R051369; Wed, 29 May 2013 21:08:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TL8NgK051368; Wed, 29 May 2013 21:08:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292108.r4TL8NgK051368@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 21:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251111 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 21:08:24 -0000 Author: markj Date: Wed May 29 21:08:23 2013 New Revision: 251111 URL: http://svnweb.freebsd.org/changeset/base/251111 Log: MFC r250545: Some filesystems (NFS in particular) do not fill out the d_type field when returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:07:24 2013 (r251110) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:08:23 2013 (r251111) @@ -1447,16 +1447,27 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, + struct tm *tm) { + struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) - return (0); + if (dp->d_type != DT_REG) { + /* + * Some filesystems (e.g. NFS) don't fill out the d_type field + * and leave it set to DT_UNKNOWN; in this case we must obtain + * the file type ourselves. + */ + if (dp->d_type != DT_UNKNOWN || + fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || + !S_ISREG(sb.st_mode)) + return (0); + } /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1508,7 +1519,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dirfd, i, logcnt, max_logcnt; + int dir_fd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1540,9 +1551,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; /* @@ -2248,7 +2259,7 @@ mtime_old_timelog(const char *file) { struct stat sb; struct tm tm; - int dir_fd; + int dirfd; time_t t; struct dirent *dp; DIR *dirp; @@ -2273,13 +2284,13 @@ mtime_old_timelog(const char *file) warn("Cannot open log directory '%s'", dir); return (t); } - dir_fd = dirfd(dirp); + dirfd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, 0) == -1) { + if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable-8@FreeBSD.ORG Wed May 29 22:29:33 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFCB4A88; Wed, 29 May 2013 22:29:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0AD3CCA; Wed, 29 May 2013 22:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TMTXrA079439; Wed, 29 May 2013 22:29:33 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TMTXTO079438; Wed, 29 May 2013 22:29:33 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292229.r4TMTXTO079438@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 22:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251112 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:29:33 -0000 Author: markj Date: Wed May 29 22:29:33 2013 New Revision: 251112 URL: http://svnweb.freebsd.org/changeset/base/251112 Log: Revert my previous merge. There's a variable name difference between head and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I did the MFC, even after I tested. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:08:23 2013 (r251111) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) @@ -1447,27 +1447,16 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, - struct tm *tm) +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) { - struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) { - /* - * Some filesystems (e.g. NFS) don't fill out the d_type field - * and leave it set to DT_UNKNOWN; in this case we must obtain - * the file type ourselves. - */ - if (dp->d_type != DT_UNKNOWN || - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || - !S_ISREG(sb.st_mode)) - return (0); - } + if (dp->d_type != DT_REG) + return (0); /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1519,7 +1508,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dir_fd, i, logcnt, max_logcnt; + int dirfd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1551,9 +1540,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dir_fd = dirfd(dirp); + dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; /* @@ -2259,7 +2248,7 @@ mtime_old_timelog(const char *file) { struct stat sb; struct tm tm; - int dirfd; + int dir_fd; time_t t; struct dirent *dp; DIR *dirp; @@ -2284,13 +2273,13 @@ mtime_old_timelog(const char *file) warn("Cannot open log directory '%s'", dir); return (t); } - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable-8@FreeBSD.ORG Thu May 30 19:24:32 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46B977B7; Thu, 30 May 2013 19:24:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37362F6B; Thu, 30 May 2013 19:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJOWgp020880; Thu, 30 May 2013 19:24:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJOT2g020861; Thu, 30 May 2013 19:24:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305301924.r4UJOT2g020861@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 19:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251148 - in stable/8/sys: fs/nfs fs/nfsclient gnu/fs/ext2fs kern nfsclient sys tools X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:24:32 -0000 Author: jhb Date: Thu May 30 19:24:29 2013 New Revision: 251148 URL: http://svnweb.freebsd.org/changeset/base/251148 Log: MFC 246417,247116,248584: Rework the handling of stop signals in the NFS client. The changes in 195702, 195703, and 195821 prevented a thread from suspending while holding locks inside of NFS by forcing the thread to fail sleeps with EINTR or ERESTART but defer the thread suspension to the user boundary. However, this had the effect that stopping a process during an NFS request could abort the request and trigger EINTR errors that were visible to userland processes (previously the thread would have suspended and completed the request once it was resumed). This change instead effectively masks stop signals while in the NFS client. It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot be masked directly. Instead of setting PBDRY on individual sleeps, change the VFS_*() and VOP_*() methods to defer stop signals for filesystems which request this behavior via a new VFCF_SBDRY flag. Note that this has to be a VFC flag rather than a MNTK flag so that it works properly with VFS_MOUNT() when the mount is not yet fully constructed. For now, only the NFS clients set this new flag in VFS_SET(). A few other related changes: - Add an assertion to ensure that TDF_SBDRY doesn't leak to userland. - When a lookup request uses VOP_READLINK() to follow a symlink, mark the request as being on behalf of the thread performing the lookup (cnp_thread) rather than using a NULL thread pointer. This causes NFS to properly handle signals during this VOP on an interruptible mount. - Ignore thread suspend requests due to SIGSTOP if stop signals are currently deferred. This can occur if a process is stopped via SIGSTOP while a thread is running or runnable but before it has set TDF_SBDRY. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_thread.c stable/8/sys/kern/subr_sleepqueue.c stable/8/sys/kern/subr_trap.c stable/8/sys/kern/vfs_export.c stable/8/sys/kern/vfs_lookup.c stable/8/sys/nfsclient/nfs_krpc.c stable/8/sys/nfsclient/nfs_vfsops.c stable/8/sys/sys/mount.h stable/8/sys/sys/signalvar.h stable/8/sys/tools/vnode_if.awk Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/tools/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:24:29 2013 (r251148) @@ -885,7 +885,6 @@ int newnfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -906,7 +905,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -935,8 +934,9 @@ newnfs_set_sigmask(struct thread *td, si SIGDELSET(newset, newnfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:24:29 2013 (r251148) @@ -130,7 +130,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(newnfs, 1); Modified: stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c Thu May 30 19:24:29 2013 (r251148) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/kern_sig.c Thu May 30 19:24:29 2013 (r251148) @@ -2351,6 +2351,13 @@ tdsigwakeup(struct thread *td, int sig, } /* + * Don't awaken a sleeping thread for SIGSTOP if the + * STOP signal is deferred. + */ + if ((prop & SA_STOP) && (td->td_flags & TDF_SBDRY)) + goto out; + + /* * Give low priority threads a better chance to run. */ if (td->td_priority > PUSER) @@ -2391,12 +2398,13 @@ sig_suspend_threads(struct thread *td, s if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) && (td2->td_flags & TDF_SINTR)) { if (td2->td_flags & TDF_SBDRY) { - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); + /* + * Once a thread is asleep with + * TDF_SBDRY set, it should never + * become suspended due to this check. + */ + KASSERT(!TD_IS_SUSPENDED(td2), + ("thread with deferred stops suspended")); } else if (!TD_IS_SUSPENDED(td2)) { thread_suspend_one(td2); } @@ -2519,6 +2527,40 @@ tdsigcleanup(struct thread *td) } /* + * Defer the delivery of SIGSTOP for the current thread. Returns true + * if stops were deferred and false if they were already deferred. + */ +int +sigdeferstop(void) +{ + struct thread *td; + + td = curthread; + if (td->td_flags & TDF_SBDRY) + return (0); + thread_lock(td); + td->td_flags |= TDF_SBDRY; + thread_unlock(td); + return (1); +} + +/* + * Permit the delivery of SIGSTOP for the current thread. This does + * not immediately suspend if a stop was posted. Instead, the thread + * will suspend either via ast() or a subsequent interruptible sleep. + */ +void +sigallowstop() +{ + struct thread *td; + + td = curthread; + thread_lock(td); + td->td_flags &= ~TDF_SBDRY; + thread_unlock(td); +} + +/* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. * Stop signals with default action are processed immediately, then cleared; @@ -2550,7 +2592,7 @@ issignal(struct thread *td, int stop_all SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); - if (p->p_flag & P_PPWAIT) + if (p->p_flag & P_PPWAIT || td->td_flags & TDF_SBDRY) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); @@ -2665,10 +2707,6 @@ issignal(struct thread *td, int stop_all (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ - - /* Ignore, but do not drop the stop signal. */ - if (stop_allowed != SIG_STOP_ALLOWED) - return (sig); mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); Modified: stable/8/sys/kern/kern_thread.c ============================================================================== --- stable/8/sys/kern/kern_thread.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/kern_thread.c Thu May 30 19:24:29 2013 (r251148) @@ -741,6 +741,17 @@ thread_suspend_check(int return_instead) (p->p_flag & P_SINGLE_BOUNDARY) && return_instead) return (ERESTART); + /* + * Ignore suspend requests for stop signals if they + * are deferred. + */ + if (P_SHOULDSTOP(p) == P_STOPPED_SIG && + td->td_flags & TDF_SBDRY) { + KASSERT(return_instead, + ("TDF_SBDRY set for unsafe thread_suspend_check")); + return (0); + } + /* If thread will exit, flush its pending signals */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) sigqueue_flush(&td->td_sigqueue); Modified: stable/8/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/8/sys/kern/subr_sleepqueue.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/subr_sleepqueue.c Thu May 30 19:24:29 2013 (r251148) @@ -351,8 +351,6 @@ sleepq_add(void *wchan, struct lock_obje if (flags & SLEEPQ_INTERRUPTIBLE) { td->td_flags |= TDF_SINTR; td->td_flags &= ~TDF_SLEEPABORT; - if (flags & SLEEPQ_STOP_ON_BDRY) - td->td_flags |= TDF_SBDRY; } thread_unlock(td); } @@ -591,7 +589,7 @@ sleepq_check_signals(void) /* We are no longer in an interruptible sleep. */ if (td->td_flags & TDF_SINTR) - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; if (td->td_flags & TDF_SLEEPABORT) { td->td_flags &= ~TDF_SLEEPABORT; @@ -738,7 +736,7 @@ sleepq_resume_thread(struct sleepqueue * td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/subr_trap.c Thu May 30 19:24:29 2013 (r251148) @@ -134,6 +134,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held.", td->td_locks)); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); + KASSERT((td->td_flags & TDF_SBDRY) == 0, + ("userret: Returning with stop signals deferred")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: stable/8/sys/kern/vfs_export.c ============================================================================== --- stable/8/sys/kern/vfs_export.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/vfs_export.c Thu May 30 19:24:29 2013 (r251148) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/vfs_lookup.c Thu May 30 19:24:29 2013 (r251148) @@ -323,7 +323,7 @@ namei(struct nameidata *ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = (struct thread *)0; + auio.uio_td = td; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/nfsclient/nfs_krpc.c Thu May 30 19:24:29 2013 (r251148) @@ -699,7 +699,6 @@ int nfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -720,7 +719,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -749,8 +748,9 @@ nfs_set_sigmask(struct thread *td, sigse SIGDELSET(newset, nfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/nfsclient/nfs_vfsops.c Thu May 30 19:24:29 2013 (r251148) @@ -144,7 +144,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfs, 1); Modified: stable/8/sys/sys/mount.h ============================================================================== --- stable/8/sys/sys/mount.h Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/sys/mount.h Thu May 30 19:24:29 2013 (r251148) @@ -465,6 +465,7 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ +#define VFCF_SBDRY 0x01000000 /* defer stop requests */ typedef uint32_t fsctlop_t; @@ -598,28 +599,6 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) (*(MP)->mnt_op->vfs_mount)(MP) -#define VFS_UNMOUNT(MP, FORCE) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE) -#define VFS_ROOT(MP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP) -#define VFS_QUOTACTL(MP, C, U, A) \ - (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A) -#define VFS_STATFS(MP, SBP) __vfs_statfs((MP), (SBP)) -#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) -#define VFS_VGET(MP, INO, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) -#define VFS_FHTOVP(MP, FIDP, VPP) \ - (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) \ - (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC, SEC) -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N) -#define VFS_SYSCTL(MP, OP, REQ) \ - (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ) -#define VFS_SUSP_CLEAN(MP) \ - ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); }) - #define VFS_NEEDSGIANT_(MP) \ ((MP) != NULL && ((MP)->mnt_kern_flag & MNTK_MPSAFE) == 0) @@ -651,6 +630,122 @@ vfs_statfs_t __vfs_statfs; mtx_assert(&Giant, MA_OWNED); \ } while (0) +#define VFS_PROLOGUE(MP) do { \ + int _enable_stops; \ + \ + _enable_stops = ((MP) != NULL && \ + ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + +#define VFS_EPILOGUE(MP) \ + if (_enable_stops) \ + sigallowstop(); \ +} while (0) + +#define VFS_MOUNT(MP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_UNMOUNT(MP, FORCE) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_ROOT(MP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_QUOTACTL(MP, C, U, A) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_STATFS(MP, SBP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = __vfs_statfs((MP), (SBP)); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYNC(MP, WAIT) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_FHTOVP(MP, FIDP, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ + SEC); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYSCTL(MP, OP, REQ) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SUSP_CLEAN(MP) do { \ + if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_susp_clean)(MP); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + +#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/sys/signalvar.h Thu May 30 19:24:29 2013 (r251148) @@ -327,6 +327,8 @@ extern int kern_logsigexit; /* Sysctl va * Machine-independent functions: */ int cursig(struct thread *td, int stop_allowed); +int sigdeferstop(void); +void sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); Modified: stable/8/sys/tools/vnode_if.awk ============================================================================== --- stable/8/sys/tools/vnode_if.awk Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/tools/vnode_if.awk Thu May 30 19:24:29 2013 (r251148) @@ -172,6 +172,7 @@ if (cfile) { "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ @@ -378,10 +379,12 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); add_pre(name); + printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc(ctrstr); printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 30 20:11:32 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6762DC49; Thu, 30 May 2013 20:11:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59B482D0; Thu, 30 May 2013 20:11:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKBWBK038313; Thu, 30 May 2013 20:11:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKBWqN038312; Thu, 30 May 2013 20:11:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305302011.r4UKBWqN038312@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 20:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251153 - stable/8/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:11:32 -0000 Author: jhb Date: Thu May 30 20:11:31 2013 New Revision: 251153 URL: http://svnweb.freebsd.org/changeset/base/251153 Log: MFC 249566-249567: Document that sem_wait() can fail with EINTR if it is interrupted by a signal. Modified: stable/8/lib/libc/gen/sem_wait.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/sem_wait.3 ============================================================================== --- stable/8/lib/libc/gen/sem_wait.3 Thu May 30 20:09:21 2013 (r251152) +++ stable/8/lib/libc/gen/sem_wait.3 Thu May 30 20:11:31 2013 (r251153) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2000 +.Dd April 16, 2013 .Dt SEM_WAIT 3 .Os .Sh NAME @@ -75,6 +75,13 @@ points to an invalid semaphore. .El .Pp Additionally, +.Fn sem_wait +will fail if: +.Bl -tag -width Er +.It Bq Er EINTR +A signal interrupted this function. +.El +Additionally, .Fn sem_trywait will fail if: .Bl -tag -width Er From owner-svn-src-stable-8@FreeBSD.ORG Thu May 30 20:42:56 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B483625; Thu, 30 May 2013 20:42:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C95A6C6; Thu, 30 May 2013 20:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKgunr048888; Thu, 30 May 2013 20:42:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKgpZF048852; Thu, 30 May 2013 20:42:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302042.r4UKgpZF048852@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251155 - in stable/8: contrib/less usr.bin/less X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:42:56 -0000 Author: delphij Date: Thu May 30 20:42:51 2013 New Revision: 251155 URL: http://svnweb.freebsd.org/changeset/base/251155 Log: MFC: less v458. Modified: stable/8/contrib/less/NEWS stable/8/contrib/less/README stable/8/contrib/less/cmdbuf.c stable/8/contrib/less/configure stable/8/contrib/less/configure.ac stable/8/contrib/less/defines.ds stable/8/contrib/less/defines.h.in stable/8/contrib/less/defines.o2 stable/8/contrib/less/defines.o9 stable/8/contrib/less/defines.wn stable/8/contrib/less/help.c stable/8/contrib/less/less.hlp stable/8/contrib/less/less.man stable/8/contrib/less/less.nro stable/8/contrib/less/lessecho.man stable/8/contrib/less/lessecho.nro stable/8/contrib/less/lesskey.man stable/8/contrib/less/lesskey.nro stable/8/contrib/less/option.c stable/8/contrib/less/opttbl.c stable/8/contrib/less/output.c stable/8/contrib/less/position.c stable/8/contrib/less/screen.c stable/8/contrib/less/version.c stable/8/usr.bin/less/defines.h Directory Properties: stable/8/contrib/less/ (props changed) stable/8/usr.bin/less/ (props changed) Modified: stable/8/contrib/less/NEWS ============================================================================== --- stable/8/contrib/less/NEWS Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/NEWS Thu May 30 20:42:51 2013 (r251155) @@ -11,6 +11,25 @@ ====================================================================== + Major changes between "less" versions 451 and 458 + +* Allow backslash escaping of metacharacters in LESS environment variable + after the --use-backslash option. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +* Fix display bug when using up/down arrow on the command line. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: stable/8/contrib/less/README ============================================================================== --- stable/8/contrib/less/README Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/README Thu May 30 20:42:51 2013 (r251155) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 451 + Less, version 458 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 458, released 04 Apr 2013. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: stable/8/contrib/less/cmdbuf.c ============================================================================== --- stable/8/contrib/less/cmdbuf.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/cmdbuf.c Thu May 30 20:42:51 2013 (r251155) @@ -727,9 +727,9 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; - strcpy(cmdbuf, s); cmd_home(); clear_eol(); + strcpy(cmdbuf, s); for (cp = cmdbuf; *cp != '\0'; ) cmd_right(); return (CC_OK); Modified: stable/8/contrib/less/configure ============================================================================== --- stable/8/contrib/less/configure Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/configure Thu May 30 20:42:51 2013 (r251155) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: stable/8/contrib/less/configure.ac ============================================================================== --- stable/8/contrib/less/configure.ac Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/configure.ac Thu May 30 20:42:51 2013 (r251155) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: stable/8/contrib/less/defines.ds ============================================================================== --- stable/8/contrib/less/defines.ds Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.ds Thu May 30 20:42:51 2013 (r251155) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: stable/8/contrib/less/defines.h.in ============================================================================== --- stable/8/contrib/less/defines.h.in Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.h.in Thu May 30 20:42:51 2013 (r251155) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: stable/8/contrib/less/defines.o2 ============================================================================== --- stable/8/contrib/less/defines.o2 Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.o2 Thu May 30 20:42:51 2013 (r251155) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/8/contrib/less/defines.o9 ============================================================================== --- stable/8/contrib/less/defines.o9 Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.o9 Thu May 30 20:42:51 2013 (r251155) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: stable/8/contrib/less/defines.wn ============================================================================== --- stable/8/contrib/less/defines.wn Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.wn Thu May 30 20:42:51 2013 (r251155) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/8/contrib/less/help.c ============================================================================== --- stable/8/contrib/less/help.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/help.c Thu May 30 20:42:51 2013 (r251155) @@ -110,7 +110,7 @@ constant char helpdata[] = { ' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n', +' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n', '\n', ' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', Modified: stable/8/contrib/less/less.hlp ============================================================================== --- stable/8/contrib/less/less.hlp Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.hlp Thu May 30 20:42:51 2013 (r251155) @@ -107,7 +107,7 @@ Most options may be changed either on the command line, or from within less by using the - or -- command. Options may be given in one of two forms: either a single - character preceded by a -, or a name preceeded by --. + character preceded by a -, or a name preceded by --. -? ........ --help Display help (from command line). Modified: stable/8/contrib/less/less.man ============================================================================== --- stable/8/contrib/less/less.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.man Thu May 30 20:42:51 2013 (r251155) @@ -437,13 +437,18 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a dollar + sign ($) is found. For example, you can set two -D options on MS-DOS like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + If the --use-backslash option appears earlier in the options, then a + dollar sign or backslash may be included literally in an option string + by preceding it with a backslash. If the --use-backslash option is not + in effect, then backslashes are not treated specially, and there is no + way to include a dollar sign in the option string. -? or --help This option displays a summary of the commands accepted by less @@ -836,11 +841,6 @@ LESS(1) actual scroll remains at the specified fraction of the screen width. - --no-keypad - Disables sending the keypad initialization and deinitialization - strings to the terminal. This is sometimes useful if the keypad - strings make the numeric keypad behave in an undesirable manner. - --follow-name Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the @@ -851,6 +851,18 @@ LESS(1) has been created with the same name as the original (now renamed) file), less will display the contents of that new file. + --no-keypad + Disables sending the keypad initialization and deinitialization + strings to the terminal. This is sometimes useful if the keypad + strings make the numeric keypad behave in an undesirable manner. + + --use-backslash + This option changes the interpretations of options which follow + this one. After the --use-backslash option, any backslash in an + option string is removed and the following character is taken + literally. This allows a dollar sign to be included in option + strings. + -- A command line argument of "--" marks the end of option argu- ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins @@ -1597,8 +1609,8 @@ LESS(1) AUTHOR - Mark Nudelman - Send bug reports or comments to bug-less@gnu.org. + Mark Nudelman + Send bug reports or comments to See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. For more information, see the less homepage at @@ -1606,4 +1618,4 @@ LESS(1) - Version 451: 21 Jul 2012 LESS(1) + Version 458: 04 Apr 2013 LESS(1) Modified: stable/8/contrib/less/less.nro ============================================================================== --- stable/8/contrib/less/less.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 451: 21 Jul 2012" +.TH LESS 1 "Version 458: 04 Apr 2013" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -455,13 +455,18 @@ If an option appears in the LESS variabl to its default value on the command line by beginning the command line option with "\-+". .sp -For options like \-P or \-D which take a following string, -a dollar sign ($) must be used to signal the end of the string. -For example, to set two \-D options on MS-DOS, you must have -a dollar sign between them, like this: +Some options like \-k or \-D require a string to follow the option letter. +The string for that option is considered to end when a dollar sign ($) is found. +For example, you can set two \-D options on MS-DOS like this: .sp -LESS="-Dn9.1$-Ds4.1" +LESS="Dn9.1$Ds4.1" .sp +If the --use-backslash option appears earlier in the options, then +a dollar sign or backslash may be included literally in an option string +by preceding it with a backslash. +If the --use-backslash option is not in effect, then backslashes are +not treated specially, and there is no way to include a dollar sign +in the option string. .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .I less @@ -890,11 +895,6 @@ If the number is specified as a fraction scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width. -.IP "\-\-no-keypad" -Disables sending the keypad initialization and deinitialization strings -to the terminal. -This is sometimes useful if the keypad strings make the numeric -keypad behave in an undesirable manner. .IP "\-\-follow-name" Normally, if the input file is renamed while an F command is executing, .I less @@ -908,6 +908,16 @@ If the reopen succeeds and the file is a with the same name as the original (now renamed) file), .I less will display the contents of that new file. +.IP "\-\-no-keypad" +Disables sending the keypad initialization and deinitialization strings +to the terminal. +This is sometimes useful if the keypad strings make the numeric +keypad behave in an undesirable manner. +.IP "\-\-use-backslash" +This option changes the interpretations of options which follow this one. +After the \-\-use-backslash option, any backslash in an option string is +removed and the following character is taken literally. +This allows a dollar sign to be included in option strings. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. @@ -1739,9 +1749,9 @@ See the GNU General Public License for m .SH AUTHOR .PP -Mark Nudelman +Mark Nudelman .br -Send bug reports or comments to bug-less@gnu.org. +Send bug reports or comments to .br See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. .br Modified: stable/8/contrib/less/lessecho.man ============================================================================== --- stable/8/contrib/less/lessecho.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lessecho.man Thu May 30 20:42:51 2013 (r251155) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 451: 21 Jul 2012 LESSECHO(1) + Version 458: 04 Apr 2013 LESSECHO(1) Modified: stable/8/contrib/less/lessecho.nro ============================================================================== --- stable/8/contrib/less/lessecho.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lessecho.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 451: 21 Jul 2012" +.TH LESSECHO 1 "Version 458: 04 Apr 2013" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: stable/8/contrib/less/lesskey.man ============================================================================== --- stable/8/contrib/less/lesskey.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lesskey.man Thu May 30 20:42:51 2013 (r251155) @@ -353,4 +353,4 @@ LESSKEY(1) - Version 451: 21 Jul 2012 LESSKEY(1) + Version 458: 04 Apr 2013 LESSKEY(1) Modified: stable/8/contrib/less/lesskey.nro ============================================================================== --- stable/8/contrib/less/lesskey.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lesskey.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 451: 21 Jul 2012" +.TH LESSKEY 1 "Version 458: 04 Apr 2013" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS Modified: stable/8/contrib/less/option.c ============================================================================== --- stable/8/contrib/less/option.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/option.c Thu May 30 20:42:51 2013 (r251155) @@ -30,6 +30,7 @@ extern int screen_trashed; extern int less_is_more; extern int quit_at_eof; extern char *every_first_cmd; +extern int opt_use_backslash; /* * Return a printable description of an option. @@ -146,10 +147,13 @@ scan_option(s) */ plusoption = TRUE; s = optstring(s, &str, propt('+'), NULL); + if (s == NULL) + return; if (*str == '+') - every_first_cmd = save(++str); + every_first_cmd = save(str+1); else ungetsc(str); + free(str); continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -202,7 +206,7 @@ scan_option(s) parg.p_string = printopt; error("The %s option should not be followed by =", &parg); - quit(QUIT_ERROR); + return; } s++; } else @@ -223,7 +227,7 @@ scan_option(s) else error("There is no %s option (\"less --help\" for help)", &parg); - quit(QUIT_ERROR); + return; } str = NULL; @@ -260,6 +264,8 @@ scan_option(s) while (*s == ' ') s++; s = optstring(s, &str, printopt, o->odesc[1]); + if (s == NULL) + return; break; case NUMBER: if (*s == '\0') @@ -275,6 +281,8 @@ scan_option(s) */ if (o->ofunc != NULL) (*o->ofunc)(INIT, str); + if (str != NULL) + free(str); } } @@ -558,35 +566,33 @@ optstring(s, p_str, printopt, validchars char *validchars; { register char *p; + register char *out; if (*s == '\0') { nostring(printopt); - quit(QUIT_ERROR); + return (NULL); } - *p_str = s; + /* Alloc could be more than needed, but not worth trimming. */ + *p_str = (char *) ecalloc(strlen(s)+1, sizeof(char)); + out = *p_str; + for (p = s; *p != '\0'; p++) { - if (*p == END_OPTION_STRING || - (validchars != NULL && strchr(validchars, *p) == NULL)) + if (opt_use_backslash && *p == '\\' && p[1] != '\0') { - switch (*p) - { - case END_OPTION_STRING: - case ' ': case '\t': case '-': - /* Replace the char with a null to terminate string. */ - *p++ = '\0'; - break; - default: - /* Cannot replace char; make a copy of the string. */ - *p_str = (char *) ecalloc(p-s+1, sizeof(char)); - strncpy(*p_str, s, p-s); - (*p_str)[p-s] = '\0'; + /* Take next char literally. */ + ++p; + } else + { + if (*p == END_OPTION_STRING || + (validchars != NULL && strchr(validchars, *p) == NULL)) + /* End of option string. */ break; - } - break; } + *out++ = *p; } + *out = '\0'; return (p); } @@ -609,8 +615,6 @@ num_error(printopt, errp) parg.p_string = printopt; error("Number is required after %s", &parg); } - quit(QUIT_ERROR); - /* NOTREACHED */ return (-1); } Modified: stable/8/contrib/less/opttbl.c ============================================================================== --- stable/8/contrib/less/opttbl.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/opttbl.c Thu May 30 20:42:51 2013 (r251155) @@ -52,6 +52,7 @@ public int use_lessopen; /* Use the LESS public int quit_on_intr; /* Quit on interrupt */ public int follow_mode; /* F cmd Follows file desc or file name? */ public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */ +public int opt_use_backslash; /* Use backslash escaping in option parsing */ #if HILITE_SEARCH public int hilite_search; /* Highlight matched search patterns? */ #endif @@ -115,6 +116,7 @@ static struct optname pound_optname = { static struct optname keypad_optname = { "no-keypad", NULL }; static struct optname oldbot_optname = { "old-bot", NULL }; static struct optname follow_optname = { "follow-name", NULL }; +static struct optname use_backslash_optname = { "use-backslash", NULL }; /* @@ -446,6 +448,14 @@ static struct loption option[] = NULL } }, + { OLETTER_NONE, &use_backslash_optname, + BOOL, OPT_OFF, &opt_use_backslash, NULL, + { + "Use backslash escaping in command line parameters", + "Don't use backslash escaping in command line parameters", + NULL + } + }, { '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } } }; Modified: stable/8/contrib/less/output.c ============================================================================== --- stable/8/contrib/less/output.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/output.c Thu May 30 20:42:51 2013 (r251155) @@ -278,8 +278,13 @@ flush() */ if (p[-2] == '[') { +#if MSDOS_COMPILER==WIN32C + fg |= FOREGROUND_INTENSITY; + bg |= BACKGROUND_INTENSITY; +#else fg = bo_fg_color; bg = bo_bg_color; +#endif } else fg |= 8; } else if (at & 2) Modified: stable/8/contrib/less/position.c ============================================================================== --- stable/8/contrib/less/position.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/position.c Thu May 30 20:42:51 2013 (r251155) @@ -162,7 +162,7 @@ empty_lines(s, e) register int i; for (i = s; i <= e; i++) - if (table[i] != NULL_POSITION) + if (table[i] != NULL_POSITION && table[i] != 0) return (0); return (1); } Modified: stable/8/contrib/less/screen.c ============================================================================== --- stable/8/contrib/less/screen.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/screen.c Thu May 30 20:42:51 2013 (r251155) @@ -802,7 +802,7 @@ scrsize() else if ((n = ltgetnum("li")) > 0) sc_height = n; #endif - else + if (sc_height <= 0) sc_height = DEF_SC_HEIGHT; if (sys_width > 0) @@ -813,7 +813,7 @@ scrsize() else if ((n = ltgetnum("co")) > 0) sc_width = n; #endif - else + if (sc_width <= 0) sc_width = DEF_SC_WIDTH; } Modified: stable/8/contrib/less/version.c ============================================================================== --- stable/8/contrib/less/version.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/version.c Thu May 30 20:42:51 2013 (r251155) @@ -753,6 +753,15 @@ v448 6/15/12 Print name of regex libr v449 6/23/12 Allow config option --with-regex=none. v450 7/4/12 Fix EOF bug with ESC-F. v451 7/20/12 Fix typo. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu May 30 21:50:25 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 975BF3C9; Thu, 30 May 2013 21:50:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A463C1C; Thu, 30 May 2013 21:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULoPvB071700; Thu, 30 May 2013 21:50:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULoPW4071699; Thu, 30 May 2013 21:50:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302150.r4ULoPW4071699@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251163 - stable/8/sys/dev/hptiop X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:50:25 -0000 Author: delphij Date: Thu May 30 21:50:25 2013 New Revision: 251163 URL: http://svnweb.freebsd.org/changeset/base/251163 Log: MFC r250050: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly Modified: stable/8/sys/dev/hptiop/hptiop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/hptiop/ (props changed) Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Thu May 30 21:49:43 2013 (r251162) +++ stable/8/sys/dev/hptiop/hptiop.c Thu May 30 21:50:25 2013 (r251163) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; }