Fall back to Process.gid if we aren't a member of the file's group
This commit is contained in:
parent
03fca453c4
commit
e5fbc9c92e
@ -110,8 +110,11 @@ class Pathname
|
||||
|
||||
FileUtils.mv tf.path, self
|
||||
|
||||
uid = Process.uid
|
||||
gid = Process.groups.delete(old_stat.gid) { Process.gid }
|
||||
|
||||
begin
|
||||
chown(old_stat.uid, old_stat.gid)
|
||||
chown(uid, gid)
|
||||
chmod(old_stat.mode)
|
||||
rescue Errno::EPERM
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user