Skip to content

Shell WindowsRegistryKeyValue functionality broken for default key retrieval using trailing "\" #4119

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

Closed
1 task done
memcpy-rand-rand-rand opened this issue Aug 3, 2023 · 5 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@memcpy-rand-rand-rand
Copy link
Contributor

memcpy-rand-rand-rand commented Aug 3, 2023

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

In the Windows Registry, there is a notion of a "Default" key under a path, e.g.

image

The Windows APIs support this by asking for the key with name of empty string, "".

To support this in the WindowsRegistryKeyValue function without needing to supply a separate path and key, the function would look for a trailing \ on the path. If this is present, it would treat the path as asking for the (Default) key under the path before the trailing \.

It looks like during a refactor this functionality was broken.

The fix is relatively simple. Perhaps we need to also add a set of tests for the function in case of future refactor.

Theme

n/a

What OS are you seeing the problem on?

Windows

Which shell are you using?

cmd, powershell

Log output

n/a
@JanDeDobbeleer
Copy link
Owner

@memcpy-rand-rand-rand this code hasn't changed in a long time and I see this specific logic still in it so I'll have a look

@memcpy-rand-rand-rand
Copy link
Contributor Author

use of (Default) keys is quite rare, but I have a specific use-case I only just spotted wasn't working :)

I have a local fix. Feel free to assign the bug to me if you like and I'll remind myself of the branching etc process to get a PR done.

JanDeDobbeleer added a commit that referenced this issue Aug 3, 2023
@JanDeDobbeleer
Copy link
Owner

@memcpy-rand-rand-rand I have a fix ready, was rather silly

@memcpy-rand-rand-rand
Copy link
Contributor Author

Perfect, same as mine. Confirmed working, thanks 👍

Copy link

github-actions bot commented Feb 5, 2024

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants