From d988153800cd6f8f7256fc8e2c0096ed049a6805 Mon Sep 17 00:00:00 2001 From: rfm Date: Fri, 16 Feb 2024 14:26:41 +0000 Subject: [PATCH] Fix for #361 --- ChangeLog | 4 ++++ Source/NSData.m | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dfa93e8a5..bcfbef7a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2024-02-16 Richard Frith-Macdonald + + * Source/NSData.m: fix for #361 + 2024-02-13 Richard Frith-Macdonald * Source/GSFileHandle.m: diff --git a/Source/NSData.m b/Source/NSData.m index 702459c3e..b074be81e 100644 --- a/Source/NSData.m +++ b/Source/NSData.m @@ -2011,9 +2011,13 @@ failure: NSWarnMLog(@"mkstemp (%s) failed - %@", thePath, [NSError _last]); goto failure; } + /* Created writable files are supposed to only have read and/or + * write set (no execute) according to Apple documentation. + * They should honor the setting specified by umask though. + */ mask = umask(0); umask(mask); - fchmod(desc, 0644 & ~mask); + fchmod(desc, 0666 & ~mask); if ((theFile = fdopen(desc, "w")) == 0) { close(desc);