diff --git a/zip/zip.c b/zip/zip.c index 439821f..7c2b653 100644 --- a/zip/zip.c +++ b/zip/zip.c @@ -3892,9 +3892,12 @@ char **argv; /* command line tokens */ } strcat(tempzip, "ziXXXXXX"); + mode_t old_umask; /* umask prior to temp file creation */ + old_umask = umask(0066); if ((yd = mkstemp(tempzip)) == EOF) { ZIPERR(ZE_TEMP, tempzip); } + umask(old_umask); if ((y = fdopen(yd, FOPW_TMP)) == NULL) { ZIPERR(ZE_TEMP, tempzip); } @@ -4904,9 +4907,12 @@ char **argv; /* command line tokens */ if ((tempzip = tempname(zipfile)) == NULL) { ZIPERR(ZE_MEM, "allocating temp filename"); } + mode_t old_umask; /* umask prior to temp file creation */ + old_umask = umask(0066); if ((y = zfopen(tempzip, FOPW_TMP)) == NULL) { ZIPERR(ZE_TEMP, tempzip); } + umask(old_umask); #endif }