Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cc941d8d
Commit
cc941d8d
authored
Jan 19, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect path for OPENSSH_EXPECTED_COMMAND
parent
92eadbb6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
ee/lib/system_check/geo/authorized_keys_check.rb
ee/lib/system_check/geo/authorized_keys_check.rb
+1
-1
spec/ee/fixtures/system_check/sshd_config
spec/ee/fixtures/system_check/sshd_config
+1
-1
spec/ee/fixtures/system_check/sshd_config_invalid_user
spec/ee/fixtures/system_check/sshd_config_invalid_user
+1
-1
spec/ee/fixtures/system_check/sshd_config_no_user
spec/ee/fixtures/system_check/sshd_config_no_user
+1
-1
spec/ee/spec/lib/system_check/geo/authorized_keys_check_spec.rb
...e/spec/lib/system_check/geo/authorized_keys_check_spec.rb
+2
-2
No files found.
ee/lib/system_check/geo/authorized_keys_check.rb
View file @
cc941d8d
...
...
@@ -22,7 +22,7 @@ module SystemCheck
\s
* # optional any amount of space character
(?:
\#
.*)?$ # optional start-comment symbol followed by optionally any character until end of line
}x
OPENSSH_EXPECTED_COMMAND
=
'/opt/gitlab
-shell/authorized_keys
%u %k'
.
freeze
OPENSSH_EXPECTED_COMMAND
=
'/opt/gitlab
/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
%u %k'
.
freeze
def
multi_check
unless
openssh_config_exists?
...
...
spec/ee/fixtures/system_check/sshd_config
View file @
cc941d8d
...
...
@@ -32,7 +32,7 @@ RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
#AuthorizedKeysCommand /opt/gitlab-shell/invalid_authorized_keys %u %k
AuthorizedKeysCommand /opt/gitlab
-shell/authorized_keys
%u %k
AuthorizedKeysCommand /opt/gitlab
/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
%u %k
AuthorizedKeysCommandUser git
# Don't read the user's ~/.rhosts and ~/.shosts files
...
...
spec/ee/fixtures/system_check/sshd_config_invalid_user
View file @
cc941d8d
...
...
@@ -4,5 +4,5 @@
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
AuthorizedKeysCommand /opt/gitlab
-shell/authorized_keys
%u %k # comment
AuthorizedKeysCommand /opt/gitlab
/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
%u %k # comment
AuthorizedKeysCommandUser anotheruser #comment with more stuff#
spec/ee/fixtures/system_check/sshd_config_no_user
View file @
cc941d8d
...
...
@@ -5,5 +5,5 @@ RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
#AuthorizedKeysCommand /opt/gitlab-shell/invalid_authorized_keys %u %k
AuthorizedKeysCommand /opt/gitlab
-shell/authorized_keys
%u %k
AuthorizedKeysCommand /opt/gitlab
/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
%u %k
#AuthorizedKeysCommandUser git
spec/ee/spec/lib/system_check/geo/authorized_keys_check_spec.rb
View file @
cc941d8d
...
...
@@ -7,7 +7,7 @@ describe SystemCheck::Geo::AuthorizedKeysCheck do
before
do
allow
(
File
).
to
receive
(
:file?
).
and_call_original
# provides a default behavior when mocking
allow
(
File
).
to
receive
(
:file?
).
with
(
'/opt/gitlab
-shell/authorized_keys
'
)
{
true
}
allow
(
File
).
to
receive
(
:file?
).
with
(
'/opt/gitlab
/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
'
)
{
true
}
end
context
'OpenSSH config file'
do
...
...
@@ -106,7 +106,7 @@ describe SystemCheck::Geo::AuthorizedKeysCheck do
it
'returns correct (uncommented) command'
do
override_sshd_config
(
'system_check/sshd_config'
)
expect
(
subject
.
extract_authorized_keys_command
).
to
eq
(
'/opt/gitlab
-shell/authorized_keys
%u %k'
)
expect
(
subject
.
extract_authorized_keys_command
).
to
eq
(
'/opt/gitlab
/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
%u %k'
)
end
it
'returns command without comments and without quotes'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment