nt_errstr(status));
if (NT_STATUS_EQUAL(status, NT_STATUS_PIPE_DISCONNECTED)) {
- subreq = cli_close_send(
- state,
- state->ev,
- state->cli,
- state->out_pipe);
+ subreq = cli_close_send(state,
+ state->ev,
+ state->cli,
+ state->out_pipe,
+ 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_PIPE_DISCONNECTED) ||
state->close_requested) {
- subreq = cli_close_send(
- state,
- state->ev,
- state->cli,
- state->in_pipe);
+ subreq = cli_close_send(state,
+ state->ev,
+ state->cli,
+ state->in_pipe,
+ 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
TALLOC_FREE(state->fd_read_req);
- subreq = cli_close_send(
- state,
- state->ev,
- state->cli,
- state->in_pipe);
+ subreq =
+ cli_close_send(state, state->ev, state->cli, state->in_pipe, 0);
if (subreq == NULL) {
return false;
}
TALLOC_FREE(subreq);
if (NT_STATUS_EQUAL(status, NT_STATUS_PIPE_DISCONNECTED)) {
- subreq = cli_close_send(
- state,
- state->ev,
- state->cli,
- state->ctrl_pipe);
+ subreq = cli_close_send(state,
+ state->ev,
+ state->cli,
+ state->ctrl_pipe,
+ 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
static void cli_close_done(struct tevent_req *subreq);
struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli,
- uint16_t fnum)
+ struct tevent_context *ev,
+ struct cli_state *cli,
+ uint16_t fnum,
+ uint16_t flags)
{
struct tevent_req *req, *subreq;
struct cli_close_state *state;
}
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
- subreq = cli_smb2_close_fnum_send(state, ev, cli, fnum, 0);
+ subreq = cli_smb2_close_fnum_send(state, ev, cli, fnum, flags);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
goto fail;
}
- req = cli_close_send(frame, ev, cli, fnum);
+ req = cli_close_send(frame, ev, cli, fnum, 0);
if (req == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
return;
}
- subreq = cli_close_send(state, state->ev, state->cli, fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
TALLOC_FREE(subreq);
if (NT_STATUS_IS_OK(state->set_reparse_status)) {
- subreq = cli_close_send(state, state->ev, state->cli,
- state->fnum);
+ subreq = cli_close_send(state,
+ state->ev,
+ state->cli,
+ state->fnum,
+ 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
(void)cli_nt_delete_on_close_recv(subreq);
TALLOC_FREE(subreq);
- subreq = cli_close_send(state, state->ev, state->cli, state->fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
state->datalen = out.length;
}
- subreq = cli_close_send(state, state->ev, state->cli, state->fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
struct tevent_req **psubreq);
struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct cli_state *cli, uint16_t fnum);
+ struct cli_state *cli,
+ uint16_t fnum,
+ uint16_t flags);
NTSTATUS cli_close_recv(struct tevent_req *req);
NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req;
int fnum;
+ int flags = 0;
NTSTATUS status;
- if (!PyArg_ParseTuple(args, "i", &fnum)) {
+ if (!PyArg_ParseTuple(args, "i|i", &fnum, &flags)) {
return NULL;
}
- req = cli_close_send(NULL, self->ev, self->cli, fnum);
+ req = cli_close_send(NULL, self->ev, self->cli, fnum, flags);
if (!py_tevent_req_wait_exc(self, req)) {
return NULL;
}
PyErr_NTSTATUS_NOT_OK_RAISE(status);
/* close the file handle */
- req = cli_close_send(NULL, self->ev, self->cli, fnum);
+ req = cli_close_send(NULL, self->ev, self->cli, fnum, 0);
if (!py_tevent_req_wait_exc(self, req)) {
return NULL;
}
}
/* close the file handle */
- req = cli_close_send(NULL, self->ev, self->cli, fnum);
+ req = cli_close_send(NULL, self->ev, self->cli, fnum, 0);
if (!py_tevent_req_wait_exc(self, req)) {
Py_XDECREF(result);
return NULL;
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
return tevent_req_post(req, ev);
}
- subreq = cli_close_send(
- state, ev, nb_state->cli, state->ft->fnum);
+ subreq = cli_close_send(state,
+ ev,
+ nb_state->cli,
+ state->ft->fnum,
+ 0);
break;
}
case NBENCH_CMD_MKDIR: {
if (tevent_req_nterror(req, status)) {
return;
}
- subreq = cli_close_send(state, state->ev, state->cli, fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
if (tevent_req_nterror(req, status)) {
return;
}
- subreq = cli_close_send(state, state->ev, state->cli, state->dnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->dnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
tevent_req_nterror(req, map_nt_error_from_unix(ret));
return;
}
- subreq = cli_close_send(state, state->ev, state->cli,
- state->subdir_dnum);
+ subreq = cli_close_send(state,
+ state->ev,
+ state->cli,
+ state->subdir_dnum,
+ 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
return;
}
- subreq = cli_close_send(state, state->ev, state->cli, state->dnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->dnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
if (tevent_req_nterror(req, status)) {
return;
}
- subreq = cli_close_send(
- state, state->ev, state->cli, state->fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
tevent_wakeup_recv(subreq);
TALLOC_FREE(subreq);
- subreq = cli_close_send(
- state, state->ev, state->cli, state->dnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->dnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
return;
}
- subreq = cli_close_send(state, state->ev, state->cli, state->fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, state->fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}
}
tevent_req_set_callback(subreq, delete_stream_unlinked, req);
- subreq = cli_close_send(state, ev, cli, stream_fnum);
+ subreq = cli_close_send(state, ev, cli, stream_fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
return;
}
- subreq = cli_close_send(state, state->ev, state->cli, fnum);
+ subreq = cli_close_send(state, state->ev, state->cli, fnum, 0);
if (tevent_req_nomem(subreq, req)) {
return;
}