Bug 162256 - Use 'use lib $FindBin::Bin' to append Perl module include path
Summary: Use 'use lib $FindBin::Bin' to append Perl module include path
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-19 23:10 PDT by Fujii Hironori
Modified: 2016-10-07 00:59 PDT (History)
12 users (show)

See Also:


Attachments
Patch (16.63 KB, patch)
2016-09-20 00:33 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (27.38 KB, patch)
2016-09-22 21:16 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2016-09-19 23:10:34 PDT
We need to use '-I' switch to explicitly append Perl module include path to invoke some Perl scripts such like following:

> COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${NAMES_GENERATOR} --input ${_infile} --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}

This can be solved by using 'use lib'. 

> use lib $FindBin::Bin

Documentation: http://perldoc.perl.org/lib.html

Some scripts already do this. For example, build-webkit do that.

  https://trac.webkit.org/browser/trunk/Tools/Scripts/build-webkit?rev=204444#L41

I'd like to change following script files:

  Source/WebCore/bindings/scripts/generate-bindings.pl
  Source/WebCore/bindings/scripts/preprocess-idls.pl
  Source/WebCore/css/makegrammar.pl
  Source/WebCore/css/makeprop.pl
  Source/WebCore/css/makevalues.pl
  Source/WebCore/dom/make_dom_exceptions.pl
  Source/WebCore/dom/make_event_factory.pl
  Source/WebCore/dom/make_names.pl
  Source/WebCore/page/make_settings.pl
Comment 1 Carlos Garcia Campos 2016-09-19 23:20:15 PDT
We need this because in some systems, like Debian, perl is configured to no longer include '.' in @INC by default for security reasons, see https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-1238
Comment 2 Fujii Hironori 2016-09-20 00:04:37 PDT
(In reply to comment #1)
> We need this because in some systems, like Debian, perl is configured to no
> longer include '.' in @INC by default for security reasons, see
> https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-1238

I'm just to change how to append include paths in this bug.
There aren't differences in security perspective.

One should not execute WebKit's build scripts in an untrusted directory.
Comment 3 Fujii Hironori 2016-09-20 00:33:06 PDT
Created attachment 289333 [details]
Patch
Comment 4 Fujii Hironori 2016-09-22 21:16:02 PDT
Created attachment 289659 [details]
Patch
Comment 5 Fujii Hironori 2016-09-28 19:48:42 PDT
This is a simple patch. Is there any problem in this patch to review, Reviewers?
Comment 6 WebKit Commit Bot 2016-10-07 00:59:00 PDT
Comment on attachment 289659 [details]
Patch

Clearing flags on attachment: 289659

Committed r206904: <http://trac.webkit.org/changeset/206904>
Comment 7 WebKit Commit Bot 2016-10-07 00:59:06 PDT
All reviewed patches have been landed.  Closing bug.