Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-04-05 09:09:04 +0300
committerStan Hu <stanhu@gmail.com>2017-04-05 09:12:08 +0300
commit54849afc6c94fbc16b0b320741cadafb272deb9d (patch)
tree53a5f5994229f87ddbfab7645ef81b203431dd38 /lib
parentced322c5f6de61c30794140a08fa45b612474850 (diff)
Handle SSH keys that have multiple spaces between each marker
Notice what happens when a user adds a key with a space in between: ``` irb(main):004:0> 'ssh-rsa foobar'.split(/ /) => ["ssh-rsa", "", "foobar"] ``` This would cause gitlab-shell to receive a blank argument for the actual key, leading to users unable to login.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/shell.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb
index b631ef11ce7..36a871e5bbc 100644
--- a/lib/gitlab/shell.rb
+++ b/lib/gitlab/shell.rb
@@ -35,7 +35,7 @@ module Gitlab
end
def strip_key(key)
- key.split(/ /)[0, 2].join(' ')
+ key.split(/[ ]+/)[0, 2].join(' ')
end
private