runrig has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Win32::TieRegistry qw( Delimiter / KEY_READ KEY_WRITE ); use Win32 qw( DACL_SECURITY_INFORMATION SACL_SECURITY_INFORMATION ); my $path = 'LMachine/Software/Classes'; my $key1 = 'opendocument.WriterDocument.1'; my $key2 = 'opendocument.WriterGlobalDocument.1'; my $r = $Registry->{"$path/$key1"}; print $r->{"/"},"\n"; my $sec; $r->RegGetKeySecurity( DACL_SECURITY_INFORMATION, $sec, [] ); # Only have read access on this - but can manually run regedit # and change permissions my $r2 = $Registry->Open("$path/$key2", {Access => KEY_READ(), Delimit +er=>"/"}); #my $r2 = $Registry->{"$path/$key2"}; print $r2->{"/"},"\n"; $r2->RegSetKeySecurity( DACL_SECURITY_INFORMATION, $sec );
Update: Just to mention where I'm trying to go with this, there's a bug when you upgrade OpenOffice which causes insufficient permissions on these keys for users (works ok for Admin accounts), so I'd like to fix all permissions for keys in this path with keys or values that start with 'openoffice.' or 'soffice.'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 Registry permissions
by Anonymous Monk on Nov 14, 2006 at 12:25 UTC | |
|
Re: Win32 Registry permissions ($^E)
by tye (Sage) on Nov 14, 2006 at 18:46 UTC | |
by runrig (Abbot) on Nov 15, 2006 at 08:09 UTC | |
by tye (Sage) on Nov 15, 2006 at 08:34 UTC |