diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-02-28 08:55:14 +0100 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-02-28 09:32:41 +0100 |
commit | cab69fadc13b530f21f910c1d23d146758c365cb (patch) | |
tree | 88958ce7c8d05a4aaa9d6411f5062c68c7c46ba8 /internal/command/receivepack | |
parent | 9e7533784ef729eab0b2dcc659892dbf1e0e0868 (diff) | |
download | gitlab-shell-ps-git-protocol-envvar.tar.gz |
commands: pass through GIT_PROTOCOL envvar provided by clientsps-git-protocol-envvar
Both git-upload-pack and git-receive-pack services inspect the
GIT_PROTOCOL environment transferred via SSH in order to decide which
protocols are supported by a given client. Currently, we don't use the
environment variable at all, though, but instead forward the GitProtocol
field of the access verification response.
Improve this by passing on the GIT_PROTOCOL environment variable
provided by the client as-is.
Diffstat (limited to 'internal/command/receivepack')
-rw-r--r-- | internal/command/receivepack/gitalycall.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/command/receivepack/gitalycall.go b/internal/command/receivepack/gitalycall.go index a8d8160..529b296 100644 --- a/internal/command/receivepack/gitalycall.go +++ b/internal/command/receivepack/gitalycall.go @@ -2,6 +2,7 @@ package receivepack import ( "context" + "os" "google.golang.org/grpc" @@ -26,7 +27,7 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error { GlId: response.UserId, GlRepository: response.Repo, GlUsername: response.Username, - GitProtocol: response.GitProtocol, + GitProtocol: os.Getenv(commandargs.GitProtocolEnv), GitConfigOptions: response.GitConfigOptions, } |