Hello,

I'm trying to load in a hive and then modify the rights within the hive
using Perms.  Dump shows the update but the permissions don't stick and the
hive also deosn't get unladed.  Going in with REGEDT32 shows the hive still
attached and the old right intact.  I can unload the hive from regedt32 and
start the process over again with the same results.

Does anyone see anything?

Can Perms handle a loaded hive?

Regards,

-Paul


#
# Modules
#

use strict;
use Win32::Registry;
use Win32::Perms;

my $currentPerm;
my @dumpperms;
my $setPath;
my $hkey;
my $subkey = "MyKey" . $ARGV[0];
my $tempsubkey;

if ($main::HKEY_USERS->Connect("", $hkey)) {
    print "Have HKEY_USERS Connected\n";
}

$hkey->Load($subkey, $ARGV[0] . ".usr");

$hkey->Open($subkey, $tempsubkey);

print "*** Before ***\n";

$setPath = "registry:HKEY_USERS\\MyKey" . $ARGV[0];

$currentPerm = new Win32::Perms( $setPath,
$win32::Perms::PERM_TYPE_REGISTRY);

print "\$currentPerm->Dump(\@perms): " . $currentPerm->Dump(\@dumpperms) .
"\n";

$currentPerm->Dump();
$currentPerm->Remove($ARGV[1]);
                                #direct mask and type for a full control reg
key
$currentPerm->Allow($ARGV[1], 0x000f003f, 2);
$currentPerm->SetRecurse($setPath);
$currentPerm->Set();

print "*** After ***\n";
print "\$currentPerm->Dump(\@perms): " . $currentPerm->Dump(\@dumpperms) .
"\n";

$currentPerm->Dump();

#tried reordering next 2 statements
$tempsubkey->Save($ARGV[0] . ".new");

$tempsubkey->UnLoad($subkey);

$tempsubkey->Close();

$currentPerm->Close();

exit 0;

__END__


---
You are currently subscribed to perl-win32-users as: [[email protected]]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to