updated for version 7.1-296
diff --git a/src/fileio.c b/src/fileio.c
index bcabbff..95970a3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3651,6 +3651,9 @@
 						)
 			    mch_setperm(backup,
 					  (perm & 0707) | ((perm & 07) << 3));
+# ifdef HAVE_SELINUX
+			mch_copy_sec(fname, backup);
+# endif
 #endif
 
 			/*
@@ -3687,6 +3690,9 @@
 #ifdef HAVE_ACL
 			mch_set_acl(backup, acl);
 #endif
+#ifdef HAVE_SELINUX
+			mch_copy_sec(fname, backup);
+#endif
 			break;
 		    }
 		}
@@ -4309,6 +4315,12 @@
     }
 #endif
 
+#ifdef HAVE_SELINUX
+    /* Probably need to set the security context. */
+    if (!backup_copy)
+	mch_copy_sec(backup, wfname);
+#endif
+
 #ifdef UNIX
     /* When creating a new file, set its owner/group to that of the original
      * file.  Get the new device and inode number. */