Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: Re: win32 ACL problem.

by blm (Hermit)
on Sep 25, 2002 at 08:40 UTC ( [id://200585]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: win32 ACL problem.
in thread win32 ACL problem.

I made mistakes in this script. On line 4 it should read

mkdir $cart or warn $!;

(I should listen to my own advice)

Also it fails if there is no ACE with everyone as the account. So I rejigged it as follows.

use Win32::Perms; ### # # get_index_of($account_name, $ace) # # Return an array of positions of ACEs # with trustee of $account_name or if called # in scalar context the index of the first matching ACE # ### sub get_index_of { my ($account_name, $ace) = @_; my $index = -1; my @positions; do { $index++; print "$index"; $perm = $$ace[$index]; print $perm; if ($perm->{'Account'} eq $account_name) { push @positions, $i +ndex }; } while ($index < $#$ace); wantscalar and return $positions[0]; return @positions; } $cart='TestingFolder'; mkdir $cart or warn $!; # Create a new Security Descriptor and auto import permissions # from the directory my @perms; my $perm; my $Dir = new Win32::Perms( $cart ) or die; $Dir->Get(\@perms) or die; #Get permissions $Dir->Dump; my $acl_index = get_index_of('Everyone', \@perms); print "Returned ", $acl_index; print $perm->{'Account'}; if (defined $acl_index) { $Dir->Remove($acl_index) or die $!; $Dir->Set() or die$!; } $Dir->Dump;

If you --me can you let me know so I can learn?

--blm--

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://200585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-18 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found