Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 10811 invoked from network); 23 Jun 2004 21:15:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jun 2004 21:15:15 -0000 Received: (qmail 34955 invoked by uid 500); 23 Jun 2004 21:15:38 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 34830 invoked by uid 500); 23 Jun 2004 21:15:35 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 34631 invoked by uid 99); 23 Jun 2004 21:15:30 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [66.34.202.202] (HELO minerva.ectoplasm.org) (66.34.202.202) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 23 Jun 2004 14:15:29 -0700 Received: from [172.28.57.123] (office4.tmcs.net [209.104.55.5]) by minerva.ectoplasm.org (Postfix) with ESMTP id BDEC55EB20; Wed, 23 Jun 2004 14:14:56 -0700 (PDT) Message-ID: <40D9F2CD.7010001@ectoplasm.org> Date: Wed, 23 Jun 2004 14:14:53 -0700 From: "Philippe M. Chiasson" User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stas Bekman Cc: dev@perl.apache.org Subject: Re: [Patch mp2] Statically compiling mod_perl in httpd (take 2) References: <40B6238C.7070202@ectoplasm.org> <40B62F7F.6000405@stason.org> <40CE1EE0.8080300@ectoplasm.org> <40CECDEB.60004@stason.org> <40CF88BC.6040505@ectoplasm.org> <40CFF0C8.1030304@stason.org> <40D9C9C4.6030803@ectoplasm.org> <40D9E2F7.9060701@stason.org> In-Reply-To: <40D9E2F7.9060701@stason.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Stas Bekman wrote: > Philippe M. Chiasson wrote: > >> >>Stas Bekman wrote: >> >> >>>Philippe M. Chiasson wrote: >>>[...] >>> >>> >>>>>>+ $ENV{PATH} = '/bin:/usr/bin:/usr/local/bin'; >>>>>> my $handle = Symbol::gensym(); >>>>>> open $handle, "$cmd|" or die "$cmd failed: $!"; >>>>> >>>>> >>>>> >>>>> >>>>>What do you need that for and why the hardcoded paths? >>>> >>>> >>>> >>>>That's an artefact from my builds that I could remove, I guess. It's >>>>because if you run a static build and tests against a non-installed >>>>httpd >>>>build, the actual httpd binary is a smart libtool shell script plucking >>>>things from .libs/ and such, right? And it uses plenty of ls, sed, >>>>grep and >>>>friends. When those things are not in the path anymore, the httpd binary >>>>(shell script) will not work at all. >>>> >>>>Of course, I don't think there are a lot of folks out there that >>>>would run >>>>tests that way without installing httpd, but I do. >>> >>> >>> >>>Sure, but the problem is the hardcoded paths, which could quite vary >>>from machine to machine. I think, instead, one should launder the >>>original shell's $PATH in this particular case and use it unmodified >>>(sans making -T happy). >> >> >>I agree that hard-coding a path like this isn't quite a good idea. >> >>But I am not sure what you mean with "sans making -T happy". I can see >>how one >>could untaint $PATH, but not really how to insure it's clean (except by >>setting >>it to arbitrary value, like /bin:/usr/bin:/usr/local/bin) > > > It's a test suite. I fail to see what danger could happen with /(.*)/ > laundering of $PATH. You can't possibly know what the PATH will be besides the > common components. That sounds like an acceptable assumption to me, so something like this would be okay then ? sub open_cmd { my($self, $cmd) = @_; # untaint some %ENV fields - local @ENV{ qw(PATH IFS CDPATH ENV BASH_ENV) }; - + local @ENV{ qw(IFS CDPATH ENV BASH_ENV) }; + # untaint but keep PATH + (local $ENV{PATH}) = ($ENV{PATH} =~ /(.*)/); my $handle = Symbol::gensym(); open $handle, "$cmd|" or die "$cmd failed: $!"; > -- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org