rails/rails — pull request #8027 by daenney (2012-10-25 08:15:51+00:00)
Title: Atomic.rb assumes it may chown a file but doesn't handle the EPERM error.

Previously this code just assumed it is capable of changing the file
ownership, both user and group. This will fail in a lot of scenario's
unless:
* The process is run as a superuser (root);
* The owning user and group are already set to the user and group we're
trying to chown to;
* The user chown'ing only changes the group to another group it is a
member of.

If either of those conditions are not met the filesystem will simply
deny the operation throwing an error.

I've also added a little comment above the chmod command that doing a
chmod on a file which has an ACL set will cause the ACL to be
recalculated / modified.