unzip/unzip-open_missing_mode.patch

14 lines
557 B
Diff

--- fileio.c
+++ fileio.c
@@ -425,7 +425,9 @@
Trace((stderr, "open_outfile: doing fopen(%s) for writing\n",
FnFilter1(G.filename)));
- fd = open(G.filename, O_WRONLY | O_LARGEFILE | O_CREAT);
+ fd = open(G.filename, O_WRONLY | O_LARGEFILE | O_CREAT,
+ /* 0644 in portable POSIX notation: */
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if ((G.outfile = fdopen(fd, FOPW)) == (FILE *)NULL) {
Info(slide, 0x401, ((char *)slide, LoadFarString(CannotCreateFile),
FnFilter1(G.filename)));