summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2001-12-01 23:57:11 +0000
committerJean-François Micouleau <jfm@samba.org>2001-12-01 23:57:11 +0000
commitd78f6366e81913d01e3efac3854aee7e6689b922 (patch)
treeb2812123ac66f95608ecb8610c774582a4d7d5db /source3/libsmb
parent92a2d1d463f9068f02e2c70582664b72867a65e6 (diff)
downloadsamba-d78f6366e81913d01e3efac3854aee7e6689b922.tar.gz
samba-d78f6366e81913d01e3efac3854aee7e6689b922.tar.bz2
samba-d78f6366e81913d01e3efac3854aee7e6689b922.zip
added samr_query_sec_obj for rpcclient
J.F. (This used to be commit d8809c58614cd97ef78d398645788e41022a8c39)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cli_samr.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/source3/libsmb/cli_samr.c b/source3/libsmb/cli_samr.c
index 4a04d67887..d609572942 100644
--- a/source3/libsmb/cli_samr.c
+++ b/source3/libsmb/cli_samr.c
@@ -1082,3 +1082,49 @@ NTSTATUS cli_samr_delete_dom_user(struct cli_state *cli, TALLOC_CTX *mem_ctx,
return result;
}
+
+/* Query user security object */
+
+NTSTATUS cli_samr_query_sec_obj(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+ POLICY_HND *user_pol, uint16 switch_value,
+ TALLOC_CTX *ctx, SEC_DESC_BUF **sec_desc_buf)
+{
+ prs_struct qbuf, rbuf;
+ SAMR_Q_QUERY_SEC_OBJ q;
+ SAMR_R_QUERY_SEC_OBJ r;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ ZERO_STRUCT(q);
+ ZERO_STRUCT(r);
+
+ /* Initialise parse structures */
+
+ prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
+ prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
+
+ /* Marshall data and send request */
+
+ init_samr_q_query_sec_obj(&q, user_pol, switch_value);
+
+ if (!samr_io_q_query_sec_obj("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req(cli, SAMR_QUERY_SEC_OBJECT, &qbuf, &rbuf)) {
+ goto done;
+ }
+
+ /* Unmarshall response */
+
+ if (!samr_io_r_query_sec_obj("", &r, &rbuf, 0)) {
+ goto done;
+ }
+
+ /* Return output parameters */
+
+ result = r.status;
+ *sec_desc_buf=dup_sec_desc_buf(ctx, r.buf);
+
+ done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}