This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix umask for mkstemp(3) calls
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index c7c1fe6..1d94b38 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3785,7 +3785,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, bool *suidscript)
        const char * const err = "Failed to create a fake bit bucket";
        if (strEQ(scriptname, BIT_BUCKET)) {
 #ifdef HAS_MKSTEMP /* Hopefully mkstemp() is safe here. */
-            int old_umask = umask(0600);
+            int old_umask = umask(0177);
            int tmpfd = mkstemp(tmpname);
             umask(old_umask);
            if (tmpfd > -1) {