Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 10th, 2003, 09:28 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remote Registry

Hi all,

I realise this is more a Windows NT security question than a C++ specific question but perhaps some one can help.

I'm connecting to the registry on a remote computer and looking to read a value from the registry key (on the remote host) called:-

HKEY_LOCAL_MACHINE\SOFTWARE\MyApp

There is a value in this key called "MyValue". All I need is read access and the security descriptor for this key (and all it's parent keys) provide read access to the "Everyone" group.

When I try and open the key I get an access denied error message. The only way I can read the data is if I add my user account to the Adminstrators group on the remote host.

The Administrators group provides too much access (read/write/delete etc.) where as I only want standard users to be able to see the data.

I'm using windows API registry functions throughout.

Can anyone tell me what's going on?

Cheers,
Kep.


__________________
Kep.
Reply With Quote
  #2 (permalink)  
Old August 27th, 2003, 06:29 PM
Authorized User
 
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default


Registries have DACLs / CACLS (discretinoary access control lists / system access control lists ) just like normal files [1]. You can add your username to the ACL of the registry key in question by following the procedure:

  1.) open the remote registry with your registry editor (regedit should work on XP, but on some older versions of NT you may need to specify regedt32 to see the ACLs).
  2.) Right-click on the hive / key in question and go to permissions
  3.) Wala -- a familiar looking security dialog box should pop up. Add your username and specify permissions.

  You should now be able to access said registry key.

  [1] actually, all objects in NT managed by the ORM/Executive have ACLs.

Regards,
Meredith Shaebanyan

Reply With Quote
  #3 (permalink)  
Old August 27th, 2003, 07:04 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Meredith, I tried what you suggested and added the username to the DACL for the registry key's they need access to. If you log on to the PC locally then they have access. If you connect to the registry remotely then it still denies access.

I'm using NT server 4.0, maybe there is something special about the Administrators group when connecting to remote registries?

Thanks for your help,
Kep.

Reply With Quote
  #4 (permalink)  
Old September 18th, 2003, 05:39 PM
Authorized User
 
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default

Kep,

 you need to add the key you want to edit remotely to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\SecurePipeServers\winreg\AllowedPaths

  by default only Administrators can remotely edit the registry. I had never run up against this before because I typically only programaticaly access the registry for things that require admin privlages anyway, and therefore run from an admin account.

Regards
Meredith Shaebanyan

Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Fetch Licence key from Remote Registry saumya Visual Studio 2005 0 December 3rd, 2007 11:32 PM
remote registry ingormation saumya Visual Studio 2005 0 November 28th, 2007 04:23 AM
remote registry access alex_smotritsky General .NET 2 November 28th, 2007 02:53 AM
remote registry carelfrik Access VBA 2 October 28th, 2005 02:18 PM
Remote Registry Kep VB How-To 1 August 13th, 2003 04:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.