-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cwd::fast_abs_path's untaint should allow for multiline directories #12624
Comments
From [email protected]This is a bug report for perl from joel.a.berger@gmail.com, From f735a80fac061ee49ac9a1d6552de229d6e2cc10 Mon Sep 17 00:00:00 2001 This is a multi-part message in MIME format. This bug was noticed via Perl-Toolchain-Gang/File-chdir#3 and testing has led to this being the cause. Yes this should have tests, but since it will involve creating a directory with a newline, I thought I would do better to leave that to someone with better knowledge than I. dist/Cwd/Cwd.pm | 4 ++-- --------------1.7.9.5 Inline Patchdiff --git a/dist/Cwd/Cwd.pm b/dist/Cwd/Cwd.pm
index f772bf4..888c505 100644
--- a/dist/Cwd/Cwd.pm
+++ b/dist/Cwd/Cwd.pm
@@ -624,8 +624,8 @@ sub fast_abs_path {
# Detaint else we'll explode in taint mode. This is safe because
# we're not doing anything dangerous with it.
- ($path) = $path =~ /(.*)/;
- ($cwd) = $cwd =~ /(.*)/;
+ ($path) = $path =~ /(.*)/s;
+ ($cwd) = $cwd =~ /(.*)/s;
unless (-e $path) {
_croak("$path: No such file or directory");
--------------1.7.9.5--
---
Site configuration information for perl 5.16.0: Configured by joel at Tue May 22 11:06:05 CDT 2012. Summary of my perl5 (revision 5 version 16 subversion 0) configuration: Locally applied patches: @INC for perl 5.16.0: Environment for perl 5.16.0: |
From @jkeenanOn Sat Dec 01 08:47:36 2012, joel.a.berger@gmail.com wrote:
Apart from the mechanics of creating a directory with a newline in its |
The RT System itself - Status changed from 'new' to 'open' |
From [email protected]As seen in the bug report on File::chdir ( Further, I haven't search the rest of the codebase but I suspect that all Joel On Sun, Dec 2, 2012 at 10:58 AM, James E Keenan via RT <
|
From @epaCould I suggest that an untaint() builtin would be a good idea? |
From @cpansproutOn Sun Dec 02 09:11:43 2012, joel.a.berger@gmail.com wrote:
Such as File::Path: for ($arg->{cwd}) { /\A(.*)\Z/; $_ = $1 } # untaint I tried writing a test for your bug using File::Temp, and ran into this In the end I wrote a test without using File::Temp (commit 52ee8d0) -- Father Chrysostomos |
From [Unknown Contact. See original ticket]On Sun Dec 02 09:11:43 2012, joel.a.berger@gmail.com wrote:
Such as File::Path: for ($arg->{cwd}) { /\A(.*)\Z/; $_ = $1 } # untaint I tried writing a test for your bug using File::Temp, and ran into this In the end I wrote a test without using File::Temp (commit 52ee8d0) -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#115962 (status was 'resolved')
Searchable as RT115962$
The text was updated successfully, but these errors were encountered: