diff options
Diffstat (limited to 'src/bufwrite.c')
-rw-r--r-- | src/bufwrite.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bufwrite.c b/src/bufwrite.c index 03a83b569a..bf79ad5bf3 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -1471,6 +1471,9 @@ buf_write( # if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(fname, backup); # endif +# ifdef FEAT_XATTR + mch_copy_xattr(fname, backup); +# endif #endif // copy the file. @@ -1506,6 +1509,9 @@ buf_write( #if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(fname, backup); #endif +#ifdef FEAT_XATTR + mch_copy_xattr(fname, backup); +#endif #ifdef MSWIN (void)mch_copy_file_attribute(fname, backup); #endif @@ -2196,11 +2202,18 @@ restore_backup: } #endif -#if defined(HAVE_SELINUX) || defined(HAVE_SMACK) +#if defined(HAVE_SELINUX) || defined(HAVE_SMACK) || defined(FEAT_XATTR) // Probably need to set the security context. if (!backup_copy) + { +#if defined(HAVE_SELINUX) || defined(HAVE_SMACK) mch_copy_sec(backup, wfname); #endif +#ifdef FEAT_XATTR + mch_copy_xattr(backup, wfname); +#endif + } +#endif #ifdef UNIX // When creating a new file, set its owner/group to that of the |