From: Chris Allegretta Date: Sun, 17 Aug 2008 16:31:11 +0000 (+0000) Subject: 2008-08-08 Magnus Granberg / Adam Conrad X-Git-Tag: v2.0.8~1 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7031f2011fb7e413f1bcdd2c0e7c89b3cb04bbcf;p=nano.git 2008-08-08 Magnus Granberg / Adam Conrad * files.c: (write_file): Add needed flags to open() calls when writing out files. Fixes Savannah bug #23827: Compilation fails with -D_FORTIFY_SOURCE=2 git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_0_branch/nano@4307 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/files.c b/src/files.c index f4846360..f2371897 100644 --- a/src/files.c +++ b/src/files.c @@ -1564,7 +1564,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type } if (f_open == NULL) { - fd_source = open(realname, O_RDONLY | O_CREAT); + fd_source = open(realname, O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR); if (fd_source != -1) { f_source = fdopen(fd_source, "rb"); @@ -1683,7 +1683,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type int fd_source; FILE *f_source = NULL; - fd_source = open(tempname, O_RDONLY | O_CREAT); + fd_source = open(tempname, O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR); if (fd_source != -1) { f_source = fdopen(fd_source, "rb");