From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 19 04:08:20 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8292D43A; Mon, 19 Nov 2012 04:08:20 +0000 (UTC) (envelope-from eadler@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 674158FC12; Mon, 19 Nov 2012 04:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ48K5I078124; Mon, 19 Nov 2012 04:08:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ48KrU078123; Mon, 19 Nov 2012 04:08:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190408.qAJ48KrU078123@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243258 - stable/7/usr.bin/chpass X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 04:08:20 -0000 Author: eadler Date: Mon Nov 19 04:08:20 2012 New Revision: 243258 URL: http://svnweb.freebsd.org/changeset/base/243258 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/7/usr.bin/chpass/chpass.c Directory Properties: stable/7/usr.bin/chpass/ (props changed) Modified: stable/7/usr.bin/chpass/chpass.c ============================================================================== --- stable/7/usr.bin/chpass/chpass.c Mon Nov 19 04:08:10 2012 (r243257) +++ stable/7/usr.bin/chpass/chpass.c Mon Nov 19 04:08:20 2012 (r243258) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2B4658E; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@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 C80178FC14; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0Vvow024979; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0VvY0024978; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0VvY0024978@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243352 - stable/7/usr.bin/mktemp X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:31:58 -0000 Author: eadler Date: Wed Nov 21 00:31:57 2012 New Revision: 243352 URL: http://svnweb.freebsd.org/changeset/base/243352 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/7/usr.bin/mktemp/mktemp.1 Directory Properties: stable/7/usr.bin/mktemp/ (props changed) Modified: stable/7/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/7/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243351) +++ stable/7/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:57 2012 (r243352) @@ -162,10 +162,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 667F0BD2; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@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 4BB6A8FC1C; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eRG8026890; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eRWm026889; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eRWm026889@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243354 - stable/7/share/man/man7 X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:26 2012 New Revision: 243354 URL: http://svnweb.freebsd.org/changeset/base/243354 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/7/share/man/man7/ports.7 Directory Properties: stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/ports.7 ============================================================================== --- stable/7/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243353) +++ stable/7/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243354) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 21 01:01:19 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CC21381; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) (envelope-from eadler@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 732ED8FC14; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11JU3030973; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11Jr9030972; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11Jr9030972@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243358 - stable/7/sys/dev/uart X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 01:01:19 -0000 Author: eadler Date: Wed Nov 21 01:01:19 2012 New Revision: 243358 URL: http://svnweb.freebsd.org/changeset/base/243358 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/7/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:18 2012 (r243357) +++ stable/7/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:19 2012 (r243358) @@ -76,6 +76,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 22 23:15:39 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6782586B; Thu, 22 Nov 2012 23:15:39 +0000 (UTC) (envelope-from simon@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 47EFA8FC08; Thu, 22 Nov 2012 23:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMNFd3i088463; Thu, 22 Nov 2012 23:15:39 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMNFdcO088458; Thu, 22 Nov 2012 23:15:39 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222315.qAMNFdcO088458@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 23:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243418 - in stable/7: contrib/bind9/bin/named contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns sys/compat/linux X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 23:15:39 -0000 Author: simon Date: Thu Nov 22 23:15:38 2012 New Revision: 243418 URL: http://svnweb.freebsd.org/changeset/base/243418 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. This commit includes stable/7 which was missed in r243417. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/7/contrib/bind9/bin/named/query.c stable/7/contrib/bind9/lib/dns/include/dns/rdata.h stable/7/contrib/bind9/lib/dns/master.c stable/7/contrib/bind9/lib/dns/rdata.c stable/7/sys/compat/linux/linux_ioctl.c Modified: stable/7/contrib/bind9/bin/named/query.c ============================================================================== --- stable/7/contrib/bind9/bin/named/query.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/bin/named/query.c Thu Nov 22 23:15:38 2012 (r243418) @@ -999,13 +999,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - *mnamep = mname; CTRACE("query_isduplicate: false: done"); @@ -1199,6 +1192,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1259,11 +1253,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1302,11 +1298,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1817,6 +1815,7 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { + if (mname != fname) { if (mname != NULL) { /* * A different type of this name is @@ -1833,6 +1832,7 @@ query_addadditional2(void *arg, dns_name mname0 = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: stable/7/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- stable/7/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 23:15:38 2012 (r243418) @@ -127,6 +127,17 @@ struct dns_rdata { #define DNS_RDATA_UPDATE 0x0001 /*%< update pseudo record */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: stable/7/contrib/bind9/lib/dns/master.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/master.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/master.c Thu Nov 22 23:15:38 2012 (r243418) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: stable/7/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/rdata.c Thu Nov 22 23:15:38 2012 (r243418) @@ -403,6 +403,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -433,6 +434,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -440,8 +449,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -576,6 +584,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -648,10 +657,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -758,6 +770,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -772,10 +785,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: stable/7/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/7/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/sys/compat/linux/linux_ioctl.c Thu Nov 22 23:15:38 2012 (r243418) @@ -2207,8 +2207,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); return (error); From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 23 21:29:09 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB71503; Fri, 23 Nov 2012 21:29:09 +0000 (UTC) (envelope-from remko@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 F396F8FC0C; Fri, 23 Nov 2012 21:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANLT8Yc098330; Fri, 23 Nov 2012 21:29:08 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANLT8tX098328; Fri, 23 Nov 2012 21:29:08 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201211232129.qANLT8tX098328@svn.freebsd.org> From: Remko Lodder Date: Fri, 23 Nov 2012 21:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243467 - stable/7/sbin/ifconfig X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 21:29:09 -0000 Author: remko Date: Fri Nov 23 21:29:08 2012 New Revision: 243467 URL: http://svnweb.freebsd.org/changeset/base/243467 Log: MFC r232486 Add an ifconfig carp option that enables users to set the state of the carp cluster. This is a direct commit to stable/9 because -HEAD's code is very different. I discussed this with Gleb and the reason for this is that since we do not touch the kernel itself and are not adding very weird or confusing things, we can commit this to the stable branch directly. The options 'master' and 'backup' are now available, which enables the administrator to force a node into the backup or master state on the cluster. Ofcourse preempt has to be disabled otherwise the master node will become master again. One can do that with: sysctl net.inet.carp.preempt=0 After that one can schedule maintenance on the node normally running as the master and such. PR: 100956 Discussed with: glebius Modified: stable/7/sbin/ifconfig/ifcarp.c stable/7/sbin/ifconfig/ifconfig.8 Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/7/sbin/ifconfig/ifcarp.c Fri Nov 23 21:27:26 2012 (r243466) +++ stable/7/sbin/ifconfig/ifcarp.c Fri Nov 23 21:29:08 2012 (r243467) @@ -57,6 +57,7 @@ void setcarp_advbase(const char *,int, i void setcarp_advskew(const char *, int, int, const struct afswtch *rafp); void setcarp_passwd(const char *, int, int, const struct afswtch *rafp); void setcarp_vhid(const char *, int, int, const struct afswtch *rafp); +void setcarp_state(const char *, int, int, const struct afswtch *rafp); void carp_status(int s) @@ -175,11 +176,34 @@ setcarp_advbase(const char *val, int d, return; } +void setcarp_state(const char *val, int d, int s, const struct afswtch *afp) +{ + struct carpreq carpr; + int i; + + bzero((char *)&carpr, sizeof(struct carpreq)); + ifr.ifr_data = (caddr_t)&carpr; + + if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) + err(1, "SIOCGVH"); + + for (i = 0; i <= CARP_MAXSTATE; i++) { + if (!strcasecmp(val, carp_states[i])) { + carpr.carpr_state = i; + break; + } + } + + if (ioctl(s, SIOCSVH, (caddr_t)&ifr) == -1) + err(1, "SIOCSVH"); +} + static struct cmd carp_cmds[] = { DEF_CMD_ARG("advbase", setcarp_advbase), DEF_CMD_ARG("advskew", setcarp_advskew), DEF_CMD_ARG("pass", setcarp_passwd), DEF_CMD_ARG("vhid", setcarp_vhid), + DEF_CMD_ARG("state", setcarp_state), }; static struct afswtch af_carp = { .af_name = "af_carp", Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:27:26 2012 (r243466) +++ stable/7/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:29:08 2012 (r243467) @@ -1825,6 +1825,13 @@ Set the authentication key to Set the virtual host ID. This is a required setting. Acceptable values are 1 to 255. +.It Cm state Ar state +Force the interface into state +.Ar state . +Valid states are INIT, BACKUP, and MASTER. Note that manually setting the state +to INIT is ignored by +.Xr carp 4 . +This state is set automatically when the underlying interface is down. .El .Pp The From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 24 08:33:28 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 726ECCE4; Sat, 24 Nov 2012 08:33:28 +0000 (UTC) (envelope-from jh@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 5410A8FC0C; Sat, 24 Nov 2012 08:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO8XS3X006123; Sat, 24 Nov 2012 08:33:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO8XSem006122; Sat, 24 Nov 2012 08:33:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211240833.qAO8XSem006122@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 24 Nov 2012 08:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243477 - stable/7/lib/libc/rpc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 08:33:28 -0000 Author: jh Date: Sat Nov 24 08:33:27 2012 New Revision: 243477 URL: http://svnweb.freebsd.org/changeset/base/243477 Log: MFC r235143 by kib: Plug a leak. PR: 167068 Tested by: Oliver Pinter Modified: stable/7/lib/libc/rpc/auth_unix.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/7/lib/libc/rpc/auth_unix.c Sat Nov 24 07:02:31 2012 (r243476) +++ stable/7/lib/libc/rpc/auth_unix.c Sat Nov 24 08:33:27 2012 (r243477) @@ -185,6 +185,7 @@ authunix_create(machname, uid, gid, len, AUTH * authunix_create_default() { + AUTH *auth; int ngids; long ngids_max; char machname[MAXHOSTNAMELEN + 1]; @@ -207,8 +208,10 @@ authunix_create_default() if (ngids > NGRPS) ngids = NGRPS; /* XXX: interface problem; those should all have been unsigned */ - return (authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids)); + auth = authunix_create(machname, (int)uid, (int)gid, ngids, + (int *)gids); + free(gids); + return (auth); } /*