You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@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.
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 ofx86_64
when on 64 bit editions of Windows ServerChanging 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.
The text was updated successfully, but these errors were encountered: