Export (0) Print
Expand All

3.3.5.9.12 Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context

This section applies only to servers that implement the SMB 3.x dialect family.

If the create request also contains SMB2_CREATE_DURABLE_HANDLE_REQUEST context or SMB2_CREATE_DURABLE_HANDLE_RECONNECT context or SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 context, the server MUST fail the request with STATUS_INVALID_PARAMETER.

There is no processing done for "Path Name Validation" or "Open Execution" as listed in the section above.

The processing changes involved for this create context are:

  • The server MUST look up an existing open in the GlobalOpenTable by doing a lookup with the FileId.Persistent portion of the create context.

  • If the lookup fails, the server SHOULD<276> fail the request with STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" in section 3.3.5.9.

  • If Open.Lease is not NULL and Open.ClientGuid is not equal to the ClientGuid of the connection that received this request, the server MUST fail the create request with STATUS_OBJECT_NAME_NOT_FOUND.

  • If Open.Lease is not NULL and Open.FileName does not match the file name specified in the Buffer field of the SMB2 CREATE request, the server MUST fail the request with STATUS_INVALID_PARAMETER.

  • If Open.IsPersistent is TRUE and the SMB2_DHANDLE_FLAG_PERSISTENT bit is not set in the Flags field of the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND.

  • If DesiredAccess field of the SMB2 CREATE request is nonzero and does not match Open.DesiredAccess, the server MUST fail the request with STATUS_INVALID_PARAMETER.

  • If ShareAccess field of the SMB2 CREATE request does not match Open.ShareMode, the server MUST fail the request with STATUS_INVALID_PARAMETER.

  • If all the bits in the CreateOptions field of the SMB2 CREATE request, with the exception of FILE_COMPLETE_IF_OPLOCKED bit, do not match the corresponding bits in Open.CreateOptions, the server MUST fail the request with STATUS_INVALID_PARAMETER.

  • If Open.CreateGuid is not equal to the CreateGuid in the request, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND.

  • If Open.IsDurable is FALSE and Open.IsResilient is FALSE or unimplemented, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" in section 3.3.5.9.

  • If Open.Session is not NULL, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND. If Open.Lease is NULL and the SMB2_CREATE_REQUEST_LEASE or SMB2_CREATE_REQUEST_LEASE_V2 create context is present, or if Open.Lease is NOT NULL and the SMB2_CREATE_REQUEST_LEASE or SMB2_CREATE_REQUEST_LEASE_V2 create context is not present, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND.

  • If an SMB2_CREATE_REQUEST_LEASE_V2 create context is also present in the request, the server supports directory leasing, and Open.Lease.LeaseKey does not match the LeaseKey provided in the SMB2_CREATE_REQUEST_LEASE_V2 create context, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" in section 3.3.5.9.

  • If an SMB2_CREATE_REQUEST_LEASE create context is also present in the request, the server supports leasing, and Open.Lease.LeaseKey does not match the LeaseKey provided in the SMB2_CREATE_REQUEST_LEASE create context, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" in section 3.3.5.9.

  • If the user represented by Session.SecurityContext is not the same user denoted by Open.DurableOwner, the server MUST fail the request with STATUS_ACCESS_DENIED and proceed as specified in "Failed Open Handling" in section 3.3.5.9.

  • The server MUST set the Open.Connection to refer to the connection that received this request.

  • The server MUST set the Open.Session to refer to the session that received this request.

  • The server MUST set the Open.TreeConnect to refer to the tree connect that received this request, and Open.TreeConnect.OpenCount MUST be increased by 1.

  • The server MUST regenerate Open.FileId (the volatile portion of the SMB2_FILEID).

  • If the SMB2_DHANDLE_FLAG_PERSISTENT bit is set in the Flags field of the request and if TreeConnect.Share.IsCA is TRUE, the server MUST set Open.IsPersistent to TRUE.

  • The server MUST insert the open into the Session.OpenTable with the Open.FileId as the new key.

The "Successful Open Initialization" and "Oplock Acquisition" phases MUST be skipped, and processing MUST continue as specified in "Response Construction".

In the "Response Construction" phase:

If the server supports directory leasing, and the request contains SMB2_CREATE_REQUEST_LEASE_V2 Create Context, then the server MUST construct an SMB2_CREATE_RESPONSE_LEASE_V2 Create Context, following the syntax specified in section 2.2.14.2.10, and include it in the buffer described by the response CreateContextLength and CreateContextOffset fields. This structure MUST have the following values set:

  • LeaseKey MUST be set to Lease.LeaseKey.

  • LeaseState MUST be set to Lease.LeaseState.

  • ParentLeaseKey MUST be set to the ParentLeaseKey in the request.

  • If Lease.LeaseState includes SMB2_LEASE_WRITE_CACHING, the server MUST set Lease.Epoch to the Epoch field in the Create Context request. Otherwise, the server MUST set Lease.Epoch to the Epoch field in the Create Context request incremented by 1. Epoch MUST be set to Lease.Epoch.

If the request contains an SMB2_CREATE_REQUEST_LEASE Create Context, the server supports leasing and Open.Lease is not NULL, then the server MUST construct an SMB2_CREATE_RESPONSE_LEASE create context, following the syntax specified in section 2.2.14.2.10, and include it in the buffer described by the response CreateContextLength and CreateContextOffset fields. This structure MUST have the following values set:

  • LeaseKey MUST be set to Lease.LeaseKey.

  • LeaseState MUST be set to Lease.LeaseState.

 
Show:
© 2015 Microsoft