From ad8476eb7de8c99902e3207cf291863ff5afcbaa Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Fri, 9 Apr 2010 15:31:00 +0000
Subject: [PATCH] Sigh, left out O_EXCL from Dan's patch

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4497 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 src/files.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c
index 29c56d49..bbb06977 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1599,7 +1599,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
 	    goto cleanup_and_exit;
 	}
 
-	backup_fd = open(backupname, O_WRONLY | O_CREAT | O_APPEND,
+	backup_fd = open(backupname, O_WRONLY | O_CREAT | O_EXCL | O_APPEND,
 		S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
 	/* Now we've got a safe file stream.  If the previous open()
 	   call failed, this will return NULL. */
-- 
GitLab