Commit 331fc7a6 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Okay, now write_file never trusts symlinks at all, no chance of spelling symlink attack :)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@360 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent c5174aae
No related merge requests found
Showing with 2 additions and 2 deletions
+2 -2
...@@ -327,7 +327,7 @@ int write_file(char *name, int tmp) ...@@ -327,7 +327,7 @@ int write_file(char *name, int tmp)
lstat(realname, &st); lstat(realname, &st);
/* Open the file and truncate it. Trust the symlink. */ /* Open the file and truncate it. Trust the symlink. */
if ((ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(st.st_mode)) && !tmp) { if (!tmp && (ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(st.st_mode))) {
if ((fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC, if ((fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-12-01 21:39-0500\n" "POT-Creation-Date: 2000-12-01 22:06-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment