* fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
If fchown fails to set both uid and gid, try to set just gid, as that is sometimes allowed. Adjust the file's mode to eliminate setuid or setgid bits that are inappropriate if fchown fails.
Showing with 21 additions and 4 deletions