summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-03-16 11:56:31 +0000
committerThe Bundler Bot <bot@bundler.io>2018-03-16 11:56:31 +0000
commitb7b847fe734dc8d95782d2e6510c8bc9a6631374 (patch)
treeb1c9b686cd7d9f96b394e88673ace3fa9c643309
parent0835ed63ad9c00b818df8034e2facabb18526ddb (diff)
parent15aaf79ce858fc27227f03701f7748b6b5ff1cf5 (diff)
downloadbundler-b7b847fe734dc8d95782d2e6510c8bc9a6631374.tar.gz
Auto merge of #6336 - bundler:segiddins/updater-use-more-filesystem-access, r=colby-swandale
[CompactIndexClient::Updater] Use filesystem_access when copying files ### What was the end-user problem that led to this PR? The problem was users could see the error template when they do not have write permissions to their temporary directory. Closes https://github.com/bundler/bundler/issues/6289 ### What was your diagnosis of the problem? My diagnosis was we need to use `SharedHelpers.filesystem_access` when writing files. ### What is your fix for the problem, implemented in this PR? My fix wraps usage of `cp`
-rw-r--r--lib/bundler/compact_index_client/updater.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
index 950306fee5..4d6eb80044 100644
--- a/lib/bundler/compact_index_client/updater.rb
+++ b/lib/bundler/compact_index_client/updater.rb
@@ -33,7 +33,9 @@ module Bundler
# first try to fetch any new bytes on the existing file
if retrying.nil? && local_path.file?
- FileUtils.cp local_path, local_temp_path
+ SharedHelpers.filesystem_access(local_temp_path) do
+ FileUtils.cp local_path, local_temp_path
+ end
headers["If-None-Match"] = etag_for(local_temp_path)
headers["Range"] =
if local_temp_path.size.nonzero?