File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ name: lint
1010 - 17-stable
1111 - 16-stable
1212
13+ permissions :
14+ contents : read
15+
1316jobs :
1417 chefstyle :
1518 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 99 - ' release/**'
1010 pull_request :
1111 types : [opened, synchronize, reopened]
12+
13+ permissions :
14+ contents : read
1215
1316jobs :
1417 sonarqube :
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ def load_plugin_class(plugin_path)
100100 contents = ""
101101 begin
102102 logger . trace ( "Loading plugin at #{ plugin_path } " )
103- contents << IO . read ( plugin_path )
103+ contents << File . read ( plugin_path )
104104 rescue IOError , Errno ::ENOENT
105105 logger . warn ( "Unable to open or read plugin at #{ plugin_path } " )
106106 return nil
Original file line number Diff line number Diff line change @@ -248,10 +248,11 @@ def fetch_dynamic_data
248248 private
249249
250250 def expand_path ( file_name )
251- path = file_name . gsub ( /\= .*$/ , "/" )
251+ # Replace '=' only at the start of the string and avoid excessive backtracking
252+ path = file_name . sub ( /^=+/ , "/" )
252253 # ignore "./" and "../"
253- path . gsub ( %r{/\. \. ?(?:/|$)} , "/" )
254- . sub ( %r{^\. \. ?(?:/|$)} , "" )
254+ path . gsub ( %r{\ /\. \. ?(?:\ / |$)} , "/" )
255+ . sub ( %r{^\. \. ?(?:\ / |$)} , "" )
255256 . sub ( /^$/ , "/" )
256257 end
257258
You can’t perform that action at this time.
0 commit comments