diff options
author | Gisle Aas <gisle@aas.no> | 2007-01-12 17:10:16 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-01-13 16:56:02 +0000 |
commit | b0b546b3f9cbdb839276fcb570321d9f1a7bcd3b (patch) | |
tree | 1191336978ebb4582cda16d7ce0d0cda9fae1eac /pp_sys.c | |
parent | 8efd9ba483b3f64a0cb911a666d3b6109b1c6ea6 (diff) | |
download | perl-b0b546b3f9cbdb839276fcb570321d9f1a7bcd3b.tar.gz |
Re: AW: umask handling in File::Temp
Message-ID: <877ivs1dt3.fsf@ask.g.aas.no>
p4raw-id: //depot/perl@29784
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -707,8 +707,12 @@ PP(pp_umask) Mode_t anum; if (MAXARG < 1) { - anum = PerlLIO_umask(0); - (void)PerlLIO_umask(anum); + anum = PerlLIO_umask(022); + /* setting it to 022 between the two calls to umask avoids + * to have a window where the umask is set to 0 -- meaning + * that another thread could create world-writeable files. */ + if (anum != 022) + (void)PerlLIO_umask(anum); } else anum = PerlLIO_umask(POPi); |