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
First of all, thank you for the go-smb2. It works good. I cross against a small issue with smb202 server. Sessionid for smb202 is only set by the server if the status is success. If status more proccessing required, sessionid is 0.
I am able to make it working with this changes in session.go. Maybe it is not in the correct place.
func (s *session) recv(rr *requestResponse) (pkt []byte, err error) {
pkt, err = s.conn.recv(rr)
if err != nil {
return nil, err
}
// Added for SMB202, session id is only send if status success
if s.conn.dialect == SMB202 && s.sessionId == 0 && PacketCodec(pkt).Status() == uint32(STATUS_SUCCESS) {
s.sessionId = PacketCodec(pkt).SessionId()
}
if sessionId := PacketCodec(pkt).SessionId(); sessionId != s.sessionId {
return nil, &InvalidResponseError{fmt.Sprintf("expected session id: %v, got %v", s.sessionId, sessionId)}
}
return pkt, err
}
So maybe you can integrate it with your repository or put it in the correct place. Thank you.
The text was updated successfully, but these errors were encountered:
First of all, thank you for the go-smb2. It works good. I cross against a small issue with smb202 server. Sessionid for smb202 is only set by the server if the status is success. If status more proccessing required, sessionid is 0.
I am able to make it working with this changes in session.go. Maybe it is not in the correct place.
func (s *session) recv(rr *requestResponse) (pkt []byte, err error) {
pkt, err = s.conn.recv(rr)
if err != nil {
return nil, err
}
// Added for SMB202, session id is only send if status success
if s.conn.dialect == SMB202 && s.sessionId == 0 && PacketCodec(pkt).Status() == uint32(STATUS_SUCCESS) {
s.sessionId = PacketCodec(pkt).SessionId()
}
if sessionId := PacketCodec(pkt).SessionId(); sessionId != s.sessionId {
return nil, &InvalidResponseError{fmt.Sprintf("expected session id: %v, got %v", s.sessionId, sessionId)}
}
return pkt, err
}
So maybe you can integrate it with your repository or put it in the correct place. Thank you.
The text was updated successfully, but these errors were encountered: