in reply to Perms under WinNT4
Your code (slightly modified in a non-significant way) works fine on my NT4 box as
#! perl -w use Win32::Perms; sub AddGroupToDir { my ($group, $dir)=@_; my $perms = new Win32::Perms($dir) || die "\n$^E\n"; my $counter = $perms->Get(\ my @list); print "\nAccount '$group'\t Path " . $perms->Path() . "\n"; $perms->Add("$group", FULL|FULL, ACCESS_ALLOWED_ACE_TYPE, OBJECT_I +NHERIT_ACE | CONTAINER_INHERIT_ACE); if ($perms->Set()) { print "Account: '$group' was granted Full ACE permission to: ' +". $perms->Path() . "'", 0x00000000|0x00000040|0x00000000,"' Operation Successful"; } else { print "This particular operation has failed\n\n***PLEASE CONTA +CT THE ADMINISTRATOR***\n", 0x00000000|0x00000040|0x00000000,"Operation Failure"; } $perms->Close(); } AddGroupToDir( 'ALL', 'D:/TEMP' ); __END__ C:\test>189474 Account 'ALL' Path D:\TEMP Account: 'ALL' was granted Full ACE permission to: 'D:\TEMP'64' Operat +ion Successful C:\test>
I ran it whilst logged on as Administrator.
My first guess is that the account you are running it under doesn't have permission to set or modify the permissions on the object you are modifying?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perms under WinNT4
by blackadder (Hermit) on Aug 14, 2002 at 15:33 UTC |