Hi, All
I'm back again. I need some help to change directory permissions on Win XP
using Win32-Perms or anything else that works (desperation here).
Specifically, I am trying to add an ACE for a single user account to an
existing ACL containing other user accounts. Here is the simple code:

use Win32::Perms;
my $DirObj = new Win32::Perms("dir:c:\\temp\\test");
$DirObj -> Add( { Account=>'FTP Users', Mask=>READ, Type=>Allow,
Flag=>0x00000003 } );
my $GLE = Win32->GetLastError;
$DirObj -> Set();
$DirObj ->Dump;
$DirObj -> Close();

On Win2000 the above produces $GLE=53 (The network path was not found).
On WinXP the above produces $GLE=997 (Overlapped I/O operation is in
progress).
$DirObj appears to be created but the Add() method causes a delay of a few
seconds then the error is thrown.

I curently use WIN32::Perms in a standalone app to set permissions on
several folders. Here is one example. The apparent difference is the dir
perms are first removed then all are again re-added recursively. This is a
kludge but seems to work. But I don't think I can use this same approach
without rebuilding the perms for the entire directory structure.

if( my $DirObj = new Win32::Perms( "dir:c:\\sms\\" )){
  $DirObj -> Remove( -1 ); # remove all permissions
  $DirObj -> Add({ Account=>'SAMS
Operators',Mask=>FULL,Type=>ALLOW,Flag=>0x00000003 });
  $DirObj -> Add({
Account=>'Administrators',Mask=>FULL,Type=>ALLOW,Flag=>0x00000013 });
  $DirObj -> Add({ Account=>'SYSTEM',Mask=>FULL,Type=>ALLOW,Flag=>0x00000013
});
  $DirObj -> Add({ Account=>'Users', Mask=>0x001200a9, Type=>ALLOW,
Flag=>0x00000013 });
  $DirObj -> Add({ Account=>'CREATOR OWNER',Mask=>0x001f01ff, Type=>ALLOW,
Flag=>0x0000001b });
  if( $DirObj -> SetRecurse("")){
        print LOG "Okay\n \n";
  }else{
        print LOG "FAIL: Cannot set permissions\n";
  }
  $DirObj -> Close();
}else{
        print LOG "FAIL: Cannot create object\n";
}

Any help is really appreciated.
Sturdy

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

Reply via email to