Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Win32API::Registry::RegGetKeySecurity how to unpack the structure of $pSecDesc? (misc)

by tye (Sage)
on Jan 13, 2006 at 12:31 UTC ( [id://523038]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Win32API::Registry::RegGetKeySecurity how to unpack the structure of $pSecDesc?
in thread Win32API::Registry::RegGetKeySecurity how to unpack the structure of $pSecDesc?

Unfortunately, no one has written (well, released, AFAIK) Win32API::Security and the modules I've seen that deal with security don't take the general approach I pushed for with Win32API::* so they don't handle security descriptors directly. For example, some only work on files.

I /have/ found Reg[GS]etKeySecurity() useful in cases, even so. I'd use the GUI to set the desired permissions on a reference key and then just copy those permissions to other keys (such a new keys) via my script.

I'd also use Win32::TieRegistry:

use Win32::TieRegistry( Delimiter => "/" ); my $sec; $Registry->{"LMachine/Software/7-Zip/"}->RegGetKeySecurity( 4, $sec, [ +] );

(Not recommending using "4" over importing the correct definitions from Win32, just being cheap and short for the sake of emphasizing the other aspects of the example.)

- tye        

  • Comment on Re^2: Win32API::Registry::RegGetKeySecurity how to unpack the structure of $pSecDesc? (misc)
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: Win32API::Registry::RegGetKeySecurity how to unpack the structure of $pSecDesc? (misc)
by Sioln (Sexton) on Jan 16, 2006 at 02:11 UTC

      You can call RegSetKeySecurity() on Win32::TieRegistry objects. No, Win32::FileSecurity only works on files, unfortunately.

      - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://523038]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.