nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 90ad8e20b9e553dccc4d202fa7cc5ec1d9eeb1e6
parent 2cc58882f6f9b8c242c4d51cb59f645a1efb22c1
Author: Chris Allegretta <chrisa@asty.org>
Date:   Sun, 17 Aug 2008 16:25:40 +0000

2008-08-08 Magnus Granberg <zorry@ume.nu> / 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/trunk/nano@4306 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 4++++
Msrc/files.c | 4++--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-08 Magnus Granberg <zorry@ume.nu> / 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 + 2008-08-08 Chris Allegretta <chrisa@asty.org> * files.c (write_file): Check exit code of fclose(), since in certain out of space conditions the OS will happily report successful fwrite()s until you try and close the file. Fix for Savannah bug diff --git a/src/files.c b/src/files.c @@ -1588,7 +1588,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"); @@ -1707,7 +1707,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");