From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz51n-0003Nk-0z for qemu-devel@nongnu.org; Wed, 18 Nov 2015 10:52:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz51h-0002mv-Bk for qemu-devel@nongnu.org; Wed, 18 Nov 2015 10:52:10 -0500 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=43184 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz51h-0002mn-6P for qemu-devel@nongnu.org; Wed, 18 Nov 2015 10:52:05 -0500 Message-ID: <564C9EA1.8000202@weilnetz.de> Date: Wed, 18 Nov 2015 16:52:01 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1447783185-32019-1-git-send-email-berrange@redhat.com> <564B7ACF.30701@redhat.com> In-Reply-To: <564B7ACF.30701@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] configure: preserve various environment variables in config.status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Peter Maydell , Gerd Hoffmann , "Dr. David Alan Gilbert" Am 17.11.2015 um 20:06 schrieb Eric Blake: > On 11/17/2015 10:59 AM, Daniel P. Berrange wrote: [...] >> +++ b/configure >> @@ -5925,6 +5925,24 @@ cat <config.status >> # Compiler output produced by configure, useful for debugging >> # configure, is in config.log if it exists. >> EOD >> + >> +preserve_env() { >> + envname=$1 >> + >> + if test -n "${!envname}" > Bashism, but configure is /bin/sh. This won't work on dash :( > > I think you'll have to use eval, and we'll just have to audit that > preserve_env can never be called with suspicious text where eval would > open a security hole. You could also call the function with two arguments ... preserve_env PATH "$PATH" ... and use the 2nd argument in the test.