summaryrefslogtreecommitdiff
path: root/include/ruby/internal/module.h
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-07-03 13:26:21 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-07-08 14:38:31 +0900
commite4825a5194af822104ec9fcac00004a2bad30f18 (patch)
tree4a3324805d18fb9f778f3a087f4e509e35d549b5 /include/ruby/internal/module.h
parentd90a930edea311c0f3fe2a8aade03efb1697c3e0 (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 'include/ruby/internal/module.h')
0 files changed, 0 insertions, 0 deletions