Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reg.py to work with the registry properly #25618

Closed
twangboy opened this issue Jul 22, 2015 · 1 comment
Closed

Fix reg.py to work with the registry properly #25618

twangboy opened this issue Jul 22, 2015 · 1 comment
Assignees
Labels
Bug broken, incorrect, or confusing behavior Execution-Module P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module Windows
Milestone

Comments

@twangboy
Copy link
Contributor

The current reg.py thinks of registry keys as if they were python keys in a dictionary which is not the case. The windows registry is broken down into the following components:

Hives

This is the top level of the registry. They all begin with HKEY.

  • HKEY_CLASSES_ROOT (HKCR)
  • HKEY_CURRENT_USER(HKCU)
  • HKEY_LOCAL MACHINE (HKLM)
  • HKEY_USER (HKU)
  • HKEY_CURRENT_CONFIG

Keys

Hives contain keys. These are basically the folders beneath the hives. They can contain subkeys.

Values

Values are the name/data pairs beneath the keys and subkeys.

The following example is taken from the windows startup portion of the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"RTHDVCPL"="\"C:\\Program Files\\Realtek\\Audio\\HDA\\RtkNGUI64.exe\" -s"
"NvBackend"="\"C:\\Program Files (x86)\\NVIDIA Corporation\\Update Core\\NvBackend.exe\""
"BTMTrayAgent"="rundll32.exe \"C:\\Program Files (x86)\\Intel\\Bluetooth\\btmshellex.dll\",TrayApp"

In this example these are the values for each:
Hive: HKEY_LOCAL_MACHINE
Key and subkeys: SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Value: There are 3 values: RTHDVCPL, NvBackend, and BTMTrayAgent

The way reg.py works right now it does not differentiate between values and keys. It sees everything as a value.

@jfindlay jfindlay added Execution-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Windows P3 Priority 3 labels Jul 22, 2015
@jfindlay jfindlay added this to the Approved milestone Jul 22, 2015
@twangboy
Copy link
Contributor Author

Partially fixed with #25648
Need to add additional functionality to the execution module to be able to add and delete keys. It currently only deals with values.
reg execution module:

  • Need to add ability to delete a key and all subkeys
  • Need to clean up read_key, set_key, etc... to use new variable names

@twangboy twangboy modified the milestones: Be 0, Approved Aug 4, 2015
@twangboy twangboy self-assigned this Aug 4, 2015
@meggiebot meggiebot added the Platform Relates to OS, containers, platform-based utilities like FS, system based apps label Aug 14, 2015
@twangboy twangboy added Awesome and removed Awesome labels Aug 14, 2015
vtek21 added a commit to vtek21/salt that referenced this issue Sep 10, 2015
After updating to 2015.5.5 the state calls of win_path.exists suddenly were broken due to the change in the reg.py module.
This commit fixes the win_path.exists read_key implementation to fit the reg.read_value implementation that was discussed in saltstack#25618
rallytime pushed a commit to rallytime/salt that referenced this issue Sep 10, 2015
After updating to 2015.5.5 the state calls of win_path.exists suddenly were broken due to the change in the reg.py module.
This commit fixes the win_path.exists read_key implementation to fit the reg.read_value implementation that was discussed in saltstack#25618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module Windows
Projects
None yet
Development

No branches or pull requests

3 participants