Not sure where Perl comes into this, which Perl interface are you using? There are several and these will affect the answer.
There are also several layers of Win32 security APISs, and that depend on the version of Windows (NT4, 2000, XP, 2003, Vista all instoduced new security APIs).

Here is what I would do using C/C++/XS:
You can get an existing ACL using GetNamedSecurityInfo(), and then create ACEs with BuildExplicitAccessWithName(). You then merge the new ACEs with the 'old' ACL to create a new one, using SetEntriesInAcl() - I guess this is the guy you want.
You then set the new ACL into the object's security descriptor(SD) using SetNamedSecurityInfo().

I'm not sure what you have screwed up, maybe you wrote a bad SD? The DACL is not supposed to be searched if you are the owner, but it looks like the SID might be toast. If this is a file, try copying it to a non-secure filesystem (like FAT) and back again, always assuming you can get the copy to work. You might have to use an Administrator user for that.

update: OK, I missed that you are using cygwin.

In reply to Re: SetACL problems by cdarke
in thread SetACL problems by Skarlso

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.