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
bb1cf2aa
Commit
bb1cf2aa
authored
Sep 13, 2017
by
Alexis Reigel
Committed by
Rémy Coutable
Sep 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: GPG tmp dir removal race condition
parent
4fb6848f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
changelogs/unreleased/fix-gpg-tmp-dir-removal-race-condition.yml
...ogs/unreleased/fix-gpg-tmp-dir-removal-race-condition.yml
+5
-0
lib/gitlab/gpg.rb
lib/gitlab/gpg.rb
+10
-4
No files found.
changelogs/unreleased/fix-gpg-tmp-dir-removal-race-condition.yml
0 → 100644
View file @
bb1cf2aa
---
title
:
Fixes the 500 errors caused by a race condition in GPG's tmp directory handling
merge_request
:
14194
author
:
Alexis Reigel
type
:
fixed
lib/gitlab/gpg.rb
View file @
bb1cf2aa
...
...
@@ -69,11 +69,17 @@ module Gitlab
def
optimistic_using_tmp_keychain
previous_dir
=
current_home_dir
Dir
.
mktmpdir
do
|
dir
|
GPGME
::
Engine
.
home_dir
=
dir
yield
end
tmp_dir
=
Dir
.
mktmpdir
GPGME
::
Engine
.
home_dir
=
tmp_dir
yield
ensure
# Ignore any errors when removing the tmp directory, as we may run into a
# race condition:
# The `gpg-agent` agent process may clean up some files as well while
# `FileUtils.remove_entry` is iterating the directory and removing all
# its contained files and directories recursively, which could raise an
# error.
FileUtils
.
remove_entry
(
tmp_dir
,
true
)
GPGME
::
Engine
.
home_dir
=
previous_dir
end
end
...
...
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