diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2017-11-29 07:24:50 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2017-11-29 11:03:48 +0200 |
commit | 026633c6d8d2f9ba22e5de49b50579c768369e5e (patch) | |
tree | c37099f2b1213d07fb4d60deae1f561192c60a13 /doio.c | |
parent | 8843856e9716655549cce789b3338e1d4c72fffb (diff) | |
download | perl-026633c6d8d2f9ba22e5de49b50579c768369e5e.tar.gz |
Set safer umask for mkstemp().
Coverity #169258.
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -850,7 +850,11 @@ S_openindirtemp(pTHX_ GV *gv, SV *orig_name, SV *temp_out_name) { else sv_setpvs(temp_out_name, "XXXXXXXX"); - fd = Perl_my_mkstemp(SvPVX(temp_out_name)); + { + int old_umask = umask(0177); + fd = Perl_my_mkstemp(SvPVX(temp_out_name)); + umask(old_umask); + } if (fd < 0) return FALSE; |