To: vim-dev@vim.org Subject: Patch 6.1.147 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.148 (extra) Problem: MS-Windows: ACL is not properly supported. Solution: Add an access() replacement that also works for ACL. (Mike Williams) Files: runtime/doc/editing.txt, src/os_win32.c *** ../vim61.147/runtime/doc/editing.txt Fri Mar 22 21:18:36 2002 --- runtime/doc/editing.txt Mon Jun 10 20:54:44 2002 *************** *** 1102,1109 **** Vim attempts to preserve the ACL info when writing a file. The backup file will get the ACL info of the original file. The ACL info is also used to check if a file is read-only (when opening the ! file). Not for MS-Windows though, because the ACL library functions are ! buggy. *write-device* When the file name is actually a device name, Vim will not make a backup (that --- 1102,1116 ---- Vim attempts to preserve the ACL info when writing a file. The backup file will get the ACL info of the original file. The ACL info is also used to check if a file is read-only (when opening the ! file). ! ! *read-only-share* ! When MS-Windows shares a drive on the network it can be marked as read-only. ! This means that even if the file read-only attribute is absent, and the ACL ! settings on NT network shared drives allow writing to the file, you can still ! not write to the file. Vim on Win32 platforms will detect read-only network ! drives and will mark the file as read-only. You will not be able to override ! it with |:write|. *write-device* When the file name is actually a device name, Vim will not make a backup (that *** ../vim61.147/src/os_win32.c Wed May 15 22:00:04 2002 --- src/os_win32.c Sun Aug 4 20:50:41 2002 *************** *** 4012,4024 **** } /* ! * mch_access() was used to support ACLs under Windows NT/2K/XP(?). ! * Unfortunately the ACL system functions are buggy, we couldn't make it work, ! * removed for now. * Returns 0 if file "n" has access rights according to "p", -1 otherwise. */ int mch_access(char *n, int p) { ! return access(n, p); } --- 4020,4042 ---- } /* ! * mch_access() extends access() to do more detailed check on network drives. * Returns 0 if file "n" has access rights according to "p", -1 otherwise. */ int mch_access(char *n, int p) { ! HANDLE hFile; ! DWORD am; ! ! /* Trying to open the file for the required access does ACL, read-only ! * network share, and file attribute checks. ! */ ! am = ((p & W_OK) ? GENERIC_WRITE : 0) ! | ((p & R_OK) ? GENERIC_READ : 0); ! hFile = CreateFile(n, am, 0, NULL, OPEN_EXISTING, 0, NULL); ! if (hFile == INVALID_HANDLE_VALUE) ! return -1; ! CloseHandle(hFile); ! return 0; } *** ../vim61.147/src/version.c Sun Aug 4 20:56:30 2002 --- src/version.c Sun Aug 4 21:00:31 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 148, /**/ -- From "know your smileys": <|-) Chinese <|-( Chinese and doesn't like these kind of jokes /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///