summaryrefslogtreecommitdiff
path: root/lib/gitlab/shell.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-02 00:11:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-02 00:11:46 +0000
commit5b72415235c4a056380758c5d23bff3a738158e7 (patch)
tree47a04433210a8f3af8b0c1f3f0a5fcf8250dabc4 /lib/gitlab/shell.rb
parent64667f74b1613f91fe7eb53cd6610f0693c3a45e (diff)
downloadgitlab-ce-5b72415235c4a056380758c5d23bff3a738158e7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/shell.rb')
-rw-r--r--lib/gitlab/shell.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb
index d26e1a34a9f..b167afe589a 100644
--- a/lib/gitlab/shell.rb
+++ b/lib/gitlab/shell.rb
@@ -70,7 +70,9 @@ module Gitlab
link_path = File.join(shell_path, '.gitlab_shell_secret')
if File.exist?(shell_path) && !File.exist?(link_path)
- FileUtils.symlink(secret_file, link_path)
+ # It could happen that link_path is a broken symbolic link.
+ # In that case !File.exist?(link_path) is true, but we still want to overwrite the (broken) symbolic link.
+ FileUtils.ln_sf(secret_file, link_path)
end
end
end