Ran into this error when testing some ascii/utf-8 issues.
If I ran examples/read_file.rb against an empty file, it would return the following errors:
➜ examples git:(master) ruby read_file.rb 192.168.215.190 <redacted> <redacted> Share 抽.txt 2
SMB2 : (0x00000000) STATUS_SUCCESS: The operation completed successfully.
Connected to \\192.168.215.190\Share successfully!
/Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:88:in `rescue in recv_packet': An error occurred reading from the Socket Connection reset by peer (RubySMB::Error::CommunicationError)
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:63:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:540:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:467:in `send_recv'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/smb2/file.rb:92:in `close'
from read_file.rb:41:in `<main>'
/Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:70:in `read': Connection reset by peer (Errno::ECONNRESET)
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:70:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:540:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:467:in `send_recv'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/smb2/file.rb:92:in `close'
from read_file.rb:41:in `<main>'
➜ examples git:(master)
This was tested against a Windows 8 & Windows 10 VM.
Returns two errors:
RubySMB::Error::CommunicationErrorErrno::ECONNRESET
➜ examples git:(master) ruby read_file.rb 192.168.215.190 <redacted> <redacted> Share 抽.txt 2
SMB2 : (0x00000000) STATUS_SUCCESS: The operation completed successfully.
Connected to \\192.168.215.190\Share successfully!
/Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:88:in `rescue in recv_packet': An error occurred reading from the Socket Connection reset by peer (RubySMB::Error::CommunicationError)
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:63:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:540:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:467:in `send_recv'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/smb2/file.rb:92:in `close'
from read_file.rb:41:in `<main>'
/Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:70:in `read': Connection reset by peer (Errno::ECONNRESET)
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/dispatcher/socket.rb:70:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:540:in `recv_packet'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/client.rb:467:in `send_recv'
from /Users/cgranleese/rapid7/ruby_smb/lib/ruby_smb/smb2/file.rb:92:in `close'
from read_file.rb:41:in `<main>'
➜ examples git:(master)
Ran into this error when testing some ascii/utf-8 issues.
If I ran
examples/read_file.rb
against an empty file, it would return the following errors:This was tested against a Windows 8 & Windows 10 VM.
Found while attempting tor replicate this issue.
Steps to reproduce
How'd you do it?
examples/read_file.rb
against an SMB share. e.g.Were you following a specific guide/tutorial or reading documentation?
Found while attempting tor replicate this issue.
Expected behavior
Should return no errors and just a blank output, e.g.
Current behavior
Returns two errors:
RubySMB::Error::CommunicationError
Errno::ECONNRESET