struct timespec write_time_ts;
struct smb2_create_blobs out_context_blobs;
int requested_oplock_level;
+ bool do_durable_reconnect = false;
ZERO_STRUCT(out_context_blobs);
return tevent_req_post(req, ev);
}
- // TODO: implement this function..
- status = smb2_create_durable_reconnect(op, smb1req, mem_ctx, &result);
-
- if (!NT_STATUS_IS_OK(status)) {
- tevent_req_nterror(req, status);
- return tevent_req_post(req, ev);
- }
-
- // TODO: response construction
-
- tevent_req_done(req);
- return tevent_req_post(req, ev);
+ do_durable_reconnect = true;
}
if (alsi) {
in_file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS;
- status = SMB_VFS_CREATE_FILE(smb1req->conn,
- smb1req,
- 0, /* root_dir_fid */
- smb_fname,
- in_desired_access,
- in_share_access,
- in_create_disposition,
- in_create_options,
- in_file_attributes,
- map_smb2_oplock_levels_to_samba(requested_oplock_level),
- allocation_size,
- 0, /* private_flags */
- sec_desc,
- ea_list,
- &result,
- &info);
- if (!NT_STATUS_IS_OK(status)) {
- if (open_was_deferred(smb1req->sconn, smb1req->mid)) {
- return req;
+ /*
+ * For the backend file open procedure, there are
+ * two possible modes: durable_reconnect or not.
+ */
+ if (do_durable_reconnect) {
+ status = smb2_create_durable_reconnect(op,
+ smb1req,
+ smb_fname,
+ mem_ctx,
+ &result);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
}
- tevent_req_nterror(req, status);
+
+ // TODO: response construction
+
+ tevent_req_done(req);
return tevent_req_post(req, ev);
+ } else {
+ status = SMB_VFS_CREATE_FILE(smb1req->conn,
+ smb1req,
+ 0, /* root_dir_fid */
+ smb_fname,
+ in_desired_access,
+ in_share_access,
+ in_create_disposition,
+ in_create_options,
+ in_file_attributes,
+ map_smb2_oplock_levels_to_samba(requested_oplock_level),
+ allocation_size,
+ 0, /* private_flags */
+ sec_desc,
+ ea_list,
+ &result,
+ &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ if (open_was_deferred(smb1req->sconn, smb1req->mid)) {
+ return req;
+ }
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
+ }
}
if (mxac) {