From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 16:20:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FDF5106566B; Fri, 21 Sep 2012 16:20:55 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 603EB8FC0A; Fri, 21 Sep 2012 16:20:55 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.4/8.14.4) with ESMTP id q8LGKps1014464 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 21 Sep 2012 11:20:53 -0500 Received: from [10.0.0.100] (10.14.152.61) by smtp.fisglobal.com (10.132.206.15) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 21 Sep 2012 11:20:05 -0500 MIME-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset="us-ascii" From: Devin Teske In-Reply-To: <20120921113654.GA7865@stack.nl> Date: Fri, 21 Sep 2012 09:19:58 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> <20120921113654.GA7865@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1278) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855, 1.0.431, 0.0.0000 definitions=2012-09-21_01:2012-09-20, 2012-09-21, 1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Devin Teske , src-committers@freebsd.org Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 16:20:55 -0000 On Sep 21, 2012, at 4:36 AM, Jilles Tjoelker wrote: > On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: >> Author: dteske >> Date: Fri Sep 21 01:36:20 2012 >> New Revision: 240770 >> URL: http://svn.freebsd.org/changeset/base/240770 >=20 >> Log: >> Replace redirections to /dev/null with "close file-descriptor" syntax (= >&-). >=20 >> Reviewed by: adrian (co-mentor) >> Approved by: adrian (co-mentor) >=20 >> [snip] >=20 >> Modified: head/usr.sbin/bsdconfig/bsdconfig >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) >> +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) >> @@ -73,7 +73,7 @@ usage() >> # Determine the maximum width of terminal/console >> # >> local max_size max_width >> - max_size=3D$( stty size 2> /dev/null ) >> + max_size=3D$( stty size 2>&- ) >> : ${max_size:=3D"24 80"} >> max_width=3D"${max_size#*[$IFS]}" >> f_dprintf "max_width=3D[$max_width]" >> [snip] >=20 > This change is risky because it may cause error messages to be written > to unexpected files. The first file the utility opens will be fd 2, and > if something decides to write an error message to fd 2 it will try to > write to that file. >=20 > For this reason, the kernel will automatically open /dev/null if you > execute suid/sgid binaries with fd 0, 1 and/or 2 closed. >=20 > Particularly with fd 1 (>&-) there is another danger in that the output > may fail with [EBADF] rather than being silently discarded. This may > cause unexpected failures. >=20 > If the reason is that there may be no /dev/null, then you will have to > change the environment such that there will be a /dev/null. >=20 Jilles and I discussed in IRC and he showed me how I can make /dev/null ava= ilable in the embedded environment that this was needed for. I'm going to make another revision that reverses the changes in SVN r240770= (this change). Thanks Jilles! --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.