From 1bb24f85c4ba009c7c608beca1d7b96a522fdeee Mon Sep 17 00:00:00 2001 From: Edmund Dipple Date: Mon, 10 Feb 2014 12:57:12 +0000 Subject: [PATCH] prevent serverspec from hanging if checking a DWORD that doesn't contain 8 characters --- lib/specinfra/command/windows.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/specinfra/command/windows.rb b/lib/specinfra/command/windows.rb index fa92560b2..acdbd26c7 100644 --- a/lib/specinfra/command/windows.rb +++ b/lib/specinfra/command/windows.rb @@ -234,7 +234,7 @@ def convert_key_property_value property byte_array = [property[:value]].pack('H*').bytes.to_a "([byte[]] #{byte_array.join(',')})" when :type_dword - [property[:value].scan(/[0-9a-f]{2}/i).reverse.join].pack("H*").unpack("l").first + [property[:value].rjust(8, '0').scan(/[0-9a-f]{2}/i).reverse.join].pack("H*").unpack("l").first when :type_qword property[:value].hex else