aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/w32.c b/src/w32.c
index 47b950668b0..9ebc97088d0 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -4876,8 +4876,31 @@ acl_set_file (const char *fname, acl_type_t type, acl_t acl)
4876 retval = 0; 4876 retval = 0;
4877 errno = e; 4877 errno = e;
4878 } 4878 }
4879 else if (err == ERROR_INVALID_OWNER) 4879 else if (err == ERROR_INVALID_OWNER || err == ERROR_NOT_ALL_ASSIGNED)
4880 errno = EPERM; 4880 {
4881 /* Maybe the requested ACL and the one the file already has are
4882 identical, in which case we can silently ignore the
4883 failure. (And no, Windows doesn't.) */
4884 acl_t current_acl = acl_get_file (fname, ACL_TYPE_ACCESS);
4885
4886 errno = EPERM;
4887 if (current_acl)
4888 {
4889 char *acl_from = acl_to_text (current_acl, NULL);
4890 char *acl_to = acl_to_text (acl, NULL);
4891
4892 if (acl_from && acl_to && xstrcasecmp (acl_from, acl_to) == 0)
4893 {
4894 retval = 0;
4895 errno = e;
4896 }
4897 if (acl_from)
4898 acl_free (acl_from);
4899 if (acl_to)
4900 acl_free (acl_to);
4901 acl_free (current_acl);
4902 }
4903 }
4881 else if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND) 4904 else if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)
4882 errno = ENOENT; 4905 errno = ENOENT;
4883 4906