Mercurial > vim
comparison src/fileio.c @ 9509:e61974ab3ed0 v7.4.2035
commit https://github.com/vim/vim/commit/da4127794aa333631bde879e73bcfce4aef42f85
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 14 20:37:07 2016 +0200
patch 7.4.2035
Problem: On Solaris with ZFS the ACL may get removed.
Solution: Always restore the ACL for Solaris ZFS. (Danek Duvall)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 14 Jul 2016 20:45:06 +0200 |
parents | 69ed2c9d34a6 |
children | b2aada04d84e |
comparison
equal
deleted
inserted
replaced
9508:eab4723217e7 | 9509:e61974ab3ed0 |
---|---|
4707 perm &= ~0200; /* reset 'w' bit for security reasons */ | 4707 perm &= ~0200; /* reset 'w' bit for security reasons */ |
4708 #endif | 4708 #endif |
4709 if (perm >= 0) /* set perm. of new file same as old file */ | 4709 if (perm >= 0) /* set perm. of new file same as old file */ |
4710 (void)mch_setperm(wfname, perm); | 4710 (void)mch_setperm(wfname, perm); |
4711 #ifdef HAVE_ACL | 4711 #ifdef HAVE_ACL |
4712 /* Probably need to set the ACL before changing the user (can't set the | 4712 /* |
4713 * ACL on a file the user doesn't own). */ | 4713 * Probably need to set the ACL before changing the user (can't set the |
4714 * ACL on a file the user doesn't own). | |
4715 * On Solaris, with ZFS and the aclmode property set to "discard" (the | |
4716 * default), chmod() discards all part of a file's ACL that don't represent | |
4717 * the mode of the file. It's non-trivial for us to discover whether we're | |
4718 * in that situation, so we simply always re-set the ACL. | |
4719 */ | |
4720 # ifndef HAVE_SOLARIS_ZFS_ACL | |
4714 if (!backup_copy) | 4721 if (!backup_copy) |
4722 # endif | |
4715 mch_set_acl(wfname, acl); | 4723 mch_set_acl(wfname, acl); |
4716 #endif | 4724 #endif |
4717 #ifdef FEAT_CRYPT | 4725 #ifdef FEAT_CRYPT |
4718 if (buf->b_cryptstate != NULL) | 4726 if (buf->b_cryptstate != NULL) |
4719 { | 4727 { |