From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 13 15:59:21 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2E8106566B; Mon, 13 Jun 2011 15:59:21 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CBE38FC0A; Mon, 13 Jun 2011 15:59:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DFxLBM089188; Mon, 13 Jun 2011 15:59:21 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DFxLrR089186; Mon, 13 Jun 2011 15:59:21 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201106131559.p5DFxLrR089186@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 13 Jun 2011 15:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223051 - stable/7/cddl/compat/opensolaris/misc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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, 13 Jun 2011 15:59:21 -0000 Author: jh Date: Mon Jun 13 15:59:21 2011 New Revision: 223051 URL: http://svn.freebsd.org/changeset/base/223051 Log: MFC r221390: Don't pass empty mount options to nmount(2). Modified: stable/7/cddl/compat/opensolaris/misc/zmount.c Directory Properties: stable/7/cddl/compat/opensolaris/ (props changed) Modified: stable/7/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/zmount.c Mon Jun 13 15:53:56 2011 (r223050) +++ stable/7/cddl/compat/opensolaris/misc/zmount.c Mon Jun 13 15:59:21 2011 (r223051) @@ -95,8 +95,10 @@ zmount(const char *spec, const char *dir build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir), (size_t)-1); build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1); - for (p = optstr; p != NULL; strsep(&p, ",/ ")) - build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); + for (p = optstr; p != NULL; strsep(&p, ",/ ")) { + if (*p != '\0') + build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); + } rv = nmount(iov, iovlen, 0); free(optstr); return (rv); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 14 10:50:17 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 606041065673; Tue, 14 Jun 2011 10:50:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 368228FC16; Tue, 14 Jun 2011 10:50:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EAoHX4031331; Tue, 14 Jun 2011 10:50:17 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EAoHus031329; Tue, 14 Jun 2011 10:50:17 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201106141050.p5EAoHus031329@svn.freebsd.org> From: Glen Barber Date: Tue, 14 Jun 2011 10:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223076 - stable/7/sbin/geom/class/eli X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Jun 2011 10:50:17 -0000 Author: gjb (doc committer) Date: Tue Jun 14 10:50:16 2011 New Revision: 223076 URL: http://svn.freebsd.org/changeset/base/223076 Log: MFC 216147 [1], 219424 [2]: 216147 by delphij [1]: - Recommend a overwrite of whole geli provider before use. 219424 by pjd [2]: - Change example wording. PR: 155385 [2] Modified: stable/7/sbin/geom/class/eli/geli.8 Directory Properties: stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/journal/ (props changed) stable/7/sbin/geom/class/label/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/class/stripe/ (props changed) stable/7/sbin/geom/misc/ (props changed) Modified: stable/7/sbin/geom/class/eli/geli.8 ============================================================================== --- stable/7/sbin/geom/class/eli/geli.8 Tue Jun 14 10:50:01 2011 (r223075) +++ stable/7/sbin/geom/class/eli/geli.8 Tue Jun 14 10:50:16 2011 (r223076) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2006 +.Dd March 9, 2011 .Dt GELI 8 .Os .Sh NAME @@ -543,15 +543,17 @@ Enter passphrase: .Ed .Pp Create an encrypted provider, but use two keys: -one for your girlfriend and one for -you (so there will be no tragedy if she forgets her passphrase): +one for your employee and one for you as company's security officer +(so there is no tragedy if the employee +.Qq accidentally +forgets his passphrase): .Bd -literal -offset indent # geli init /dev/da2 -Enter new passphrase: (enter your passphrase) +Enter new passphrase: (enter security officer passphrase) Reenter new passphrase: # geli setkey -n 1 /dev/da2 -Enter passphrase: (enter your passphrase) -Enter new passphrase: (let your girlfriend enter her passphrase ...) +Enter passphrase: (enter security officer passphrase) +Enter new passphrase: (let your employee enter his passphrase ...) Reenter new passphrase: (... twice) .Ed .Pp @@ -643,6 +645,10 @@ changes with the data he owns without no In other words .Nm will not protect your data against replay attacks. +.Pp +It is recommended to write the whole provider before the first use, +in order to make sure that all sectors and their corresponding +checksums are properly initialized into a consistent state. .Sh SEE ALSO .Xr crypto 4 , .Xr gbde 4 , From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 14 18:54:42 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDBE310657D2; Tue, 14 Jun 2011 18:54:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDF368FC17; Tue, 14 Jun 2011 18:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EIsgKZ047402; Tue, 14 Jun 2011 18:54:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EIsgPK047400; Tue, 14 Jun 2011 18:54:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106141854.p5EIsgPK047400@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jun 2011 18:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223093 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Jun 2011 18:54:42 -0000 Author: jhb Date: Tue Jun 14 18:54:42 2011 New Revision: 223093 URL: http://svn.freebsd.org/changeset/base/223093 Log: MFC 222750: Clear the device_t pointer in 'struct resource' when releasing a device as otherwise the sysctl to export rman info can dereference a stale pointer. Modified: stable/7/sys/kern/subr_rman.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/subr_rman.c ============================================================================== --- stable/7/sys/kern/subr_rman.c Tue Jun 14 18:54:31 2011 (r223092) +++ stable/7/sys/kern/subr_rman.c Tue Jun 14 18:54:42 2011 (r223093) @@ -677,6 +677,7 @@ int_rman_release_resource(struct rman *r * without freeing anything. */ r->r_flags &= ~RF_ALLOCATED; + r->r_dev = NULL; return 0; } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 14 22:37:10 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 385E8106564A; Tue, 14 Jun 2011 22:37:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 289BD8FC1F; Tue, 14 Jun 2011 22:37:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EMbAF3054388; Tue, 14 Jun 2011 22:37:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EMbAKu054386; Tue, 14 Jun 2011 22:37:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201106142237.p5EMbAKu054386@svn.freebsd.org> From: Glen Barber Date: Tue, 14 Jun 2011 22:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223100 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Jun 2011 22:37:10 -0000 Author: gjb (doc committer) Date: Tue Jun 14 22:37:09 2011 New Revision: 223100 URL: http://svn.freebsd.org/changeset/base/223100 Log: MFC 187066 by trhodes: Quote the "u" as it's the name of the union, this may prevent some confusion when reading the manual page. PR: 117798 Modified: stable/7/share/man/man4/sysmouse.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/sysmouse.4 ============================================================================== --- stable/7/share/man/man4/sysmouse.4 Tue Jun 14 21:37:25 2011 (r223099) +++ stable/7/share/man/man4/sysmouse.4 Tue Jun 14 22:37:09 2011 (r223100) @@ -385,7 +385,7 @@ They are intended to replace functions p .Dv MOUSE_ACTION alone. .Pp -.It Dv u +.It Dv Sq u This union is one of .Pp .Bl -tag -width data -compact From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 14 22:40:13 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B08BF106567A; Tue, 14 Jun 2011 22:40:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A103D8FC14; Tue, 14 Jun 2011 22:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EMeDX2054502; Tue, 14 Jun 2011 22:40:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EMeDGm054500; Tue, 14 Jun 2011 22:40:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201106142240.p5EMeDGm054500@svn.freebsd.org> From: Glen Barber Date: Tue, 14 Jun 2011 22:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223101 - stable/7/usr.bin/split X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Jun 2011 22:40:13 -0000 Author: gjb (doc committer) Date: Tue Jun 14 22:40:13 2011 New Revision: 223101 URL: http://svn.freebsd.org/changeset/base/223101 Log: MFC 187663 by trhodes: When "-b" is specified, one could easily create "smaller" files that are much larger than expected (given the default size). Change "smaller files" to "split files" which is more in line with what "-b" actually does. PR: 119329 Modified: stable/7/usr.bin/split/split.1 Directory Properties: stable/7/usr.bin/split/ (props changed) Modified: stable/7/usr.bin/split/split.1 ============================================================================== --- stable/7/usr.bin/split/split.1 Tue Jun 14 22:37:09 2011 (r223100) +++ stable/7/usr.bin/split/split.1 Tue Jun 14 22:40:13 2011 (r223101) @@ -32,7 +32,7 @@ .\" @(#)split.1 8.3 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd August 10, 2006 +.Dd January 23, 2009 .Dt SPLIT 1 .Os .Sh NAME @@ -84,7 +84,7 @@ letters to form the suffix of the file n .Cm K | k | M | m | G | g .Sm on .Oc -Create smaller files +Create split files .Ar byte_count bytes in length. If @@ -109,7 +109,7 @@ is appended to the number, the file is s .Ar byte_count gigabyte pieces. .It Fl l Ar line_count -Create smaller files +Create split files .Ar line_count lines in length. .It Fl p Ar pattern From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 14 22:52:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DAE11065678; Tue, 14 Jun 2011 22:52:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F20548FC2B; Tue, 14 Jun 2011 22:52:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EMqOBt054942; Tue, 14 Jun 2011 22:52:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EMqO91054940; Tue, 14 Jun 2011 22:52:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201106142252.p5EMqO91054940@svn.freebsd.org> From: Glen Barber Date: Tue, 14 Jun 2011 22:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223102 - stable/7/bin/chmod X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Jun 2011 22:52:25 -0000 Author: gjb (doc committer) Date: Tue Jun 14 22:52:24 2011 New Revision: 223102 URL: http://svn.freebsd.org/changeset/base/223102 Log: MFC 187627 by trhodes: Note the implication of setting the 'w' permission on directories, while here, expand the 'naughty bits' comment in BUGS. PR: 84268 Modified: stable/7/bin/chmod/chmod.1 Directory Properties: stable/7/bin/chmod/ (props changed) Modified: stable/7/bin/chmod/chmod.1 ============================================================================== --- stable/7/bin/chmod/chmod.1 Tue Jun 14 22:40:13 2011 (r223101) +++ stable/7/bin/chmod/chmod.1 Tue Jun 14 22:52:24 2011 (r223102) @@ -32,7 +32,7 @@ .\" @(#)chmod.1 8.4 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd December 22, 2006 +.Dd January 23, 2009 .Dt CHMOD 1 .Os .Sh NAME @@ -281,6 +281,10 @@ Operations upon the other permissions on ``o'' by itself), in combination with the .Ar perm symbols ``s'' or ``t'', are ignored. +.Pp +The ``w'' permission on directories will permit file creation, relocation, +and copy into that directory. +Files created within the directory itself will inherit its group ID. .Sh EXAMPLES .Bl -tag -width "u=rwx,go=u-w" -compact .It Li 644 @@ -343,4 +347,5 @@ command appeared in .Sh BUGS There is no .Ar perm -option for the naughty bits. +option for the naughty bits which are ``S'' and +``T'' respectively. From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 14 23:30:48 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 877F61065672; Tue, 14 Jun 2011 23:30:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 777918FC0C; Tue, 14 Jun 2011 23:30:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ENUmO7056177; Tue, 14 Jun 2011 23:30:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ENUm3l056175; Tue, 14 Jun 2011 23:30:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201106142330.p5ENUm3l056175@svn.freebsd.org> From: Glen Barber Date: Tue, 14 Jun 2011 23:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223103 - stable/7/share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Jun 2011 23:30:48 -0000 Author: gjb (doc committer) Date: Tue Jun 14 23:30:48 2011 New Revision: 223103 URL: http://svn.freebsd.org/changeset/base/223103 Log: MFC 186445 by trhodes: Netgroup database can be centralized via NIS, list it. Add a missing comma and bump doc date. PR: 127602 Modified: stable/7/share/man/man5/nsswitch.conf.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/nsswitch.conf.5 ============================================================================== --- stable/7/share/man/man5/nsswitch.conf.5 Tue Jun 14 22:52:24 2011 (r223102) +++ stable/7/share/man/man5/nsswitch.conf.5 Tue Jun 14 23:30:48 2011 (r223103) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2007 +.Dd December 23, 2008 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -141,9 +141,13 @@ The following databases are used by the .Xr getrpcbynumber 3 , .Xr getrpcent 3 .It proto -.Xr getprotobyname 3 +.Xr getprotobyname 3 , .Xr getprotobynumber 3 , .Xr getprotoent 3 +.It netgroup +.Xr getnetgrent 3 , +.Xr setnetgrent 3 , +.Xr innetgr 3 .El .Ss Status codes The following status codes are available: From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 15 01:08:48 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43455106566B; Wed, 15 Jun 2011 01:08:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331358FC0A; Wed, 15 Jun 2011 01:08:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5F18mg5059122; Wed, 15 Jun 2011 01:08:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5F18mFE059120; Wed, 15 Jun 2011 01:08:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201106150108.p5F18mFE059120@svn.freebsd.org> From: Glen Barber Date: Wed, 15 Jun 2011 01:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223104 - stable/7/usr.bin/gprof X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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, 15 Jun 2011 01:08:48 -0000 Author: gjb (doc committer) Date: Wed Jun 15 01:08:47 2011 New Revision: 223104 URL: http://svn.freebsd.org/changeset/base/223104 Log: MFC 186487 by trhodes: Remove reference to unimplemented "-c" option. PR: 119338 Modified: stable/7/usr.bin/gprof/gprof.1 Directory Properties: stable/7/usr.bin/gprof/ (props changed) Modified: stable/7/usr.bin/gprof/gprof.1 ============================================================================== --- stable/7/usr.bin/gprof/gprof.1 Tue Jun 14 23:30:48 2011 (r223103) +++ stable/7/usr.bin/gprof/gprof.1 Wed Jun 15 01:08:47 2011 (r223104) @@ -32,7 +32,7 @@ .\" @(#)gprof.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd October 7, 2005 +.Dd December 25, 2008 .Dt GPROF 1 .Os .Sh NAME @@ -263,9 +263,6 @@ inside other functions. .It Fl z Display routines that have zero usage (as shown by call counts and accumulated time). -This is useful with the -.Fl c -option for discovering which routines were never called. .El .Sh FILES .Bl -tag -width a.out.gmon -compact From owner-svn-src-stable-7@FreeBSD.ORG Sat Jun 18 05:13:48 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C82291065672; Sat, 18 Jun 2011 05:13:48 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7FA28FC08; Sat, 18 Jun 2011 05:13:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I5DmpY023338; Sat, 18 Jun 2011 05:13:48 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I5DmQ5023336; Sat, 18 Jun 2011 05:13:48 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201106180513.p5I5DmQ5023336@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 18 Jun 2011 05:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223221 - stable/7/lib/libgeom X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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, 18 Jun 2011 05:13:48 -0000 Author: jh Date: Sat Jun 18 05:13:48 2011 New Revision: 223221 URL: http://svn.freebsd.org/changeset/base/223221 Log: MFC r216177: Remove stale link. PR: 151252 Modified: stable/7/lib/libgeom/libgeom.3 Directory Properties: stable/7/lib/libgeom/ (props changed) Modified: stable/7/lib/libgeom/libgeom.3 ============================================================================== --- stable/7/lib/libgeom/libgeom.3 Sat Jun 18 05:12:54 2011 (r223220) +++ stable/7/lib/libgeom/libgeom.3 Sat Jun 18 05:13:48 2011 (r223221) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2007 +.Dd December 4, 2010 .Dt LIBGEOM 3 .Os .Sh NAME @@ -345,8 +345,6 @@ if (errstr != NULL) err(1, "could not destroy ccd: %s", errstr); gctl_free(H); .Ed -.Sh SEE ALSO -.Pa http://ezine.daemonnews.org/200308/blueprints.html .Sh HISTORY The .Nm geom From owner-svn-src-stable-7@FreeBSD.ORG Sat Jun 18 22:09:44 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B76781065674; Sat, 18 Jun 2011 22:09:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A650F8FC18; Sat, 18 Jun 2011 22:09:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IM9iti059108; Sat, 18 Jun 2011 22:09:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IM9i45059105; Sat, 18 Jun 2011 22:09:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106182209.p5IM9i45059105@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 22:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223273 - in stable/7/sys: netinet netinet6 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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, 18 Jun 2011 22:09:44 -0000 Author: bz Date: Sat Jun 18 22:09:44 2011 New Revision: 223273 URL: http://svn.freebsd.org/changeset/base/223273 Log: MFC r222272: Add FEATURE() definitions for IPv4 and IPv6 so that we can use feature_present(3) to dynamically decide whether to use one or the other family. Modified: stable/7/sys/netinet/in_proto.c stable/7/sys/netinet6/in6_proto.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/in_proto.c ============================================================================== --- stable/7/sys/netinet/in_proto.c Sat Jun 18 22:09:22 2011 (r223272) +++ stable/7/sys/netinet/in_proto.c Sat Jun 18 22:09:44 2011 (r223273) @@ -91,6 +91,8 @@ static struct pr_usrreqs nousrreqs; #include #endif +FEATURE(inet, "Internet Protocol version 4"); + extern struct domain inetdomain; /* Spacer for loadable protocols. */ Modified: stable/7/sys/netinet6/in6_proto.c ============================================================================== --- stable/7/sys/netinet6/in6_proto.c Sat Jun 18 22:09:22 2011 (r223272) +++ stable/7/sys/netinet6/in6_proto.c Sat Jun 18 22:09:44 2011 (r223273) @@ -127,6 +127,7 @@ __FBSDID("$FreeBSD$"); /* * TCP/IP protocol family: IP6, ICMP6, UDP, TCP. */ +FEATURE(inet6, "Internet Protocol version 6"); extern struct domain inet6domain; static struct pr_usrreqs nousrreqs; From owner-svn-src-stable-7@FreeBSD.ORG Sat Jun 18 22:12:54 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137AF106566C; Sat, 18 Jun 2011 22:12:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012638FC17; Sat, 18 Jun 2011 22:12:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IMCrlk059360; Sat, 18 Jun 2011 22:12:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IMCref059352; Sat, 18 Jun 2011 22:12:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106182212.p5IMCref059352@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 22:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223275 - stable/7/usr.sbin/mfiutil X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 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, 18 Jun 2011 22:12:54 -0000 Author: bz Date: Sat Jun 18 22:12:53 2011 New Revision: 223275 URL: http://svn.freebsd.org/changeset/base/223275 Log: MFC r219722 (by jhb): Preserve errno in an error case. Submitted by: gcooper MFC r222899: Contrary to when returning in all-good cases at the end of functions we did not free memory (1) or close the file descriptor (2) in error cases. Reported by: Mark Johnston (1) Reported by: attilio (2) Reviewed by: jhb Sponsored by: Sandvine Incorporated Modified: stable/7/usr.sbin/mfiutil/mfi_config.c stable/7/usr.sbin/mfiutil/mfi_drive.c stable/7/usr.sbin/mfiutil/mfi_evt.c stable/7/usr.sbin/mfiutil/mfi_flash.c stable/7/usr.sbin/mfiutil/mfi_patrol.c stable/7/usr.sbin/mfiutil/mfi_show.c stable/7/usr.sbin/mfiutil/mfi_volume.c Directory Properties: stable/7/usr.sbin/mfiutil/ (props changed) Modified: stable/7/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_config.c Sat Jun 18 22:12:17 2011 (r223274) +++ stable/7/usr.sbin/mfiutil/mfi_config.c Sat Jun 18 22:12:53 2011 (r223275) @@ -85,6 +85,7 @@ mfi_config_read(int fd, struct mfi_confi { struct mfi_config_data *config; uint32_t config_size; + int error; /* * Keep fetching the config in a loop until we have a large enough @@ -97,8 +98,12 @@ fetch: if (config == NULL) return (-1); if (mfi_dcmd_command(fd, MFI_DCMD_CFG_READ, config, - config_size, NULL, 0, NULL) < 0) + config_size, NULL, 0, NULL) < 0) { + error = errno; + free(config); + errno = error; return (-1); + } if (config->size > config_size) { config_size = config->size; @@ -162,12 +167,14 @@ clear_config(int ac, char **av) if (!mfi_reconfig_supported()) { warnx("The current mfi(4) driver does not support " "configuration changes."); + close(fd); return (EOPNOTSUPP); } if (mfi_ld_get_list(fd, &list, NULL) < 0) { error = errno; warn("Failed to get volume list"); + close(fd); return (error); } @@ -175,6 +182,7 @@ clear_config(int ac, char **av) if (mfi_volume_busy(fd, list.ld_list[i].ld.v.target_id)) { warnx("Volume %s is busy and cannot be deleted", mfi_volume_name(fd, list.ld_list[i].ld.v.target_id)); + close(fd); return (EBUSY); } } @@ -185,12 +193,14 @@ clear_config(int ac, char **av) ch = getchar(); if (ch != 'y' && ch != 'Y') { printf("\nAborting\n"); + close(fd); return (0); } if (mfi_dcmd_command(fd, MFI_DCMD_CFG_CLEAR, NULL, 0, NULL, 0, NULL) < 0) { error = errno; warn("Failed to clear configuration"); + close(fd); return (error); } @@ -336,17 +346,21 @@ parse_array(int fd, int raid_type, char for (pinfo = info->drives; (cp = strsep(&array_str, ",")) != NULL; pinfo++) { error = mfi_lookup_drive(fd, cp, &device_id); - if (error) + if (error) { + free(info->drives); return (error); + } if (mfi_pd_get_info(fd, device_id, pinfo, NULL) < 0) { error = errno; warn("Failed to fetch drive info for drive %s", cp); + free(info->drives); return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); + free(info->drives); return (EINVAL); } } @@ -551,7 +565,12 @@ create_volume(int ac, char **av) return (EINVAL); } - + bzero(&state, sizeof(state)); + config = NULL; + arrays = NULL; + narrays = 0; + error = 0; + fd = mfi_open(mfi_unit); if (fd < 0) { error = errno; @@ -562,7 +581,8 @@ create_volume(int ac, char **av) if (!mfi_reconfig_supported()) { warnx("The current mfi(4) driver does not support " "configuration changes."); - return (EOPNOTSUPP); + error = EOPNOTSUPP; + goto error; } /* Lookup the RAID type first. */ @@ -575,7 +595,8 @@ create_volume(int ac, char **av) if (raid_type == -1) { warnx("Unknown or unsupported volume type %s", av[1]); - return (EINVAL); + error = EINVAL; + goto error; } /* Parse any options. */ @@ -603,7 +624,8 @@ create_volume(int ac, char **av) break; case '?': default: - return (EINVAL); + error = EINVAL; + goto error; } } ac -= optind; @@ -613,7 +635,8 @@ create_volume(int ac, char **av) narrays = ac; if (narrays == 0) { warnx("At least one drive list is required"); - return (EINVAL); + error = EINVAL; + goto error; } switch (raid_type) { case RT_RAID0: @@ -623,7 +646,8 @@ create_volume(int ac, char **av) case RT_CONCAT: if (narrays != 1) { warnx("Only one drive list can be specified"); - return (EINVAL); + error = EINVAL; + goto error; } break; case RT_RAID10: @@ -632,24 +656,27 @@ create_volume(int ac, char **av) if (narrays < 1) { warnx("RAID10, RAID50, and RAID60 require at least " "two drive lists"); - return (EINVAL); + error = EINVAL; + goto error; } if (narrays > MFI_MAX_SPAN_DEPTH) { warnx("Volume spans more than %d arrays", MFI_MAX_SPAN_DEPTH); - return (EINVAL); + error = EINVAL; + goto error; } break; } arrays = calloc(narrays, sizeof(*arrays)); if (arrays == NULL) { warnx("malloc failed"); - return (ENOMEM); + error = ENOMEM; + goto error; } for (i = 0; i < narrays; i++) { error = parse_array(fd, raid_type, av[i], &arrays[i]); if (error) - return (error); + goto error; } switch (raid_type) { @@ -660,7 +687,8 @@ create_volume(int ac, char **av) if (arrays[i].drive_count != arrays[0].drive_count) { warnx("All arrays must contain the same " "number of drives"); - return (EINVAL); + error = EINVAL; + goto error; } } break; @@ -673,7 +701,7 @@ create_volume(int ac, char **av) if (mfi_config_read(fd, &config) < 0) { error = errno; warn("Failed to read configuration"); - return (error); + goto error; } p = (char *)config->array; state.array_ref = 0xffff; @@ -683,7 +711,8 @@ create_volume(int ac, char **av) state.arrays = calloc(config->array_count, sizeof(int)); if (state.arrays == NULL) { warnx("malloc failed"); - return (ENOMEM); + error = ENOMEM; + goto error; } for (i = 0; i < config->array_count; i++) { ar = (struct mfi_array *)p; @@ -699,7 +728,8 @@ create_volume(int ac, char **av) state.volumes = calloc(config->log_drv_count, sizeof(int)); if (state.volumes == NULL) { warnx("malloc failed"); - return (ENOMEM); + error = ENOMEM; + goto error; } for (i = 0; i < config->log_drv_count; i++) { ld = (struct mfi_ld_config *)p; @@ -739,7 +769,8 @@ create_volume(int ac, char **av) config = calloc(1, config_size); if (config == NULL) { warnx("malloc failed"); - return (ENOMEM); + error = ENOMEM; + goto error; } config->size = config_size; config->array_count = narrays; @@ -776,21 +807,20 @@ create_volume(int ac, char **av) NULL, 0, NULL) < 0) { error = errno; warn("Failed to add volume"); - return (error); + /* FALLTHROUGH */ } +error: /* Clean up. */ free(config); - if (state.log_drv_count > 0) - free(state.volumes); - if (state.array_count > 0) - free(state.arrays); + free(state.volumes); + free(state.arrays); for (i = 0; i < narrays; i++) free(arrays[i].drives); free(arrays); close(fd); - return (0); + return (error); } MFI_COMMAND(top, create, create_volume); @@ -831,24 +861,28 @@ delete_volume(int ac, char **av) if (!mfi_reconfig_supported()) { warnx("The current mfi(4) driver does not support " "configuration changes."); + close(fd); return (EOPNOTSUPP); } if (mfi_lookup_volume(fd, av[1], &target_id) < 0) { error = errno; warn("Invalid volume %s", av[1]); + close(fd); return (error); } if (mfi_ld_get_info(fd, target_id, &info, NULL) < 0) { error = errno; warn("Failed to get info for volume %d", target_id); + close(fd); return (error); } if (mfi_volume_busy(fd, target_id)) { warnx("Volume %s is busy and cannot be deleted", mfi_volume_name(fd, target_id)); + close(fd); return (EBUSY); } @@ -857,6 +891,7 @@ delete_volume(int ac, char **av) sizeof(mbox), NULL) < 0) { error = errno; warn("Failed to delete volume"); + close(fd); return (error); } @@ -891,40 +926,44 @@ add_spare(int ac, char **av) return (error); } + config = NULL; + spare = NULL; error = mfi_lookup_drive(fd, av[1], &device_id); if (error) - return (error); + goto error; if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch drive info"); - return (error); + goto error; } if (info.fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); - return (EINVAL); + error = EINVAL; + goto error; } if (ac > 2) { if (mfi_lookup_volume(fd, av[2], &target_id) < 0) { error = errno; warn("Invalid volume %s", av[2]); - return (error); + goto error; } } if (mfi_config_read(fd, &config) < 0) { error = errno; warn("Failed to read configuration"); - return (error); + goto error; } spare = malloc(sizeof(struct mfi_spare) + sizeof(uint16_t) * config->array_count); if (spare == NULL) { warnx("malloc failed"); - return (ENOMEM); + error = ENOMEM; + goto error; } bzero(spare, sizeof(struct mfi_spare)); spare->ref = info.ref; @@ -937,7 +976,8 @@ add_spare(int ac, char **av) if (ar->size > info.coerced_size) { warnx("Spare isn't large enough for array %u", ar->array_ref); - return (EINVAL); + error = EINVAL; + goto error; } p += config->array_size; } @@ -950,7 +990,8 @@ add_spare(int ac, char **av) ld = mfi_config_lookup_volume(config, target_id); if (ld == NULL) { warnx("Did not find volume %d", target_id); - return (EINVAL); + error = EINVAL; + goto error; } spare->spare_type |= MFI_SPARE_DEDICATED; @@ -960,29 +1001,33 @@ add_spare(int ac, char **av) ld->span[i].array_ref); if (ar == NULL) { warnx("Missing array; inconsistent config?"); - return (ENXIO); + error = ENXIO; + goto error; } if (ar->size > info.coerced_size) { warnx("Spare isn't large enough for array %u", ar->array_ref); - return (EINVAL); + error = EINVAL; + goto error; } spare->array_ref[i] = ar->array_ref; } } - free(config); if (mfi_dcmd_command(fd, MFI_DCMD_CFG_MAKE_SPARE, spare, sizeof(struct mfi_spare) + sizeof(uint16_t) * spare->array_count, NULL, 0, NULL) < 0) { error = errno; warn("Failed to assign spare"); - return (error); + /* FALLTHROUGH. */ } +error: + free(spare); + free(config); close(fd); - return (0); + return (error); } MFI_COMMAND(top, add, add_spare); @@ -1007,18 +1052,22 @@ remove_spare(int ac, char **av) } error = mfi_lookup_drive(fd, av[1], &device_id); - if (error) + if (error) { + close(fd); return (error); + } /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch info for drive %u", device_id); + close(fd); return (error); } if (info.fw_state != MFI_PD_STATE_HOT_SPARE) { warnx("Drive %u is not a hot spare", device_id); + close(fd); return (EINVAL); } @@ -1027,6 +1076,7 @@ remove_spare(int ac, char **av) sizeof(mbox), NULL) < 0) { error = errno; warn("Failed to delete spare"); + close(fd); return (error); } @@ -1151,6 +1201,7 @@ debug_config(int ac, char **av) if (mfi_config_read(fd, &config) < 0) { error = errno; warn("Failed to get config"); + close(fd); return (error); } @@ -1190,17 +1241,21 @@ dump(int ac, char **av) warn("Failed to read debug command"); if (error == ENOENT) error = EOPNOTSUPP; + close(fd); return (error); } config = malloc(len); if (config == NULL) { warnx("malloc failed"); + close(fd); return (ENOMEM); } if (sysctlbyname(buf, config, &len, NULL, 0) < 0) { error = errno; warn("Failed to read debug command"); + free(config); + close(fd); return (error); } dump_config(fd, config); Modified: stable/7/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_drive.c Sat Jun 18 22:12:17 2011 (r223274) +++ stable/7/usr.sbin/mfiutil/mfi_drive.c Sat Jun 18 22:12:53 2011 (r223275) @@ -310,19 +310,23 @@ drive_set_state(char *drive, uint16_t ne } error = mfi_lookup_drive(fd, drive, &device_id); - if (error) + if (error) { + close(fd); return (error); + } /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch info for drive %u", device_id); + close(fd); return (error); } /* Try to change the state. */ if (info.fw_state == new_state) { warnx("Drive %u is already in the desired state", device_id); + close(fd); return (EINVAL); } @@ -334,6 +338,7 @@ drive_set_state(char *drive, uint16_t ne error = errno; warn("Failed to set drive %u to %s", device_id, mfi_pdstate(new_state)); + close(fd); return (error); } @@ -406,19 +411,23 @@ start_rebuild(int ac, char **av) } error = mfi_lookup_drive(fd, av[1], &device_id); - if (error) + if (error) { + close(fd); return (error); + } /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch info for drive %u", device_id); + close(fd); return (error); } /* Check the state, must be REBUILD. */ if (info.fw_state != MFI_PD_STATE_REBUILD) { warnx("Drive %d is not in the REBUILD state", device_id); + close(fd); return (EINVAL); } @@ -428,6 +437,7 @@ start_rebuild(int ac, char **av) NULL) < 0) { error = errno; warn("Failed to start rebuild on drive %u", device_id); + close(fd); return (error); } close(fd); @@ -458,19 +468,23 @@ abort_rebuild(int ac, char **av) } error = mfi_lookup_drive(fd, av[1], &device_id); - if (error) + if (error) { + close(fd); return (error); + } /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch info for drive %u", device_id); + close(fd); return (error); } /* Check the state, must be REBUILD. */ if (info.fw_state != MFI_PD_STATE_REBUILD) { warn("Drive %d is not in the REBUILD state", device_id); + close(fd); return (EINVAL); } @@ -480,6 +494,7 @@ abort_rebuild(int ac, char **av) NULL) < 0) { error = errno; warn("Failed to abort rebuild on drive %u", device_id); + close(fd); return (error); } close(fd); @@ -509,13 +524,16 @@ drive_progress(int ac, char **av) } error = mfi_lookup_drive(fd, av[1], &device_id); - if (error) + if (error) { + close(fd); return (error); + } /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch info for drive %u", device_id); + close(fd); return (error); } close(fd); @@ -570,13 +588,16 @@ drive_clear(int ac, char **av) } error = mfi_lookup_drive(fd, av[1], &device_id); - if (error) + if (error) { + close(fd); return (error); + } /* Get the info for this drive. */ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { error = errno; warn("Failed to fetch info for drive %u", device_id); + close(fd); return (error); } @@ -586,6 +607,7 @@ drive_clear(int ac, char **av) warn("Failed to %s clear on drive %u", opcode == MFI_DCMD_PD_CLEAR_START ? "start" : "stop", device_id); + close(fd); return (error); } @@ -626,8 +648,10 @@ drive_locate(int ac, char **av) } error = mfi_lookup_drive(fd, av[1], &device_id); - if (error) + if (error) { + close(fd); return (error); + } mbox_store_device_id(&mbox[0], device_id); @@ -638,6 +662,7 @@ drive_locate(int ac, char **av) warn("Failed to %s locate on drive %u", opcode == MFI_DCMD_PD_LOCATE_START ? "start" : "stop", device_id); + close(fd); return (error); } close(fd); Modified: stable/7/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_evt.c Sat Jun 18 22:12:17 2011 (r223274) +++ stable/7/usr.sbin/mfiutil/mfi_evt.c Sat Jun 18 22:12:53 2011 (r223275) @@ -83,6 +83,7 @@ show_logstate(int ac, char **av) if (mfi_event_get_info(fd, &info, NULL) < 0) { error = errno; warn("Failed to get event log info"); + close(fd); return (error); } @@ -550,6 +551,7 @@ show_events(int ac, char **av) if (mfi_event_get_info(fd, &info, NULL) < 0) { error = errno; warn("Failed to get event log info"); + close(fd); return (error); } @@ -570,6 +572,7 @@ show_events(int ac, char **av) if (parse_class(optarg, &filter.members.class) < 0) { error = errno; warn("Error parsing event class"); + close(fd); return (error); } break; @@ -577,6 +580,7 @@ show_events(int ac, char **av) if (parse_locale(optarg, &filter.members.locale) < 0) { error = errno; warn("Error parsing event locale"); + close(fd); return (error); } break; @@ -584,6 +588,7 @@ show_events(int ac, char **av) val = strtol(optarg, &cp, 0); if (*cp != '\0' || val <= 0) { warnx("Invalid event count"); + close(fd); return (EINVAL); } num_events = val; @@ -593,6 +598,7 @@ show_events(int ac, char **av) break; case '?': default: + close(fd); return (EINVAL); } } @@ -604,28 +610,33 @@ show_events(int ac, char **av) (num_events - 1); if (size > getpagesize()) { warnx("Event count is too high"); + close(fd); return (EINVAL); } /* Handle optional start and stop sequence numbers. */ if (ac > 2) { warnx("show events: extra arguments"); + close(fd); return (EINVAL); } if (ac > 0 && parse_seq(&info, av[0], &start) < 0) { error = errno; warn("Error parsing starting sequence number"); + close(fd); return (error); } if (ac > 1 && parse_seq(&info, av[1], &stop) < 0) { error = errno; warn("Error parsing ending sequence number"); + close(fd); return (error); } list = malloc(size); if (list == NULL) { warnx("malloc failed"); + close(fd); return (ENOMEM); } for (seq = start;;) { @@ -633,6 +644,8 @@ show_events(int ac, char **av) &status) < 0) { error = errno; warn("Failed to fetch events"); + free(list); + close(fd); return (error); } if (status == MFI_STAT_NOT_FOUND) { @@ -642,6 +655,8 @@ show_events(int ac, char **av) } if (status != MFI_STAT_OK) { warnx("Error fetching events: %s", mfi_status(status)); + free(list); + close(fd); return (EIO); } Modified: stable/7/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_flash.c Sat Jun 18 22:12:17 2011 (r223274) +++ stable/7/usr.sbin/mfiutil/mfi_flash.c Sat Jun 18 22:12:53 2011 (r223275) @@ -136,21 +136,25 @@ flash_adapter(int ac, char **av) return (error); } + buf = NULL; + fd = -1; + if (fstat(flash, &sb) < 0) { error = errno; warn("fstat(%s)", av[1]); - return (error); + goto error; } if (sb.st_size % 1024 != 0 || sb.st_size > 0x7fffffff) { warnx("Invalid flash file size"); - return (EINVAL); + error = EINVAL; + goto error; } fd = mfi_open(mfi_unit); if (fd < 0) { error = errno; warn("mfi_open"); - return (error); + goto error; } /* First, ask the firmware to allocate space for the flash file. */ @@ -158,14 +162,16 @@ flash_adapter(int ac, char **av) mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_OPEN, NULL, 0, mbox, 4, &status); if (status != MFI_STAT_OK) { warnx("Failed to alloc flash memory: %s", mfi_status(status)); - return (EIO); + error = EIO; + goto error; } /* Upload the file 64k at a time. */ buf = malloc(FLASH_BUF_SIZE); if (buf == NULL) { warnx("malloc failed"); - return (ENOMEM); + error = ENOMEM; + goto error; } offset = 0; while (sb.st_size > 0) { @@ -174,7 +180,8 @@ flash_adapter(int ac, char **av) warnx("Bad read from flash file"); mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0, NULL, 0, NULL); - return (ENXIO); + error = ENXIO; + goto error; } mbox_store_word(mbox, offset); @@ -184,12 +191,12 @@ flash_adapter(int ac, char **av) warnx("Flash download failed: %s", mfi_status(status)); mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0, NULL, 0, NULL); - return (ENXIO); + error = ENXIO; + goto error; } sb.st_size -= nread; offset += nread; } - close(flash); /* Kick off the flash. */ printf("WARNING: Firmware flash in progress, do not reboot machine... "); @@ -198,12 +205,17 @@ flash_adapter(int ac, char **av) NULL, 0, &status); if (status != MFI_STAT_OK) { printf("failed:\n\t%s\n", mfi_status(status)); - return (ENXIO); + error = ENXIO; + goto error; } printf("finished\n"); error = display_pending_firmware(fd); - close(fd); +error: + free(buf); + if (fd >= 0) + close(fd); + close(flash); return (error); } Modified: stable/7/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_patrol.c Sat Jun 18 22:12:17 2011 (r223274) +++ stable/7/usr.sbin/mfiutil/mfi_patrol.c Sat Jun 18 22:12:53 2011 (r223275) @@ -96,8 +96,10 @@ show_patrol(int ac, char **av) time(&now); mfi_get_time(fd, &at); error = patrol_get_props(fd, &prop); - if (error) + if (error) { + close(fd); return (error); + } printf("Operation Mode: "); switch (prop.op_mode) { case MFI_PR_OPMODE_AUTO: @@ -128,6 +130,7 @@ show_patrol(int ac, char **av) sizeof(status), NULL, 0, NULL) < 0) { error = errno; warn("Failed to get patrol read properties"); + close(fd); return (error); } printf("Runs Completed: %u\n", status.num_iteration); @@ -153,6 +156,7 @@ show_patrol(int ac, char **av) if (mfi_pd_get_list(fd, &list, NULL) < 0) { error = errno; warn("Failed to get drive list"); + close(fd); return (error); } @@ -165,6 +169,8 @@ show_patrol(int ac, char **av) error = errno; warn("Failed to fetch info for drive %u", list->addr[i].device_id); + free(list); + close(fd); return (error); } if (info.prog_info.active & MFI_PD_PROGRESS_PATROL) { @@ -174,6 +180,7 @@ show_patrol(int ac, char **av) &info.prog_info.patrol); } } + free(list); } close(fd); @@ -198,6 +205,7 @@ start_patrol(int ac, char **av) 0) { error = errno; warn("Failed to start patrol read"); + close(fd); return (error); } @@ -223,6 +231,7 @@ stop_patrol(int ac, char **av) 0) { error = errno; warn("Failed to stop patrol read"); + close(fd); return (error); } @@ -290,8 +299,10 @@ patrol_config(int ac, char **av) } error = patrol_get_props(fd, &prop); - if (error) + if (error) { + close(fd); return (error); + } prop.op_mode = op_mode; if (op_mode == MFI_PR_OPMODE_AUTO) { if (ac > 2) @@ -299,8 +310,10 @@ patrol_config(int ac, char **av) if (ac > 3) { time(&now); mfi_get_time(fd, &at); - if (at == 0) + if (at == 0) { + close(fd); return (ENXIO); + } prop.next_exec = at + next_exec; printf("Starting next patrol read at %s", adapter_time(now, at, prop.next_exec)); @@ -310,6 +323,7 @@ patrol_config(int ac, char **av) sizeof(prop), NULL, 0, NULL) < 0) { error = errno; warn("Failed to set patrol read properties"); + close(fd); return (error); } Modified: stable/7/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_show.c Sat Jun 18 22:12:17 2011 (r223274) +++ stable/7/usr.sbin/mfiutil/mfi_show.c Sat Jun 18 22:12:53 2011 (r223275) @@ -71,6 +71,7 @@ show_adapter(int ac, char **av) if (mfi_ctrl_get_info(fd, &info, NULL) < 0) { error = errno; warn("Failed to get controller info"); + close(fd); return (error); } printf("mfi%d Adapter:\n", mfi_unit); @@ -158,10 +159,12 @@ show_battery(int ac, char **av) sizeof(cap), NULL, 0, &status) < 0) { if (status == MFI_STAT_NO_HW_PRESENT) { printf("mfi%d: No battery present\n", mfi_unit); + close(fd); return (0); } error = errno; warn("Failed to get capacity info"); + close(fd); return (error); } @@ -169,13 +172,16 @@ show_battery(int ac, char **av) sizeof(design), NULL, 0, NULL) < 0) { error = errno; warn("Failed to get design info"); + close(fd); return (error); } if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat), NULL, 0, NULL) < 0) { + error = errno; warn("Failed to get status"); - return (errno); + close(fd); + return (error); } printf("mfi%d: Battery State:\n", mfi_unit); @@ -307,6 +313,7 @@ show_config(int ac, char **av) if (mfi_config_read(fd, &config) < 0) { error = errno; warn("Failed to get config"); + close(fd); return (error); } @@ -375,6 +382,7 @@ show_config(int ac, char **av) printf("\n"); p += config->spares_size; } + free(config); close(fd); return (0); @@ -405,6 +413,7 @@ show_volumes(int ac, char **av) if (mfi_ld_get_list(fd, &list, NULL) < 0) { error = errno; warn("Failed to get volume list"); + close(fd); return (error); } @@ -430,6 +439,7 @@ show_volumes(int ac, char **av) error = errno; warn("Failed to get info for volume %d", list.ld_list[i].ld.v.target_id); + close(fd); return (error); } printf("%6s ", @@ -482,10 +492,11 @@ show_drives(int ac, char **av) return (error); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***