As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit 324fa5ce authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Use authorized_keys lock when add new key to file

parent 025f97aa
No related branches found
No related tags found
No related merge requests found
v1.9.5
- Put authorized_keys.lock in the same directory as authorized_keys
- Use lock file when add new entries to authorized_keys
v1.9.4
- Use lock file when modify authorized_keys
Loading
Loading
Loading
Loading
@@ -29,9 +29,11 @@ class GitlabKeys
protected
def add_key
$logger.info "Adding key #{@key_id} => #{@key.inspect}"
auth_line = key_line(@key_id, @key)
open(auth_file, 'a') { |file| file.puts(auth_line) }
lock do
$logger.info "Adding key #{@key_id} => #{@key.inspect}"
auth_line = key_line(@key_id, @key)
open(auth_file, 'a') { |file| file.puts(auth_line) }
end
true
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment