[EMAIL PROTECTED] wrote:
Author: stas
Date: Fri Dec 23 11:51:41 2005
New Revision: 358859

URL: http://svn.apache.org/viewcvs?rev=358859&view=rev
Log:
Adjust Apache::TestConfig::untaint_path() to handle relative paths
that don't start with /.

Randy, it has just dawned on me that this change may have a problem on win32. Should it be !m#^(?:[^/\\]|$)#? but then it won't catch C:\\. What's the cleanest regex here?

To remind it needs to remove the following 4 cases:

::
:./foo/bar:
:../foo/bar:
:foo/bar:

Please commit whatever seems to work for you. Thank you!

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
URL: 
http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfig.pm?rev=358859&r1=358858&r2=358859&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfig.pm Fri Dec 23 11:51:41 2005
@@ -1751,7 +1751,7 @@
     # win32 uses ';' for a path separator, assume others use ':'
     my $sep = WIN32 ? ';' : ':';
     # -T disallows relative and empty directories in the PATH
-    return join $sep, grep !/^(\.|$)/, split /$sep/, $path;
+    return join $sep, grep !m#^(?:[^/]|$)#, split /$sep/, $path;
 }
sub pop_dir {



--
_____________________________________________________________
Stas Bekman mailto:[EMAIL PROTECTED]  http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book       http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/

Reply via email to