Skip to content

Commit

Permalink
Fix response status code comparison that was not working with JRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
n00tmeg committed Nov 30, 2017
1 parent 3acb1ef commit 9cd9e43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ruby_smb/client/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def smb1_anonymous_auth
response = smb1_anonymous_auth_response(raw_response)
response_code = response.status_code

if response_code.name == 'STATUS_SUCCESS'
if response_code == WindowsError::NTStatus::STATUS_SUCCESS
self.user_id = response.smb_header.uid
self.peer_native_os = response.data_block.native_os.to_s
self.peer_native_lm = response.data_block.native_lan_man.to_s
Expand Down Expand Up @@ -89,7 +89,7 @@ def smb1_authenticate
response = smb1_ntlmssp_final_packet(raw)
response_code = response.status_code

@user_id = user_id if response_code.name == 'STATUS_SUCCESS'
@user_id = user_id if response_code == WindowsError::NTStatus::STATUS_SUCCESS

response_code
end
Expand Down

0 comments on commit 9cd9e43

Please sign in to comment.