Commit 98d399b116869de2d04aff76af9bb60c9d5bfc14

Authored by Jacob Vosmaer
1 parent 90c7c03e

Make ~git/.ssh/authorized_keys valid for SELinux

files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
@@ -38,6 +38,12 @@ directory ssh_dir do @@ -38,6 +38,12 @@ directory ssh_dir do
38 recursive true 38 recursive true
39 end 39 end
40 40
  41 +# If SELinux is enabled, make sure that OpenSSH thinks the .ssh directory of the
  42 +# git_user is valid.
  43 +execute "chcon -t user_home_t #{ssh_dir}" do
  44 + only_if "id -Z"
  45 +end
  46 +
41 directory log_directory do 47 directory log_directory do
42 owner git_user 48 owner git_user
43 recursive true 49 recursive true