[perl #72098] File::Copy stripping 06000 perms on cp for root
The problem is with the use of cp when perms & 06000.
There is logic that checks to see if the target file is owned by the
user ($>) running the copy and/or if $> is a member of the group that
owns the target file. If this is not the case, then the 06000 bits are
masked out before the chmod is called after the copy.
This is mostly good logic except when root is executing this, in which
case root should get to do whatever it wants to do.
Looking closer at the code to test for group membership, I think it can
be more easily and more cheaply be written using $). I've added this
change to the patch.
This will also fix the problem where someone has a group membership
based on /etc/passwd and is not mentioned in /etc/group.