On Sun, 16 Nov 2003 14:07 , [EMAIL PROTECTED] sent:

>$object = $wmi-> Get("CIM_LogicalFile='$Fpath'");
>This appears to do the same thing.  Or is it different?

I'm pretty sure it's the same.

>When a directory/file is inheriting permissions and inheritence is disabled using 
>this sub the inherited permissions are automatically copied to 
the directory/file.  How would I remove the inherited permissions and disable 
inheritance without removing non-inherited permissions?

I ran into this as well. There may be a better way but here's what I did...

Either before or after you disable inheritance, loop through all of the ACEs and 
remove the ones that are inherited by checking for the 
INHERITED_ACE flag. If you're using WIN32::Perms, you can do something like this:


my $dirObj = new Win32::Perms( $dir );
# Get a list of ACEs
$dirObj->Get( [EMAIL PROTECTED] );

foreach $ace (@aceList) {
        # Skip SACLs
        next unless( "DACL" eq $ace->{Entry} );

        DecodeFlag( $ace, [EMAIL PROTECTED] );
        foreach (@flagVals) {
                if (/INHERITED_ACE/) { 
                        # -- REMOVE ACE -- #
                }
        }
}

-Shawn


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to