diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2024-07-03 13:26:21 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-07-08 14:38:31 +0900 |
| commit | e4825a5194af822104ec9fcac00004a2bad30f18 (patch) | |
| tree | 4a3324805d18fb9f778f3a087f4e509e35d549b5 /thread.c | |
| parent | d90a930edea311c0f3fe2a8aade03efb1697c3e0 (diff) | |
[rubygems/rubygems] Fix another race condition
We also need to protect prior removal of the binstub, otherwise it can
happen that:
* Process A removes prior binstub FOO.
* Process B removes prior binstub FOO (does nothing actually because Process A already removed it).
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.
Similarly as before, if binstub FOO for gem BAR is bigger that binstub
FOO for gem BAZ, garbage bytes will be left around at the end of the
file, corrupting the binstub.
The solution is to also protect removal of the previous binstub. To do
this, we use a file lock on an explicit `.lock` file.
https://github.com/rubygems/rubygems/commit/d99a80e62d
Diffstat (limited to 'thread.c')
0 files changed, 0 insertions, 0 deletions
