Well, I still don't know what I am doing wrong. I have stripped my anon sub
down to the basics and it's still not deleting the ACEs. Here is my modified
anon sub:
$acl->deleteAces( sub {
my $strsid = Win32::Security::SID::ConvertSidToStringSid($_->sid());
if ($strsid =~ /[MyRegEx]/) {
return 1;
} else {
return 0;
}
} );
The anon sub returns 1 if the string sid matches my regex and 0 if it doesn't.
My test folder isn't inheriting its ACL. I do have admin right on the test
folder and can modify it's ACL manually. Any ideas as to why this is not
working?
AG
________________________________
From: [EMAIL PROTECTED] on behalf of Giuoco, Aaron
Sent: Thu 7/13/2006 12:21 PM
To: [email protected]
Subject: Win32::Security deleteAces method question
I am having some problems using the deleteAces method for the Win32::Security
module. My entire script works properly up until the point where it actually
deletes the ACE. According to the documentation, the deleteAces method is
supposed to take an anonymous subroutine that will return 1 for the ACEs that
should be deleted. Here is my anon subroutine. What am I doing wrong?
$acl->deleteAces( sub {
my $strsid = Win32::Security::SID::ConvertSidToStringSid($_->sid());
my $objName =
getObjNameFromSid($ldapAtl,$ldapSBMI,$ldapSBM,$_->sid(),$strsid);
if ($strsid =~ /[regex]/) {
print DELLOG "Deleting $objName\n";
return 1;
} else {
if ($objName) {
print PROCLOG "$objName not deleted\n";
} else {
print PROCLOG "$strsid not deleted\n";
}
return 0;
}
} );
As you can see, I am trying to match the $strsid against a regex. This is to
remove SIDs from an old domain from our enterprise. It prints to DELLOG that
the object was deleted, but when I look back at my test directory the old SIDs
are still there. If I return 1 there, shouldn't the ACE be deleted?
AG
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs