From owner-freebsd-rc@FreeBSD.ORG Fri Jun 9 00:59:56 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81DDE16A41A for ; Fri, 9 Jun 2006 00:59:56 +0000 (UTC) (envelope-from dwhite@gumbysoft.com) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4818D43D45 for ; Fri, 9 Jun 2006 00:59:56 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id D0CEF72DA1; Thu, 8 Jun 2006 17:58:29 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id CB9B272D9F; Thu, 8 Jun 2006 17:58:29 -0700 (PDT) Date: Thu, 8 Jun 2006 17:58:29 -0700 (PDT) From: Doug White To: Brooks Davis In-Reply-To: <20060609005422.GA25288@odin.ac.hmc.edu> Message-ID: <20060608175640.R50887@carver.gumbysoft.com> References: <200606082130.k58LUYQO069255@freefall.freebsd.org> <20060609005422.GA25288@odin.ac.hmc.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-rc@freebsd.org Subject: Re: conf/94377 : [patch] /etc/rc.d/sshd improperly tests random dev state X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jun 2006 00:59:56 -0000 On Thu, 8 Jun 2006, Brooks Davis wrote: > On Thu, Jun 08, 2006 at 09:30:34PM +0000, Doug White wrote: >> The following reply was made to PR conf/94377; it has been noted by GNATS. >> >> From: Doug White >> To: Rostislav Krasny >> Cc: Florent Thoumie , Doug White , >> bug-followup@FreeBSD.org >> Subject: Re: conf/94377 : [patch] /etc/rc.d/sshd improperly tests random dev >> state >> Date: Thu, 8 Jun 2006 10:36:05 -0700 (PDT) >> >> On Thu, 8 Jun 2006, Rostislav Krasny wrote: >> >> > I've seen that patch just today, when it is already MFCed. I think it >> > could be simpler. Instead of >> > >> > [ "x${seeded}" != "x" ] && [ ${seeded} -eq 0 ] >> > >> > you can write just >> > >> > [ "${seeded}" = "0" ] >> > >> > and it will be still correct against sysctl failing and returning an >> > empty string. >> >> No, because if ${seeded} is empty, the shell interprets the test as >> >> [ = "0" ] >> >> which results in a syntax error. The 'x' in the first test is significant. > > Not true. The 'x' bit has been unnecessicary 31337 for quite some > time IMO. If you didn't quote ${seeded} then it would be, but > "${variable_that_expands_to_null}" is "". Otherwise -z and -n wouldn't > work. -z and -n are unary operations. They just check if the *have* an argument. = is a comparison operation and requires two operands. If it offends you two that much then file a new PR. I honestly don't give a crap. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org