#include "../lib/util/tevent_ntstatus.h"
#include "rpc_server/srv_pipe_hnd.h"
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
static struct tevent_req *smbd_smb2_write_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct smbd_smb2_request *smb2req,
static void smbd_smb2_request_write_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
{
- struct smbXsrv_connection *xconn = req->sconn->conn;
+ struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
uint16_t in_data_offset;
if (!NT_STATUS_IS_OK(status)) {
error = smbd_smb2_request_error(req, status);
if (!NT_STATUS_IS_OK(error)) {
- smbd_server_connection_terminate(req->sconn,
+ smbd_server_connection_terminate(req->xconn,
nt_errstr(error));
return;
}
if (outbody.data == NULL) {
error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
if (!NT_STATUS_IS_OK(error)) {
- smbd_server_connection_terminate(req->sconn,
+ smbd_server_connection_terminate(req->xconn,
nt_errstr(error));
return;
}
error = smbd_smb2_request_done(req, outbody, &outdyn);
if (!NT_STATUS_IS_OK(error)) {
- smbd_server_connection_terminate(req->sconn, nt_errstr(error));
+ smbd_server_connection_terminate(req->xconn, nt_errstr(error));
return;
}
}
return NULL;
}
state->smb2req = smb2req;
+ if (smb2req->xconn->protocol >= PROTOCOL_SMB3_02) {
+ if (in_flags & SMB2_WRITEFLAG_WRITE_UNBUFFERED) {
+ state->write_through = true;
+ }
+ }
if (in_flags & SMB2_WRITEFLAG_WRITE_THROUGH) {
state->write_through = true;
}
WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
tevent_req_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
return tevent_req_post(req, ev);
}
status = smb2_write_complete(req, nwritten, errno);
- SMB_VFS_STRICT_UNLOCK(conn, fsp, &lock);
-
DEBUG(10,("smb2: write on "
"file %s, offset %.0f, requested %u, written = %u\n",
fsp_str_dbg(fsp),