]> granicus.if.org Git - vim/commitdiff
patch 7.4.2035 v7.4.2035
authorBram Moolenaar <Bram@vim.org>
Thu, 14 Jul 2016 18:37:07 +0000 (20:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 14 Jul 2016 18:37:07 +0000 (20:37 +0200)
Problem:    On Solaris with ZFS the ACL may get removed.
Solution:   Always restore the ACL for Solaris ZFS. (Danek Duvall)

src/fileio.c
src/version.c

index 14a6f31baa48075e4dce25297e5c77c060f1208a..235b412fa9d8d4e880ac5356a8732ea4978bc629 100644 (file)
@@ -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
index af29306e12d56b3421c32c712f64b57f75b56c98..0dfb7593b83f08786352d250b269c2f3f35597db 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2035,
 /**/
     2034,
 /**/