develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #121742] [PATCH] Coverity: safe umask before mkstemp

Tony Cook via RT
April 28, 2014 01:47
[perl #121742] [PATCH] Coverity: safe umask before mkstemp
Message ID:
On Sat Apr 26 12:56:06 2014, jhi wrote:
> Use safe umask (0600) before mkstemp.   Modern glibcs use a safe umask, 
> but older ones don't, and on non-glibc systems better play safe.
> Attached.

While I think the patch is good, threaded code that uses C<< open my $fh, "+>", undef >> might see some intermittent unexpected permissions on files created in other threads.

Unfortunately umask() updates the mask for the whole process and there's no thread-local variant, so I don't see a thread-safe solution.

Added to the 5.21.1 list.


via perlbug:  queue: perl5 status: new Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About