Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
What is happening ? any suggestion welcome###globals my $vecchio = 'DOMAIN\old_user'; my $vec_usr = 'old_user'; my $vec_dom='DOMAIN'; my $nuovo= '\\MACHINE\new_user'; my $nuo_usr= 'new_user'; my $new_dom= 'MACHINE'; ########## # take the root &substitute_dacl($root) ################### sub substitute_dacl { my $path = shift; print"\n-------------\n$path\n"; $perm = new Win32::Perms($path)|| die "$!"; $perm->Dump(\@list); my $owner=$perm->Owner(); if ($owner eq $vecchio) {$perm->Owner($nuovo); print "owner: $owner\t";print "Change owner\n"} foreach $elem(@list) { if (${$elem}{'Account'} eq $vec_usr) { print"-------> $vec_usr in $path\n"; my %hash=( 'Account' =>$nuo_usr, 'Domain' =>$nuo_dom, 'Mask' =>${$elem}{'Mask'}, #take the old 'Type' =>${$elem}{'Type'}, #options 'Flag' =>${$elem}{'Flag'}, # as is ); $perm->Add(\%hash)||warn "No add..\n"; $perm->Remove($vec_usr)||warn "$^E $!";# FAILS & HUNG if ($perm->Set()){print "Set ok\n"}else{warn "$^E $!"} #system "cacls \"$path\" /E /R ${$elem}{'Domain'}\\${$elem}{'Acc +ount'}";#THIS WORK BUT TERRIBLE last; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::Perms Remove method
by dfaure (Chaplain) on Jun 14, 2004 at 09:26 UTC | |
|
Re: Win32::Perms Remove method
by bibo (Pilgrim) on Jun 14, 2004 at 16:14 UTC | |
by Discipulus (Canon) on Jun 15, 2004 at 08:10 UTC | |
by dfaure (Chaplain) on Jun 15, 2004 at 07:10 UTC | |
|
Re: Win32::Perms Remove method
by BrowserUk (Patriarch) on Jun 15, 2004 at 08:38 UTC | |
by Discipulus (Canon) on Jun 15, 2004 at 09:31 UTC | |
by BrowserUk (Patriarch) on Jun 15, 2004 at 10:03 UTC |