[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.24-39-g542ffc5
Shawn Moore
shawn at bestpractical.com
Fri Aug 5 13:30:52 EDT 2016
The branch, 4.0-trunk has been updated
via 542ffc5412bf8293c67420a7801a66e7868d77d9 (commit)
via 51f6226fa546f6e67f190977bd7d6981763f62c7 (commit)
from 4ed0f4e647d4d1243c7aa3d1da649ae57d36b98c (commit)
Summary of changes:
lib/RT.pm | 1 +
1 file changed, 1 insertion(+)
- Log -----------------------------------------------------------------
commit 51f6226fa546f6e67f190977bd7d6981763f62c7
Author: Alex Vandiver <alex at chmrr.net>
Date: Thu Aug 4 23:29:29 2016 -0700
Pass a fully-qualified path when requiring RT::Generated
As the comments a few lines down note, `$INC{'RT.pm'}` is not
guaranteed to be absolute. By examining the path used by RT.pm, and
passing that to `require`, RT was attempting to skip the search of
@INC -- however, a relative path always searches @INC.
But the only means to find `lib/RT/Generated.pm` in @INC, in most
installs, is if the CWD is the root of an RT install, and @INC
contains `.`. (Un)fortunately, perl's @INC nearly always was compiled
to contain `.` -- until CVE-2016-1238.
In response, many versions of perl now omit trailing `.` directories from
@INC, on a conditional or absolute basis. Combined with the above,
this leads to failure to find RT::Generated.
Make the path passed to `require` always be absolute, to skip @INC
dependence entirely.
diff --git a/lib/RT.pm b/lib/RT.pm
index 744ee6c..b1f081c 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -758,6 +758,7 @@ sub InstallMode {
sub LoadGeneratedData {
my $class = shift;
my $pm_path = ( File::Spec->splitpath( $INC{'RT.pm'} ) )[1];
+ $pm_path = File::Spec->rel2abs( $pm_path );
require "$pm_path/RT/Generated.pm" || die "Couldn't load RT::Generated: $@";
$class->CanonicalizeGeneratedPaths();
commit 542ffc5412bf8293c67420a7801a66e7868d77d9
Merge: 4ed0f4e 51f6226
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Fri Aug 5 13:30:48 2016 -0400
Merge branch '4.0/dotless-inc-path' into 4.0-trunk
-----------------------------------------------------------------------
More information about the rt-commit
mailing list