nano

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

commit 33084397ddb0b5c2a3b412ae19efed95b4523ea6
parent 38552ee7a85d5827d86412409a0ec7023e10d186
Author: Chris Allegretta <chrisa@asty.org>
Date:   Sat,  9 Dec 2000 22:50:38 +0000

More fun security crap


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@396 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
Mfiles.c | 11++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/files.c b/files.c @@ -335,15 +335,12 @@ int write_file(char *name, int tmp) to reflect whether or not to link/unlink/rename the file */ else if (ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(lst.st_mode) || tmp) { - /* Use O_EXCL if tmp == 1, I suppose */ + /* Use O_EXCL if tmp == 1. This is now copied from joe, because + wiggy says so *shrug* */ if (tmp) - fd = open(realname, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | - S_IWOTH); + fd = open(realname, O_WRONLY | O_CREAT | O_EXCL, (S_IRUSR|S_IWUSR)); else - fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | - S_IWOTH); + fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC, (S_IRUSR|S_IWUSR)); /* First, just give up if we couldn't even open the file */ if (fd == -1) {