summaryrefslogtreecommitdiff
path: root/source3/libsmb/cli_lsarpc.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-12-11 02:17:26 +0000
committerTim Potter <tpot@samba.org>2001-12-11 02:17:26 +0000
commitb872787f01f0e72db3c03676e46432375fcce787 (patch)
tree9c6639ca5457b735419fba342103b8b894ff34c3 /source3/libsmb/cli_lsarpc.c
parentebefbda2f67a3812cbaa94f62b543f410e0fcff3 (diff)
downloadsamba-b872787f01f0e72db3c03676e46432375fcce787.tar.gz
samba-b872787f01f0e72db3c03676e46432375fcce787.tar.bz2
samba-b872787f01f0e72db3c03676e46432375fcce787.zip
Doing some research into ACLs on the LSA and SAM policy objects.
- added lsaquerysecobj to rpcclient - renamed querysecobj to samquerysecobj - removed duplicated display_sec_acl() code from cmd_spoolss.c and cmd_samr.c and moved it into display_sec.c (This used to be commit 59b2e3f408a5ff22f2d81a927d010a7df5f19f7f)
Diffstat (limited to 'source3/libsmb/cli_lsarpc.c')
-rw-r--r--source3/libsmb/cli_lsarpc.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/source3/libsmb/cli_lsarpc.c b/source3/libsmb/cli_lsarpc.c
index c528ff48a9..ff4c4dfe30 100644
--- a/source3/libsmb/cli_lsarpc.c
+++ b/source3/libsmb/cli_lsarpc.c
@@ -988,6 +988,58 @@ NTSTATUS cli_lsa_lookupprivvalue(struct cli_state *cli, TALLOC_CTX *mem_ctx,
return result;
}
+/** Query LSA security object */
+
+NTSTATUS cli_lsa_query_secobj(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+ POLICY_HND *pol, uint32 sec_info,
+ SEC_DESC_BUF **psdb)
+{
+ prs_struct qbuf, rbuf;
+ LSA_Q_QUERY_SEC_OBJ q;
+ LSA_R_QUERY_SEC_OBJ r;
+ NTSTATUS result;
+
+ 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_q_query_sec_obj(&q, pol, sec_info);
+
+ if (!lsa_io_q_query_sec_obj("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req(cli, LSA_QUERYSECOBJ, &qbuf, &rbuf)) {
+ result = NT_STATUS_UNSUCCESSFUL;
+ goto done;
+ }
+
+ /* Unmarshall response */
+
+ if (!lsa_io_r_query_sec_obj("", &r, &rbuf, 0)) {
+ result = NT_STATUS_UNSUCCESSFUL;
+ goto done;
+ }
+
+ if (!NT_STATUS_IS_OK(result = r.status)) {
+ goto done;
+ }
+
+ /* Return output parameters */
+
+ if (psdb)
+ *psdb = r.buf;
+
+ done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}
+
/** Fetch a DOMAIN sid. Does complete cli setup / teardown anonymously. */
BOOL fetch_domain_sid( char *domain, char *remote_machine, DOM_SID *psid)