Hi all,

I encountered the following major problem. I'm using Win32::Perms to set 
permissions on shares and directories.
When I'm executing the following code, the permissions on the shares (code 
not included) are created without any problem. The code for securing the 
directories is absolutetly the same as for the shares. But when I'm 
executing this code (processing a input file with informations about the 
shares / directories), this script randomly crashes with Dr.Watson. I 
found out, that the code , where I'm adding the permissions for the local 
administrators and the group is "the point of the crash". But hey, it 
works fine on 7 or 8 out of 10 directories and there is really nothing 
special about these directories, where the script crashes. These 
directories are created during execution of the script (the result after 
the crash is a newly created and shared directory with the correct 
share-permission, but the directory permissions are left default). The 
point that drives me crazy is that it works with the majority, but crashes 
with others ! I tried this several times, and I can't reproduce the 
behaviour, sometimes it crashes sometimes not...

Here is the code:
...
# define constants for permissions
$MaskAdmin = "FULL";
$MaskAccount = "CHANGE";
$Access = "Allow";
$Flags = "OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE";
...
# adjusting access rights on shared directory
# extract admin share for driveletter of share server
# create dir object for permissions
$PermObject = "\\\\$SHARESERVER\\$GROUPDIRSHARE\\$GROUPDIRDIR$Group\\";
if ($PermDir = new Win32::Perms( $PermObject ) ) {
...
}

# remove all standard ACE's from dir
if ($PermDir->Remove(-1) ) {
...
}
#*******************************************************************************************************************************
# create ACE's for the local admin group and the local owners group
$PermDir->Add( "$SHARESERVER\\Administrators", eval( uc $MaskAdmin ), 
eval( uc $Access ), eval( uc $Flags ) );
$PermDir->Add( "$SHARESERVER\\$Group", eval( uc $MaskAccount ), eval( uc 
$Access ), eval( uc $Flags ) );
if ($PermDir->Set() ) {
...
}
#********************************************************************************************************************************
$PermDir->Close();


By the way, I'm using AP 5.0.6 (Build 623), Win32::Perms 0.2000.02.16, 
both on Win2K Prof SP1 and NT 4.0 SP6a Server in a NT domain. My 
permissions are domain admin.
I also have tested these scripts completly local on my Win2K SP1 box (no 
domain, no network..) with the same result. I'm getting the following 
error:

The instruction at "0x77fac8ac" referenced memory at "0x00000000". The 
memory could not be "written".



Best regards,

Christian Kirn 
email [EMAIL PROTECTED]
www www.gaxi.de

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to