This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix for Coverity perl5 CID 29068: Insecure temporary file (SECURE_TEMP) secure_temp...
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 24 Apr 2014 16:23:18 +0000 (12:23 -0400)
committerSteffen Mueller <smueller@cpan.org>
Wed, 28 May 2014 17:27:22 +0000 (19:27 +0200)
commit60f7fc1ea42054e92f34b4ce9d608efd14357392
tree28c83d8e07c36a239f75ef63cb66708b503152ed
parentc67159e16ee2c8d23fc3c3a55448ffbda709b3f6
Fix for Coverity perl5 CID 29068: Insecure temporary file (SECURE_TEMP) secure_temp: Calling mkstemp() without securely setting umask first.

The umask used for mkstemp should be secure, but umask 0600 has been
the required umask only since POSIX.1-2008.  In glibc 2.06 and earlier
the default was 0666, which is not secure.  And no explicit knowledge
of how well non-glibc platforms implement mkstemp.  Better err on the
side security, so set the umask temporarily to 0600, and then restore it.
perl.c
perlio.c