mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Set GIT_ALLOW_PROTOCOL to limit dangerous protocols
See git commit 33cfccbbf35a -- some protocols allow arbitrary command execution as part of the URL. Instead of blindly allowing those, whitelist the allowed URL protocols unless the user has already done so. Bug: Issue 210 Change-Id: I6bd8e721aa5e3dab53ef28cfdc8fde33eb74ef76
This commit is contained in:
parent
e1e0bd1f75
commit
466b8c4ea2
@ -168,6 +168,9 @@ class GitCommand(object):
|
|||||||
if p is not None:
|
if p is not None:
|
||||||
s = p + ' ' + s
|
s = p + ' ' + s
|
||||||
_setenv(env, 'GIT_CONFIG_PARAMETERS', s)
|
_setenv(env, 'GIT_CONFIG_PARAMETERS', s)
|
||||||
|
if 'GIT_ALLOW_PROTOCOL' not in env:
|
||||||
|
_setenv(env, 'GIT_ALLOW_PROTOCOL',
|
||||||
|
'file:git:http:https:ssh:persistent-http:persistent-https:sso')
|
||||||
|
|
||||||
if project:
|
if project:
|
||||||
if not cwd:
|
if not cwd:
|
||||||
|
Loading…
Reference in New Issue
Block a user