From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST v6 01/24] TestSupport: Add helper to fetch a URL on a host Date: Tue, 12 May 2015 16:17:24 +0100 Message-ID: <1431443844.8263.177.camel@citrix.com> References: <1430905605.2660.187.camel@citrix.com> <1430906213-30108-1-git-send-email-ian.campbell@citrix.com> <21842.6014.310276.267459@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21842.6014.310276.267459@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2015-05-12 at 16:08 +0100, Ian Jackson wrote: > Ian Campbell writes ("[OSSTEST v6 01/24] TestSupport: Add helper to fetch a URL on a host"): > > Signed-off-by: Ian Campbell > > > +sub target_fetchurl($$$;$) { > > + my ($ho, $url, $path, $timeo) = @_; > > + $timeo ||= 2000; > > + my $useproxy = "export http_proxy=$c{HttpProxy};" if $c{HttpProxy}; > > + target_cmd_root($ho, "$useproxy wget --progress=dot:mega -O $path $url", $timeo); > > Do we care that this will break badly if the url contains shell > metacharacters ? I think we may do. I agree. Is adding \" around the $url is all which is needed there, or are there enough layers of quoting that it is more complicated than that? Ian.