TALLOC_FREE(frame);
return status;
}
-
-NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
- uint8_t smb_command, uint8_t additional_flags,
- uint8_t wct, uint16_t *vwv,
- uint32_t num_bytes, const uint8_t *bytes,
- struct tevent_req **result_parent,
- uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
- uint32_t *pnum_bytes, uint8_t **pbytes)
-{
- struct tevent_context *ev;
- struct tevent_req *req = NULL;
- NTSTATUS status = NT_STATUS_NO_MEMORY;
-
- if (smbXcli_conn_has_async_calls(cli->conn)) {
- return NT_STATUS_INVALID_PARAMETER;
- }
- ev = samba_tevent_context_init(mem_ctx);
- if (ev == NULL) {
- goto fail;
- }
- req = cli_smb_send(mem_ctx, ev, cli, smb_command, additional_flags, 0,
- wct, vwv, num_bytes, bytes);
- if (req == NULL) {
- goto fail;
- }
- if (!tevent_req_poll_ntstatus(req, ev, &status)) {
- goto fail;
- }
- status = cli_smb_recv(req, NULL, NULL, min_wct, pwct, pvwv,
- pnum_bytes, pbytes);
-fail:
- TALLOC_FREE(ev);
- if (NT_STATUS_IS_OK(status) && (result_parent != NULL)) {
- *result_parent = req;
- }
- return status;
-}
DATA_BLOB data);
NTSTATUS cli_echo_recv(struct tevent_req *req);
NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
-NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
- uint8_t smb_command, uint8_t additional_flags,
- uint8_t wct, uint16_t *vwv,
- uint32_t num_bytes, const uint8_t *bytes,
- struct tevent_req **result_parent,
- uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
- uint32_t *pnum_bytes, uint8_t **pbytes);
/* The following definitions come from libsmb/clierror.c */
void torture_conn_set_sockopt(struct cli_state *cli);
void torture_deltree(struct cli_state *cli, const char *dname);
+NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
+ uint8_t smb_command, uint8_t additional_flags,
+ uint8_t wct, uint16_t *vwv,
+ uint32_t num_bytes, const uint8_t *bytes,
+ struct tevent_req **result_parent,
+ uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
+ uint32_t *pnum_bytes, uint8_t **pbytes);
NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
off_t offset, size_t size1, size_t *ptotal);
return NT_STATUS_OK;
}
+NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
+ uint8_t smb_command, uint8_t additional_flags,
+ uint8_t wct, uint16_t *vwv,
+ uint32_t num_bytes, const uint8_t *bytes,
+ struct tevent_req **result_parent,
+ uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
+ uint32_t *pnum_bytes, uint8_t **pbytes)
+{
+ struct tevent_context *ev;
+ struct tevent_req *req = NULL;
+ NTSTATUS status = NT_STATUS_NO_MEMORY;
+
+ if (smbXcli_conn_has_async_calls(cli->conn)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ ev = samba_tevent_context_init(mem_ctx);
+ if (ev == NULL) {
+ goto fail;
+ }
+ req = cli_smb_send(mem_ctx, ev, cli, smb_command, additional_flags, 0,
+ wct, vwv, num_bytes, bytes);
+ if (req == NULL) {
+ goto fail;
+ }
+ if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+ goto fail;
+ }
+ status = cli_smb_recv(req, NULL, NULL, min_wct, pwct, pvwv,
+ pnum_bytes, pbytes);
+fail:
+ TALLOC_FREE(ev);
+ if (NT_STATUS_IS_OK(status) && (result_parent != NULL)) {
+ *result_parent = req;
+ }
+ return status;
+}
+
static NTSTATUS torture_delete_fn(struct file_info *finfo,
const char *pattern,
void *state)