From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 4 03:01:04 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C7AB4198 for ; Mon, 4 Nov 2013 03:01:04 +0000 (UTC) (envelope-from bounces+73574-4a99-freebsd-hackers=freebsd.org@sendgrid.me) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) by mx1.freebsd.org (Postfix) with SMTP id 57A8B22E1 for ; Mon, 4 Nov 2013 03:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=qN4Z+/O2BmyjCHX8EbbSh9Qqans=; b=CmpgytlF7zScs60FVL 5x9cypTAGmA2cxCMT0R5SkZFHZ9M4NHfnc/vOZI4fYtqKCYGYJOWxhjG7C3oFzMl MUYkx1zmmYDax2FUNPDKL2LBkooSzg6e6lNekMAIfZWw5GMA7kXZhWFlH7qB4lQA zsnEohi6UbjA5uhZoC9yttiTQ= Received: by mf94 with SMTP id mf94.26985.52770DEF1 Mon, 04 Nov 2013 03:01:03 +0000 (GMT) Received: from mail.tarsnap.com (unknown [10.60.208.15]) by mi43 (SG) with ESMTP id 142210e6dc7.7341.22d624 for ; Sun, 03 Nov 2013 21:01:03 -0600 (CST) Received: (qmail 34228 invoked from network); 4 Nov 2013 03:01:01 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 4 Nov 2013 03:01:01 -0000 Received: (qmail 41104 invoked from network); 4 Nov 2013 02:59:27 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 4 Nov 2013 02:59:27 -0000 Message-ID: <52770D8E.2030906@freebsd.org> Date: Sun, 03 Nov 2013 18:59:26 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: Automated submission of kernel panic reports References: <526F8EB3.1040205@freebsd.org> <20131103212950.GA22571@stack.nl> In-Reply-To: <20131103212950.GA22571@stack.nl> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SG-EID: W2XBZA0V/n0voZZ6SjDkgjXvzGvkLIaljy40FLIRIHTVMXCc7ynl2WKQUz0qqp0cdFiRW89jQpnLRxdkpFJNihm/Cpmh/rCB8lfJbn7XaRz3faFO9vOC0rQs1OjTDBwf+4JPFZoaaxX7hkqIdp/XooftDifm5C4phSJ3fYvBef0= Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2013 03:01:04 -0000 On 11/03/13 13:29, Jilles Tjoelker wrote: > Some remarks about panicmail: > >> local tmpfile=`mktemp` || exit 1 > > This kind of thing does not do what you expect. The 'local' utility > returns 0 because it successfully created the local variable, ignoring > the status from the command substitution. Use > local tmpfile > tmpfile=`mktemp` || exit 1 > in both occurrences. Wow, I had no idea. I guess it never occurred to me that 'local' would even *have* an exit status... >> return 0; > > It would be better style to omit the redundant semicolon here (occurs > several times). Yes, that's already fixed (pointed out by dt71). > Some remarks about pkesh: > >> D=`mktemp -d "${TMP:-/tmp}/pkesh.XXXXXX"` > > I think the usual environment variable for the directory for temporary > files is TMPDIR, not TMP. Fixed. > The rest of the script uses $D mostly unquoted, unlike the change that > was made to panicmail. Fixed. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid