From 42e4cfc3837b3b39347c0b6ed1e15b3767e90783 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Sat, 12 Dec 2020 21:16:46 +0000 Subject: [PATCH] Windowqs mkstemp: open() needs more permissions. Specifically: 1. The open must be for read only or read/write - use read/write. 2. The file permission must permit read and write. --- src/compat/mkstemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compat/mkstemp.c b/src/compat/mkstemp.c index 4d5acc8f..49d3e919 100644 --- a/src/compat/mkstemp.c +++ b/src/compat/mkstemp.c @@ -39,5 +39,5 @@ int mkstemp(char *template) { if (_mktemp_s(template, strlen(template) + 1) != 0) return -1; - return open(template, _O_CREAT | _O_EXCL, _S_IWRITE); + return open(template, _O_CREAT | _O_EXCL | _O_RDWR, _S_IWRITE | _S_IREAD); }