diff --git a/ChangeLog b/ChangeLog
index dad868aaef511ccea769deec0bbc843b2104e085..db668b0fae980d26c6bcbc28b97582f6f5cb54bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
+2009-11-19 Chris Allegretta <chrisa@asty.org>
+	* nano.c (die_save_file) Try nd match the permissions of the file we were
+	  editing but only make a minimal effort to do so. Fixes Savannah bug 27273
+	  reported by Mike Frysinger.
+
 2009-11-18 Adrian Bunk <bunk via Savannah>
-	* nano.c (main) - Allow --fill and --nowrap to override nanorc entries and each other
+	* nano.c (main): Allow --fill and --nowrap to override nanorc entries and each other
           on the command line.
 
 2009-11-15 Chris Allegretta <chrisa@asty.org>
diff --git a/src/nano.c b/src/nano.c
index 1ef7b5fa41caf161c0bdfe0c30792c4437c0f3ee..7562c712756aa166e6af0ceb4b200283510b41a9 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -638,7 +638,7 @@ void die(const char *msg, ...)
 	if (filepart != NULL)
 	    unpartition_filestruct(&filepart);
 
-	die_save_file(openfile->filename);
+	die_save_file(openfile->filename, openfile->current_stat);
     }
 
 #ifdef ENABLE_MULTIBUFFER
@@ -651,7 +651,7 @@ void die(const char *msg, ...)
 
 	    /* Save the current file buffer if it's been modified. */
 	    if (openfile->modified)
-		die_save_file(openfile->filename);
+		die_save_file(openfile->filename, openfile->current_stat);
 	}
     }
 #endif
@@ -662,7 +662,7 @@ void die(const char *msg, ...)
 
 /* Save the current file under the name spacified in die_filename, which
  * is modified to be unique if necessary. */
-void die_save_file(const char *die_filename)
+void die_save_file(const char *die_filename, struct stat *die_stat)
 {
     char *retval;
     bool failed = TRUE;
@@ -691,6 +691,15 @@ void die_save_file(const char *die_filename)
 	fprintf(stderr, _("\nBuffer not written: %s\n"),
 		_("Too many backup files?"));
 
+    /* Try and chmod/chown the save file to the values of the original file, but
+       dont worry if it fails because we're supposed to be bailing as fast
+       as possible. */
+    if (die_stat) {
+	int shush;
+	shush = chmod(retval, die_stat->st_mode);
+	shush = chown(retval, die_stat->st_uid, die_stat->st_gid);
+    }
+
     free(retval);
 }
 
diff --git a/src/proto.h b/src/proto.h
index 436b15c4ecb805c94e78e455eb096e5dd745fbbc..1abbc4dc3fc2d7b8d5d96b1eca3ddef4fc5f6358 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -428,7 +428,7 @@ void free_openfilestruct(openfilestruct *src);
 void print_view_warning(void);
 void finish(void);
 void die(const char *msg, ...);
-void die_save_file(const char *die_filename);
+void die_save_file(const char *die_filename, struct stat *die_stat);
 void window_init(void);
 #ifndef DISABLE_MOUSE
 void disable_mouse_support(void);