Hi all,

I'm trying to write a script for all my NT servers that performs some
security checking.  Part of the script takes a snapshot of all the shares
(with the share level permissions) on the servers and then stores them in a
log file.  The next day the script runs again and creates a new log file.
The two files are compared and any changes are mailed to me.  Everything was
going fine until I extended the list of servers that was checked and now the
program crashes with a Dr Watson error.  Here is part of the script - 


$ShareOb = new Win32::Perms("\\\\$Server\\$Share") or die "Can't create new
perms object ($^E)\n";
$ShareOb->Dump( \@List ) || die "Can't dump ($^E)\n";;
$count++;
$ShareOb->Close;
foreach $item (@List) {
        Win32::Perms::DecodeMask( $item, \@Mask, \@FriendlyMask);
        next unless ${$item}{Account};
        #warn "$item\n";
        if (${$item}{Mask} eq "1179817") {
                $FriendlyMask[0] = "READ";
        }
        $FMask = $FriendlyMask[0];
        $FMask =~ s/FULL_SHARE/FULL/;
        $FMask =~ s/CHANGE_SHARE/CHANGE/;
        print ":SHARE , $Server , $Share , ${$item}{Account} , $FMask\n";
}

warn "$count\n";


At this point in the script the code is inside two loops, the first is a for
each loop on all the servers and inside that a while loop on each share for
that server so $Server is set to the server currently being checked and
$Share is each share on that server.  The problem is being caused by the
line -

$ShareOb->Dump( \@List ) || die "Can't dump ($^E)\n";

I thought at first that it might be a particular share that causes it to
crash but it isn't and I have tried to remove certain servers from the list
but it still crashes at some point.  I'm convinced it's some sort of memory
error.

Any ideas anyone????


Darin

Darin Cruickshanks, Labs Co-Ordinator
Systems Programmer, Computing Service
University of Essex
E-Mail - [EMAIL PROTECTED]
Phone - 01206 873585

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

Reply via email to