X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c6940f12e2ad6ba778324f50b9a779db36238518..b078de41dfbae96dfb831e6e06df047b669adc4c:/unix/uxmisc.c diff --git a/unix/uxmisc.c b/unix/uxmisc.c index dc208637..dd04e6f5 100644 --- a/unix/uxmisc.c +++ b/unix/uxmisc.c @@ -140,8 +140,10 @@ FILE *f_open(struct Filename filename, char const *mode, int is_private) if (!is_private) { return fopen(filename.path, mode); } else { - assert(mode[0] == 'w'); /* is_private is meaningless for read */ - int fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, + int fd; + assert(mode[0] == 'w'); /* is_private is meaningless for read, + and tricky for append */ + fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, 0700); if (fd < 0) return NULL;