I found that the current implementation of mch_get_acl() and mch_set_acl()
in os_win32.c does not work well. There are some causes:
1. mch_get_acl() tries to retrieve all security information (Owner, Group,
DACL and SACL), but it may fail because of lack of privileges.
SE_SECURITY_NAME privilege must be held and must be enabled to retrieve SACL.
2. Setting Owner or Group may also fail if the caller doesn't have enough
privileges.
3. mch_[gs]et_acl() functions don't support multibyte characters at all.
I wrote a patch to fix these problems.
(Also available at https://gist.github.com/3489193 )
This patch may also fix a problem of Cygwin file modes.
(e.g. https://groups.google.com/d/topic/vim_dev/gEQe2esLPAc/discussion )
Even if 'backupcopy' is set to 'auto' or 'no', Cygwin file modes will be
preserved. (Cygwin file modes are stored as DACL.)
Best regards,
Ken Takata
2012/08/31 Fri 5:58:30 UTC+9 Bram Moolenaar:
> Thanks! I'll add a note in the todo list.
I have updated the patch. (Also available at the same gist URL.)
Now, the inheritance of a DACL is preserved. Maybe it is useful for
non-cygwin files.
I hope this patch and my symlink patch (https://groups.google.com/d/msg/vim_dev/qF8Y3xtUP-w/opEIDRL94qoJ)
make ':set backupcopy=auto' option more useful.
--
Best regards,
Ken Takata