smbd: add twrp arg to synthetic_smb_fname()
[amitay/samba.git] / source3 / smbd / pipes.c
index c945f0f6177661259262c04f1881375b0a95d8be..2dd38bb7ab3e0c10f5131b71a7b10431f34ec76f 100644 (file)
@@ -48,10 +48,15 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
        fsp->conn = conn;
        fsp->fh->fd = -1;
        fsp->vuid = smb_req->vuid;
-       fsp->can_lock = false;
+       fsp->fsp_flags.can_lock = false;
        fsp->access_mask = FILE_READ_DATA | FILE_WRITE_DATA;
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL, 0);
+       smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       name,
+                                       NULL,
+                                       NULL,
+                                       0,
+                                       0);
        if (smb_fname == NULL) {
                file_free(smb_req, fsp);
                return NT_STATUS_NO_MEMORY;
@@ -67,8 +72,9 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
                         conn->sconn->remote_address,
                         conn->sconn->local_address,
                         conn->session_info,
-                        smb_req->ev_ctx,
+                        conn->sconn->ev_ctx,
                         conn->sconn->msg_ctx,
+                        conn->sconn->dce_ctx,
                         &fsp->fake_file_handle);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(10, ("np_open(%s) returned %s\n", name,
@@ -206,7 +212,7 @@ void reply_pipe_write(struct smb_request *req)
        DEBUG(6, ("reply_pipe_write: %s, name: %s len: %d\n", fsp_fnum_dbg(fsp),
                  fsp_str_dbg(fsp), (int)state->numtowrite));
 
-       subreq = np_write_send(state, req->ev_ctx,
+       subreq = np_write_send(state, req->sconn->ev_ctx,
                               fsp->fake_file_handle, data, state->numtowrite);
        if (subreq == NULL) {
                TALLOC_FREE(state);
@@ -322,7 +328,7 @@ void reply_pipe_write_and_X(struct smb_request *req)
                state->numtowrite -= 2;
        }
 
-       subreq = np_write_send(state, req->ev_ctx,
+       subreq = np_write_send(state, req->sconn->ev_ctx,
                               fsp->fake_file_handle, data, state->numtowrite);
        if (subreq == NULL) {
                TALLOC_FREE(state);
@@ -435,7 +441,7 @@ void reply_pipe_read_and_X(struct smb_request *req)
        state->outbuf = req->outbuf;
        req->outbuf = NULL;
 
-       subreq = np_read_send(state, req->ev_ctx,
+       subreq = np_read_send(state, req->sconn->ev_ctx,
                              fsp->fake_file_handle, data,
                              state->smb_maxcnt);
        if (subreq == NULL) {