summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clifile.c74
1 files changed, 21 insertions, 53 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index a592485e58..d690f7ec67 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -587,22 +587,7 @@ struct getfacl_state {
uint8_t *data;
};
-static void cli_posix_getfacl_done(struct tevent_req *subreq)
-{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- struct getfacl_state *state = tevent_req_data(req, struct getfacl_state);
- NTSTATUS status;
-
- status = cli_trans_recv(subreq, state, NULL, 0, NULL, NULL, 0, NULL,
- &state->data, 0, &state->num_data);
- TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- tevent_req_nterror(req, status);
- return;
- }
- tevent_req_done(req);
-}
+static void cli_posix_getfacl_done(struct tevent_req *subreq);
struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
@@ -616,43 +601,8 @@ struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
if (req == NULL) {
return NULL;
}
-
- /* Setup setup word. */
- SSVAL(&state->setup, 0, TRANSACT2_QPATHINFO);
-
- /* Setup param array. */
- state->param = talloc_array(state, uint8_t, 6);
- if (tevent_req_nomem(state->param, req)) {
- return tevent_req_post(req, ev);
- }
- memset(state->param, '\0', 6);
- SSVAL(state->param, 0, SMB_QUERY_POSIX_ACL);
-
- state->param = trans2_bytes_push_str(state->param, cli_ucs2(cli), fname,
- strlen(fname)+1, NULL);
-
- if (tevent_req_nomem(state->param, req)) {
- return tevent_req_post(req, ev);
- }
-
- subreq = cli_trans_send(state, /* mem ctx. */
- ev, /* event ctx. */
- cli, /* cli_state. */
- SMBtrans2, /* cmd. */
- NULL, /* pipe name. */
- -1, /* fid. */
- 0, /* function. */
- 0, /* flags. */
- &state->setup, /* setup. */
- 1, /* num setup uint16_t words. */
- 0, /* max returned setup. */
- state->param, /* param. */
- talloc_get_size(state->param), /* num param. */
- 2, /* max returned param. */
- NULL, /* data. */
- 0, /* num data. */
- cli->max_xmit); /* max returned data. */
-
+ subreq = cli_qpathinfo_send(state, ev, cli, fname, SMB_QUERY_POSIX_ACL,
+ 0, cli->max_xmit);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
@@ -660,6 +610,24 @@ struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
return req;
}
+static void cli_posix_getfacl_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct getfacl_state *state = tevent_req_data(
+ req, struct getfacl_state);
+ NTSTATUS status;
+
+ status = cli_qpathinfo_recv(subreq, state, &state->data,
+ &state->num_data);
+ TALLOC_FREE(subreq);
+ if (!NT_STATUS_IS_OK(status)) {
+ tevent_req_nterror(req, status);
+ return;
+ }
+ tevent_req_done(req);
+}
+
NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
size_t *prb_size,