summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-08-12 08:25:02 +0000
committerJim McDonough <jmcd@samba.org>2002-08-12 08:25:02 +0000
commit4a822be1d3bb547b87ff3a0f24dca862fa1fa809 (patch)
treecd9ef9ad34b8c12ac7a89cc347e5a6d3abd24d47 /source3/rpc_client
parent3773419cdf8553f68bdb43149c2d93cad6d78f50 (diff)
downloadsamba-4a822be1d3bb547b87ff3a0f24dca862fa1fa809.tar.gz
samba-4a822be1d3bb547b87ff3a0f24dca862fa1fa809.tar.bz2
samba-4a822be1d3bb547b87ff3a0f24dca862fa1fa809.zip
Add client side support for samr connect4 (0x3e). Seems to have one
additional parm compared to samr connect, but I've only seen 0x00000002 in that field... (This used to be commit ed2370b91f7f6a36efdf6b65340a5b29a26e7e7a)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_samr.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index 6581bdbeaf..7863d32419 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -72,6 +72,53 @@ NTSTATUS cli_samr_connect(struct cli_state *cli, TALLOC_CTX *mem_ctx,
return result;
}
+/* Connect to SAMR database */
+
+NTSTATUS cli_samr_connect4(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+ uint32 access_mask, POLICY_HND *connect_pol)
+{
+ prs_struct qbuf, rbuf;
+ SAMR_Q_CONNECT4 q;
+ SAMR_R_CONNECT4 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_connect4(&q, cli->desthost, access_mask);
+
+ if (!samr_io_q_connect4("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req(cli, SAMR_CONNECT4, &qbuf, &rbuf))
+ goto done;
+
+ /* Unmarshall response */
+
+ if (!samr_io_r_connect4("", &r, &rbuf, 0))
+ goto done;
+
+ /* Return output parameters */
+
+ if (NT_STATUS_IS_OK(result = r.status)) {
+ *connect_pol = r.connect_pol;
+#ifdef __INSURE__
+ connect_pol->marker = malloc(1);
+#endif
+ }
+
+ done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}
+
/* Close SAMR handle */
NTSTATUS cli_samr_close(struct cli_state *cli, TALLOC_CTX *mem_ctx,