http://www.perlmonks.org?node_id=603105


in reply to File::Inplace module is altering file permissions/ownership

So, what is Inplace doing and how and why is it changing permissions? And how can I stop it?
Investigate.
http://search.cpan.org/src/CHIPT/File-Inplace-0.20/lib/File/Inplace.pm
No chmod, no umask, uses File::Copy, File::Temp
http://search.cpan.org/src/NWCLARK/perl-5.8.8/lib/File/Copy.pm
No chmod, no umask
http://search.cpan.org/src/NWCLARK/perl-5.8.8/lib/File/Temp.pm
Bingo
# Internal routine to force a temp file to be writable after # it is created so that we can unlink it. Windows seems to occassional +ly # force a file to be readonly when written to certain temp locations sub _force_writable { my $file = shift; my $umask = umask(); umask(066); chmod 0600, $file; umask($umask) if defined $umask; }
With a umask of 066 only the creator of the file will be able to read or write to the file. File::Inplace needs to account for this behaviour.