Skip to content

Commit 93a4634

Browse files
author
System Administrator
committed
Cleaner fix using GIT_ALLOW_PROTOCOL.
1 parent a8a33f1 commit 93a4634

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Metrics/AbcSize:
1313
# Offense count: 1
1414
# Configuration parameters: CountComments.
1515
Metrics/ClassLength:
16-
Max: 125
16+
Max: 124
1717

1818
# Offense count: 38
1919
# Configuration parameters: AllowURI, URISchemes.

lib/git-fastclone.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class Runner
6060

6161
DEFAULT_REFERENCE_REPO_DIR = '/var/tmp/git-fastclone/reference'
6262

63+
DEFAULT_GIT_ALLOW_PROTOCOL = 'file:git:http:https:ssh'
64+
6365
attr_accessor :reference_dir, :prefetch_submodules, :reference_mutex, :reference_updated,
6466
:options, :logger, :abs_clone_path, :using_local_repo
6567

@@ -90,6 +92,8 @@ def initialize
9092
def run
9193
url, path, options = parse_inputs
9294
logger.info("Cloning #{url} to #{path}") if logger
95+
Cocaine::CommandLine.environment['GIT_ALLOW_PROTOCOL'] =
96+
ENV['GIT_ALLOW_PROTOCOL'] || DEFAULT_GIT_ALLOW_PROTOCOL
9397
clone(url, options[:branch], path)
9498
end
9599

@@ -247,11 +251,6 @@ def store_updated_repo(url, mirror, repo_name, fail_hard)
247251
# moment means we only need to synchronize our own threads in case a single
248252
# submodule url is included twice via multiple dependency paths
249253
def with_git_mirror(url)
250-
if url.lstrip.start_with?('ext::')
251-
logger.info("Skipping #{url} for security purpose (CVE-2015-7545)") if logger
252-
return
253-
end
254-
255254
update_reference_repo(url, true)
256255

257256
# Sometimes remote updates involve re-packing objects on a different thread

0 commit comments

Comments
 (0)