I get the feeling that Win32::FileSecurity tries to do the inheritance stuff automagically. I use Win32::Perms for my work as it seems to expose more functionality. Doing the same script with Win32::Perms seems not to have the same problems as the code you posted. Here is my Win32::Perms version:

use Win32::Perms; $cart='TestingFolder'; mkdir $cart || warn $!; # Create a new Security Descriptor and auto import permissions # from the directory $Dir = new Win32::Perms( $cart ) || die; my @perms; my $perm; $Dir->Get(\@perms); my $index = 0; $Dir->Dump; do { $perm = $perms[$index]; } while ($perm->{'Account'} ne 'Everyone') and (++$index); # One of three ways to remove an ACE print ($Dir->Remove($index)); $Dir->Set(); $Dir->Dump;
--blm--

ps you may notice that I don't use $Dir->Remove('Everyone'), This is because I could not get it to delete any ACEs. So I compute the index of the ACE in the ACL and delete based on that. I will investigate this further.


In reply to Re: Re: Re: win32 ACL problem. by blm
in thread win32 ACL problem. by Discipulus

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.