From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 16:33:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07DD106564A; Fri, 21 Sep 2012 16:33:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 79AB18FC08; Fri, 21 Sep 2012 16:33:30 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8730569pbb.13 for ; Fri, 21 Sep 2012 09:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3vHi9X2aIfxXG4lJnSHbz3PQV5Xz8jSmdtMzoOgEAVc=; b=SK5/4Nt1ErWsfxfp+l4X6fD4BOt/fqYPnBvc3hB+h6ipTksvbj+QFvELDCNHR6HUMW wiyIOTWQbu0eP0TnkTaGiuBFB+d39UuY98xXv5Rj11DPFepMYVCnd06kXhDWQD0Vu2ua MT1G25VpGD062ES6NfwTR0LjKTW+yZZ3KJqUKhchx8x8hh8pSEW3VrZrLlq2PuIjWjs6 nsc2/tVWR5V3oY5pWJD90wU/cFr1GS91TfUWDH6oJRkEHGbhByty8GGEnl7ztwkQDOtD jtTNrgtBnBu3ElFLp2QBwfGihgwPlwigjRTbv9Zvcvzoo5sKAVMED3jpiKCjOgVNtKtl NXAQ== MIME-Version: 1.0 Received: by 10.68.189.164 with SMTP id gj4mr17039810pbc.48.1348245209928; Fri, 21 Sep 2012 09:33:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.36.106 with HTTP; Fri, 21 Sep 2012 09:33:29 -0700 (PDT) In-Reply-To: <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> <20120921113654.GA7865@stack.nl> <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> Date: Fri, 21 Sep 2012 09:33:29 -0700 X-Google-Sender-Auth: h5A7qsp3HUtSwkPoaZOe8kkdI3o Message-ID: From: Adrian Chadd To: Devin Teske Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker 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 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:33:31 -0000 Sweet. The reversal is approved. Let's rope some sh script people in on the next few commits, just for some feedback? Adrian On 21 September 2012 09:19, Devin Teske wrote: > > 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 >> >>> Log: >>> Replace redirections to /dev/null with "close file-descriptor" syntax = (>&-). >> >>> Reviewed by: adrian (co-mentor) >>> Approved by: adrian (co-mentor) >> >>> [snip] >> >>> 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] >> >> 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. >> >> For this reason, the kernel will automatically open /dev/null if you >> execute suid/sgid binaries with fd 0, 1 and/or 2 closed. >> >> 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. >> >> 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. >> > > Jilles and I discussed in IRC and he showed me how I can make /dev/null a= vailable in the embedded environment that this was needed for. > > I'm going to make another revision that reverses the changes in SVN r2407= 70 (this change). > > Thanks Jilles! > -- > Devin > > _____________ > The information contained in this message is proprietary and/or confident= ial. If you are not the intended recipient, please: (i) delete the message = and all copies; (ii) do not disclose, distribute or use the message in any = manner; and (iii) notify the sender immediately. In addition, please be awa= re that any message addressed to our domain is subject to archiving and rev= iew by persons other than the intended recipient. Thank you.