Loading ...
Sorry, an error occurred while loading the content.
 

[PATCH] Fix problems of getting/setting ACL on Win32 (Preserve Cygwin file mode)

Expand Messages
  • Ken Takata
    Hi all, 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()
    Message 1 of 5 , Aug 29, 2012
      Hi all,

      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

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... Thanks! I ll add a note in the todo list. -- FATHER: One day, lad, all this will be yours ... PRINCE: What - the curtains? Monty Python and the Holy
      Message 2 of 5 , Aug 30, 2012
        Ken Takata wrote:

        > 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.)

        Thanks! I'll add a note in the todo list.

        --
        FATHER: One day, lad, all this will be yours ...
        PRINCE: What - the curtains?
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Ken Takata
        Hi Bram, ... 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
        Message 3 of 5 , Aug 31, 2012
          Hi Bram,

          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

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Ken Takata
          Hi, ... I wrote an additional patch to support ACL when compiled with MinGW. (Current MinGW and Cygwin have the ACL stuff, but I don t know when they support
          Message 4 of 5 , Dec 29, 2012
            Hi,

            2012/08/31 Fri 20:33:24 UTC+9 Ken Takata wrote:
            > Hi Bram,
            >
            > 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

            I wrote an additional patch to support ACL when compiled with MinGW.
            (Current MinGW and Cygwin have the ACL stuff, but I don't know when
            they support it.)

            Regards,
            Ken Takata

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Bram Moolenaar
            ... Thanks. I m seriously running behind in including patches, I m afraid.... -- You mean there really is an answer? Yes! But you re not going to like it!
            Message 5 of 5 , Dec 29, 2012
              Ken Takata wrote:

              > 2012/08/31 Fri 20:33:24 UTC+9 Ken Takata wrote:
              > > Hi Bram,
              > >
              > > 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
              >
              > I wrote an additional patch to support ACL when compiled with MinGW.
              > (Current MinGW and Cygwin have the ACL stuff, but I don't know when
              > they support it.)

              Thanks. I'm seriously running behind in including patches, I'm
              afraid....

              --
              "You mean there really is an answer?"
              "Yes! But you're not going to like it!"
              "Oh do please tell us!"
              "You're really not going to like it!"
              "but we MUST know - tell us"
              "Alright, the answer is...."
              "yes..."
              "... is ..."
              "yes... come on!"
              "is 42!"
              (Douglas Adams - The Hitchhiker's Guide to the Galaxy)

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            Your message has been successfully submitted and would be delivered to recipients shortly.