summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2016-08-02 10:52:28 +0200
committerJacob Vosmaer <jacob@gitlab.com>2016-08-02 11:16:24 +0200
commitf9a55789864e30c1fed2951e26fd62768fc04bce (patch)
tree91ae629e05007cd4fc24883153be2b7ed0655c79 /bin
parenta7d2fed0a64ec6271cced4dffe24021907e8ccd7 (diff)
downloadgitlab-shell-f9a55789864e30c1fed2951e26fd62768fc04bce.tar.gz
Improve authorized_keys check
The old check only looked if authorized_keys exists. With this change, we look whether we can actually open the file for reading and writing. When this fails we try to print useful diagnostic information.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/check b/bin/check
index 363cb6a..d34a2d0 100755
--- a/bin/check
+++ b/bin/check
@@ -19,14 +19,12 @@ rescue GitlabNet::ApiUnreachableError
abort "FAILED: Failed to connect to internal API"
end
-
-puts "\nCheck directories and files: "
-
config = GitlabConfig.new
abort("ERROR: missing option in config.yml") unless config.auth_file
-print "\t#{config.auth_file}: "
-if File.exists?(config.auth_file)
+
+print "\nAccess to #{config.auth_file}: "
+if system(File.dirname(__FILE__) + '/gitlab-keys', 'check-permissions')
print 'OK'
else
abort "FAILED"