summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-14 20:37:07 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-14 20:37:07 +0200
commitda4127794aa333631bde879e73bcfce4aef42f85 (patch)
tree668086dc92bbde7a1b2bc2a4535ca7611fddf1cc /src/fileio.c
parentf62e797ffa6ab5d4c476b4c9e9a1f7f852910652 (diff)
downloadvim-git-da4127794aa333631bde879e73bcfce4aef42f85.tar.gz
patch 7.4.2035v7.4.2035
Problem: On Solaris with ZFS the ACL may get removed. Solution: Always restore the ACL for Solaris ZFS. (Danek Duvall)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 14a6f31ba..235b412fa 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4709,9 +4709,17 @@ restore_backup:
if (perm >= 0) /* set perm. of new file same as old file */
(void)mch_setperm(wfname, perm);
#ifdef HAVE_ACL
- /* Probably need to set the ACL before changing the user (can't set the
- * ACL on a file the user doesn't own). */
+ /*
+ * Probably need to set the ACL before changing the user (can't set the
+ * ACL on a file the user doesn't own).
+ * On Solaris, with ZFS and the aclmode property set to "discard" (the
+ * default), chmod() discards all part of a file's ACL that don't represent
+ * the mode of the file. It's non-trivial for us to discover whether we're
+ * in that situation, so we simply always re-set the ACL.
+ */
+# ifndef HAVE_SOLARIS_ZFS_ACL
if (!backup_copy)
+# endif
mch_set_acl(wfname, acl);
#endif
#ifdef FEAT_CRYPT