home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.268 < prev    next >
Encoding:
Internet Message Format  |  2002-02-21  |  4.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.268
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.268 (extra) (depends on patch 6.0.255)
  11. Problem:    Win32: ACL check crashes when using forward slash in file name.
  12. Solution:   Improve the check for the path in the file name.
  13. Files:        src/os_win32.c
  14.  
  15.  
  16. *** ../vim60.267/src/os_win32.c    Thu Feb 21 20:34:10 2002
  17. --- src/os_win32.c    Fri Feb 22 16:48:07 2002
  18. ***************
  19. *** 4054,4095 ****
  20.    * GetEffectiveRightsFromAcl() (Vince Negri)
  21.    */
  22.       static int
  23. ! do_acl_check(char* n)
  24.   {
  25. !     DWORD   max_comp_len;
  26. !     DWORD   file_sys_flags;
  27. !     static char* file_root = NULL;
  28. !     static int file_root_len = 0;
  29. !     int     new_file_root_len;
  30. !     char*   file_root_end;
  31.   
  32.       /* Extract file root path */
  33. !     file_root_end = vim_strrchr(n, '\\');
  34. !     new_file_root_len = file_root_end - n + 1;
  35.       if (new_file_root_len > file_root_len)
  36.       {
  37.           vim_free(file_root);
  38. !         file_root = (char*)alloc(new_file_root_len + 1);
  39.           file_root_len = new_file_root_len;
  40.       }
  41.       STRNCPY(file_root, n, new_file_root_len);
  42. !     file_root[new_file_root_len] = '\0';
  43.   
  44.       /* Check #1 - can we get volume information in the first place? */
  45.       if (!GetVolumeInformation(file_root, NULL, 0, NULL, &max_comp_len,
  46. !                                                       &file_sys_flags, NULL, 0))
  47.           return FALSE;
  48.   
  49.       /* Check #2 - does the file system support ACLs at all? */
  50. !     if (!(file_sys_flags&FS_PERSISTENT_ACLS))
  51.           return FALSE;
  52.   
  53.       /* Check #3 - does it look like a Samba file system?  Current guess is that
  54.        * they are the only ones that are case sensitive/preserving but do not
  55.        * support Unicode file names. */
  56. !     if ((file_sys_flags&
  57. !              (FS_CASE_IS_PRESERVED|FS_CASE_SENSITIVE|FS_UNICODE_STORED_ON_DISK))
  58. !                                     == (FS_CASE_IS_PRESERVED|FS_CASE_SENSITIVE))
  59.           return FALSE;
  60.   
  61.       /* The file system supports ACLs - do the check */
  62. --- 4054,4093 ----
  63.    * GetEffectiveRightsFromAcl() (Vince Negri)
  64.    */
  65.       static int
  66. ! do_acl_check(char *n)
  67.   {
  68. !     DWORD    max_comp_len;
  69. !     DWORD    file_sys_flags;
  70. !     static char *file_root = NULL;
  71. !     static int    file_root_len = -1;
  72. !     int        new_file_root_len;
  73.   
  74.       /* Extract file root path */
  75. !     new_file_root_len = gettail(n) - n;
  76.       if (new_file_root_len > file_root_len)
  77.       {
  78.           vim_free(file_root);
  79. !         file_root = (char *)alloc(new_file_root_len + 1);
  80.           file_root_len = new_file_root_len;
  81.       }
  82.       STRNCPY(file_root, n, new_file_root_len);
  83. !     file_root[new_file_root_len] = NUL;
  84.   
  85.       /* Check #1 - can we get volume information in the first place? */
  86.       if (!GetVolumeInformation(file_root, NULL, 0, NULL, &max_comp_len,
  87. !                             &file_sys_flags, NULL, 0))
  88.           return FALSE;
  89.   
  90.       /* Check #2 - does the file system support ACLs at all? */
  91. !     if (!(file_sys_flags & FS_PERSISTENT_ACLS))
  92.           return FALSE;
  93.   
  94.       /* Check #3 - does it look like a Samba file system?  Current guess is that
  95.        * they are the only ones that are case sensitive/preserving but do not
  96.        * support Unicode file names. */
  97. !     if ((file_sys_flags
  98. !      & (FS_CASE_IS_PRESERVED|FS_CASE_SENSITIVE|FS_UNICODE_STORED_ON_DISK))
  99. !                   == (FS_CASE_IS_PRESERVED|FS_CASE_SENSITIVE))
  100.           return FALSE;
  101.   
  102.       /* The file system supports ACLs - do the check */
  103. *** ../vim60.267/src/version.c    Fri Feb 22 20:51:21 2002
  104. --- src/version.c    Fri Feb 22 20:53:37 2002
  105. ***************
  106. *** 608,609 ****
  107. --- 608,611 ----
  108.   {   /* Add new patch number below this line */
  109. + /**/
  110. +     268,
  111.   /**/
  112.  
  113. -- 
  114. hundred-and-one symptoms of being an internet addict:
  115. 7. You finally do take that vacation, but only after buying a cellular modem
  116.    and a laptop.
  117.  
  118.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  119. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  120. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  121.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  122.