Export (0) Print
Expand All

3.3.5.9.10 Handling the SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 Create Context

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

If the create request also includes an SMB2_CREATE_DURABLE_HANDLE_REQUEST create context, or an SMB2_CREATE_DURABLE_HANDLE_RECONNECT or SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 create context, the server MUST fail the create request with STATUS_INVALID_PARAMETER.

If the SMB2_DHANDLE_FLAG_PERSISTENT bit is not set in the Flags field of this create context, if RequestedOplockLevel in the create request is not set to SMB2_OPLOCK_LEVEL_BATCH, and if the create request does not include a SMB2_CREATE_REQUEST_LEASE or SMB2_CREATE_REQUEST_LEASE_V2 create context with a LeaseState field that includes SMB2_LEASE_HANDLE_CACHING, the server MUST ignore this create context and skip this section.

If the create request also includes the SMB2_CREATE_APP_INSTANCE_ID create context, the server MUST process the SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 create context only after processing the SMB2_CREATE_APP_INSTANCE_ID create context.

The server MUST locate the Open in GlobalOpenTable where Open.CreateGuid matches the CreateGuid in the SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 create context, and Open.ClientGuid matches the ClientGuid of the connection that received this request.

If an Open is not found, the server MUST continue the create process specified in the "Open Execution" Phase, and perform the following additional steps:

  • The server MUST set Open.CreateGuid to the CreateGuid in SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2.

  • In the "Successful Open Initialization" phase, the server MUST set Open.IsDurable to TRUE. The server MUST also set Open.DurableOwner to a security descriptor accessible only by the user represented by Open.Session.SecurityContext. If the SMB2_DHANDLE_FLAG_PERSISTENT bit is set in the Flags field of the request, TreeConnect.Share.IsCA is TRUE, and Connection.ServerCapabilities includes SMB2_GLOBAL_CAP_PERSISTENT_HANDLES, the server MUST set Open.IsPersistent to TRUE.

If an Open is found and the SMB2_FLAGS_REPLAY_OPERATION bit is not set in the SMB2 header, the server MUST fail the request with STATUS_DUPLICATE_OBJECTID.

If an Open is found and the SMB2_FLAGS_REPLAY_OPERATION bit is set in the SMB2 header, the server MUST verify the following:

  • The server MUST fail the create request with STATUS_ACCESS_DENIED in the following cases:

    • Open.IsDurable is FALSE.

    • Open.DurableOwner is not the user represented by Open.Session.SecurityContext.

    • If Open.Lease is not NULL and Open.Lease.LeaseKey is not equal to the LeaseKey specified in the SMB2_CREATE_REQUEST_LEASE or SMB2_CREATE_REQUEST_LEASE_V2 Create Context.

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

  • If Open.CreateDisposition does not match the CreateDisposition 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_REQUEST_V2 Create Context, the server MUST fail the request with STATUS_INVALID_PARAMETER.

The server MUST construct the create response from Open, as specified in the "Response Construction" phase, with the following additional steps, and send the response to client.

The server MUST skip the construction of the SMB2_CREATE_DURABLE_HANDLE_RESPONSE_V2 create context if the SMB2_DHANDLE_FLAG_PERSISTENT bit is not set in the Flags field of the request and if neither of the following conditions are met:

  • Open.OplockLevel is equal to SMB2_OPLOCK_LEVEL_BATCH.

  • Open.Lease.LeaseState has SMB2_LEASE_HANDLE_CACHING bit set.

The server MUST construct an SMB2_CREATE_DURABLE_HANDLE_RESPONSE_V2 response create context, with the following values set, as specified in section 2.2.14.2.12.

  • If Open.IsPersistent is FALSE, Open.DurableOpenTimeout and the Timeout value in the response MUST be set to an implementation-specific value;<272> otherwise, the server MUST perform the following:

    • If the Timeout value in the request is not zero, the Timeout value in the response MUST be set to the Timeout value in the request.

    • If the Timeout value in the request is zero:

      • If Share.CATimeout is not zero, Timeout MUST be set to Share.CATimeout.

      • If Share.CATimeout is zero, Timeout SHOULD be set to an implementation-specific value.<273>

  • Open.DurableOpenTimeout MUST be set to the Timeout value in the response.

  • If Open.IsPersistent is TRUE, the server MUST set the SMB2_DHANDLE_FLAG_PERSISTENT bit in the Flags field.

  • The buffer specified by the response MUST include CreateContextLength and CreateContextOffset fields.

 
Show:
© 2014 Microsoft