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

Package Resource isn't searching 64-bit Registry Hives #1100

Closed
seththoenen opened this issue Sep 19, 2016 · 2 comments
Closed

Package Resource isn't searching 64-bit Registry Hives #1100

seththoenen opened this issue Sep 19, 2016 · 2 comments
Milestone

Comments

@seththoenen
Copy link
Contributor

Description

The package resource should search additional registry hives if the system has a 64-bit architecture. This seems to not be functioning as intended.

InSpec and Platform Version

0.35 - Windows

Replication Case

64-bit packages that are installed and have registry keys under the following hives do not show as installed during Inspec tests:

HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
HKCU:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*

Possible Solutions

In order to load the additional 64-bit hives, there is an if statement that checks the architecture of the system to see if it matches x86_64. If so, it will add the additional registry hives to search over. However, the method that is supposed to return the architecture value (inspec.os.arch) returns a value of '64-bit' instead of x86_64 when on 64 bit editions of Windows Server

Changing the following line worked for my Inspec tests on Windows Server 2008 R2 and Windows Server 2012 R2:

/inspec/lib/resource/package.rb line 197

Current code: if inspec.os.arch == 'x86_64'
Proposed code: if inspec.os.arch == '64-bit'

Stacktrace

No stack trace is available for this issue.

@jerryaldrichiii
Copy link
Contributor

jerryaldrichiii commented Sep 19, 2016

@seththoenen, looks like the 64-bit value is coming from wmic os get * /format:list command located here.

Since that value is coming from Windows and the section of InSpec code you are referring to applies to Windows packages, I think your solution is valid.

@chris-rock
Copy link
Contributor

This has been solved with train 0.20.0 https://github.com/chef/train/releases/tag/v0.20.0 via inspec/train#151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants