hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
713 stars 180 forks source link

Issue #614: Add option to override asymmetric share #616

Open pranaysharmamanulife opened 3 years ago

pranaysharmamanulife commented 3 years ago

Issue-614: Add option to override asymmetric share

hierynomus commented 3 years ago

Adding support for _asymmetric` shares is a bit more involved than the implementation in this PR:

If Connection.Dialect is "3.0.2" or "3.1.1" and the Capabilities field in the response includes the SMB2_SHARE_CAP_ASYMMETRIC bit, the client MUST verify whether both of the following conditions are true:

  • Connection.SessionTable contains only one entry.
  • Session.TreeConnectTable contains only one entry. If either of the preceding conditions is FALSE, the client MUST perform the following:
  • Disconnect the tree connection as specified in section 3.2.4.22.
  • Establish a new transport connection by providing the ServerName and TransportIdentifier used in the previous connection, as specified in section 3.2.4.2.1.
  • Send an SMB2 NEGOTIATE request on the new connection, as specified in section 3.2.4.2.2.2. The client also provides a newly generated Guid to be used as ClientGuid.
  • If the SMB2 NEGOTIATE request is successful, the client MUST create a new session on the new connection by sending an SMB2 SESSION_SETUP request, as specified in section 3.2.4.2.3. The client provides the UserCredentials used in the previous connection.
  • If the SMB2 SESSION_SETUP request is successful, the client MUST send an SMB2 TREE_CONNECT request, as specified in section 3.2.4.2.4. The client provides the ShareName used in the previous connection.
  • If the SMB2 TREE_CONNECT request is successful, the client SHOULD invoke the event as specified in [MS-SWN] section 3.2.4.1 by providing Connection.ServerName as the Netname parameter and TreeConnect.ShareName as the ShareName parameter, and by setting the IsShareNameNotificationRequired parameter to TRUE.

As such, I cannot merge it in its current state.