summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-07-25 17:46:01 +0200
committerVolker Lendecke <vl@samba.org>2010-07-25 22:29:43 +0200
commit786e4cd0980f0562b28ac74612a72faa4e2050cc (patch)
tree119c45f67a0fe41f61759ac81f9b9f4b0d4b8d54 /source3/libsmb
parentcb9baa7c2c6edafd835bc6e36a385b0d00f5277e (diff)
downloadsamba-786e4cd0980f0562b28ac74612a72faa4e2050cc.tar.gz
samba-786e4cd0980f0562b28ac74612a72faa4e2050cc.tar.bz2
samba-786e4cd0980f0562b28ac74612a72faa4e2050cc.zip
s3: Convert cli_posix_getfacl to cli_qpathinfo_send
Diffstat (limited to 'source3/libsmb')
-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,