summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-08-14 22:48:56 +0100
committerNick Thomas <nick@gitlab.com>2018-08-14 22:48:56 +0100
commit1666dfdae141cceab35cc30baa253e2676b5ed65 (patch)
tree19aeec667ec591c02d498910fbe1526d19770643 /bin
parent02457041814fe4497b3df00e0e45edbee107c823 (diff)
parent5287eee65e7f29e8d5296eb3ef24a06a9a60b3f1 (diff)
downloadgitlab-shell-1666dfdae141cceab35cc30baa253e2676b5ed65.tar.gz
Merge remote-tracking branch 'upstream/8-1-stable' into 148-merge-8-1-1-to-master
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gitlab-shell6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/gitlab-shell b/bin/gitlab-shell
index 1016570..93a79f6 100755
--- a/bin/gitlab-shell
+++ b/bin/gitlab-shell
@@ -17,7 +17,11 @@ require_relative '../lib/gitlab_init'
#
require File.join(ROOT_PATH, 'lib', 'gitlab_shell')
-if GitlabShell.new(ARGV.join).exec(original_cmd)
+# We must match e.g. "key-12345" anywhere on the command-line. See
+# https://gitlab.com/gitlab-org/gitlab-shell/issues/145
+who = /\b(?:(?:key|user)-[0-9]+|username-\S+)\b/.match(ARGV.join(' ')).to_s
+
+if GitlabShell.new(who).exec(original_cmd)
exit 0
else
exit 1