BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ffee05c2
Commit
ffee05c2
authored
Jan 11, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve invalid build artifacts metadata path matcher
parent
f80d7a86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
metadata.rb
lib/gitlab/ci/build/artifacts/metadata.rb
+2
-5
No files found.
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
ffee05c2
...
...
@@ -43,6 +43,7 @@ module Gitlab
def
match_entries
(
gz
)
paths
,
metadata
=
[],
[]
match_pattern
=
%r{^
#{
Regexp
.
escape
(
@path
)
}
[^/
\s
]*/?$}
invalid_pattern
=
%r{(^
\.
?
\.
?/)|(/
\.
?
\.
?/)}
until
gz
.
eof?
do
begin
...
...
@@ -50,7 +51,7 @@ module Gitlab
meta
=
read_string
(
gz
)
next
unless
path
=~
match_pattern
next
unless
path_valid?
(
path
)
next
if
path
=~
invalid_pattern
paths
.
push
(
path
)
metadata
.
push
(
JSON
.
parse
(
meta
.
chomp
,
symbolize_names:
true
))
...
...
@@ -62,10 +63,6 @@ module Gitlab
[
paths
,
metadata
]
end
def
path_valid?
(
path
)
!
(
path
.
start_with?
(
'/'
)
||
path
=~
%r{
\.
?
\.
/}
)
end
def
read_version
gzip
do
|
gz
|
version_string
=
read_string
(
gz
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment