windows_error library is used to handle NTStatus code errors. These are defined as constants in this library. It appears that the function used to retrieve a specific NTStatus code message performs a lookup using the Module.constants class method:
It assumes constants are always returned in the same order, which, apparently is not the case. When the status code numeric value has multiple entries (e.g. 0x00000000), this function returns an array containing all the corresponding entries. However, RubySMB::GenericPacket::status_code always takes the first one, which can be different depending on which system it is run.
I couldn't find any documentation about this, but done some testing:
On my system, for the NTStatus code value 0x00000000, STATUS_SUCCESS is returned first followed by STATUS_WAIT_0:
========== debug message: [#<WindowsError::ErrorCode:0x00007ff4c3297100 @name="STATUS_SUCCESS", @value=0, @description="The operation completed successfully.">, #<WindowsError::ErrorCode:0x00007ff4c3296f20 @name="STATUS_WAIT_0", @value=0, @description="The caller specified WaitAny for WaitType and one of the dispatcher objects in the Object array has been set to the signaled state.">]
On the Github worker, STATUS_WAIT_0 is returned first:
========== debug message: [#<WindowsError::ErrorCode:0x000055eb0335b5f8 @name="STATUS_WAIT_0", @value=0, @description="The caller specified WaitAny for WaitType and one of the dispatcher objects in the Object array has been set to the signaled state.">, #<WindowsError::ErrorCode:0x000055eb0335b698 @name="STATUS_SUCCESS", @value=0, @description="The operation completed successfully.">]
This is the reason why these specs are failing on Github workers.
windows_error
library is used to handleNTStatus
code errors. These are defined as constants in this library. It appears that the function used to retrieve a specificNTStatus
code message performs a lookup using theModule.constants
class method:https://github.com/rapid7/windows_error/blob/3aa1cd06ff0ea94bc32142a7acd086df397a57ee/lib/windows_error/nt_status.rb#L14-L24
It assumes constants are always returned in the same order, which, apparently is not the case. When the status code numeric value has multiple entries (e.g. 0x00000000), this function returns an array containing all the corresponding entries. However,
RubySMB::GenericPacket::status_code
always takes the first one, which can be different depending on which system it is run.I couldn't find any documentation about this, but done some testing:
NTStatus
code value 0x00000000,STATUS_SUCCESS
is returned first followed bySTATUS_WAIT_0
:STATUS_WAIT_0
is returned first:This is the reason why these specs are failing on Github workers.