diff options
author | Xavier Noria <fxn@hashref.com> | 2012-10-29 02:17:11 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-10-29 02:17:11 -0700 |
commit | 71abfa511da77109b2bbf913dcee2f9e1606e66a (patch) | |
tree | 5656c3eeb53462bbe65394e3bbe5ec5b380c8a08 /activesupport/lib | |
parent | 81679ab2ae8c9f6a233374efe9fcf096cf9f8fd9 (diff) | |
parent | 851f8c10235a0874f5e34b2c7b5544c33f89c022 (diff) | |
download | rails-71abfa511da77109b2bbf913dcee2f9e1606e66a.tar.gz rails-71abfa511da77109b2bbf913dcee2f9e1606e66a.tar.bz2 rails-71abfa511da77109b2bbf913dcee2f9e1606e66a.zip |
Merge pull request #8027 from daenney/master
Atomic.rb assumes it may chown/chmod a file but doesn't handle the EPERM error.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/file/atomic.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb index 38ea7f8fb3..c3e6124a57 100644 --- a/activesupport/lib/active_support/core_ext/file/atomic.rb +++ b/activesupport/lib/active_support/core_ext/file/atomic.rb @@ -36,8 +36,13 @@ class File FileUtils.mv(temp_file.path, file_name) # Set correct permissions on new file - chown(old_stat.uid, old_stat.gid, file_name) - chmod(old_stat.mode, file_name) + begin + chown(old_stat.uid, old_stat.gid, file_name) + # This operation will affect filesystem ACL's + chmod(old_stat.mode, file_name) + rescue Errno::EPERM + # Changing file ownership failed, moving on. + end end # Private utility method. |