summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-09-07 11:24:52 +0200
committerGünther Deschner <gd@samba.org>2011-01-10 18:20:54 +0100
commit2f819505afe2a5f1bd244a625861f7b07c78ae8f (patch)
tree2a8d27fac674cb65193eb87b5ffe6dab1d05b29b /source3
parent342bb471dc746791d0722534f1f12b66597acfc1 (diff)
downloadsamba-2f819505afe2a5f1bd244a625861f7b07c78ae8f.tar.gz
samba-2f819505afe2a5f1bd244a625861f7b07c78ae8f.tar.bz2
samba-2f819505afe2a5f1bd244a625861f7b07c78ae8f.zip
s3-rpc_client: Added dcerpc_lsa_open_policy.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_lsarpc.c43
-rw-r--r--source3/rpc_client/cli_lsarpc.h24
2 files changed, 58 insertions, 9 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 29cb09cddd..59f377ac9d 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -41,14 +41,12 @@
* security authority", which is half of a password database.
**/
-/** Open a LSA policy handle
- *
- * @param cli Handle on an initialised SMB connection */
-
-NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
+NTSTATUS dcerpc_lsa_open_policy(struct dcerpc_binding_handle *h,
TALLOC_CTX *mem_ctx,
- bool sec_qos, uint32 des_access,
- struct policy_handle *pol)
+ bool sec_qos,
+ uint32_t des_access,
+ struct policy_handle *pol,
+ NTSTATUS *result)
{
struct lsa_ObjectAttribute attr;
struct lsa_QosInfo qos;
@@ -67,11 +65,38 @@ NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
attr.sec_qos = &qos;
}
- return rpccli_lsa_OpenPolicy(cli, mem_ctx,
+ return dcerpc_lsa_OpenPolicy(h,
+ mem_ctx,
&system_name,
&attr,
des_access,
- pol);
+ pol,
+ result);
+}
+
+/** Open a LSA policy handle
+ *
+ * @param cli Handle on an initialised SMB connection */
+
+NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ bool sec_qos, uint32 des_access,
+ struct policy_handle *pol)
+{
+ NTSTATUS status;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ status = dcerpc_lsa_open_policy(cli->binding_handle,
+ mem_ctx,
+ sec_qos,
+ des_access,
+ pol,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return result;
}
/** Open a LSA policy handle
diff --git a/source3/rpc_client/cli_lsarpc.h b/source3/rpc_client/cli_lsarpc.h
index d971ee9b58..c1666a71ce 100644
--- a/source3/rpc_client/cli_lsarpc.h
+++ b/source3/rpc_client/cli_lsarpc.h
@@ -1,9 +1,33 @@
/* The following definitions come from rpc_client/cli_lsarpc.c */
+/**
+ * @brief Open a LSA policy.
+ *
+ * @param[in] h The dcerpc binding hanlde to use.
+ *
+ * @param[in] mem_ctx The memory context to use.
+ *
+ * @param[in] sec_qos Enable security quality of services.
+ *
+ * @param[in] des_access The disired access rights to be granted.
+ *
+ * @param[out] pol A pointer to a rpc policy handle.
+ *
+ * @param[out] result A pointer for the NDR NTSTATUS error code.
+ *
+ * @return A corresponding NTSTATUS error code for the connection.
+ */
+NTSTATUS dcerpc_lsa_open_policy(struct dcerpc_binding_handle *h,
+ TALLOC_CTX *mem_ctx,
+ bool sec_qos,
+ uint32_t des_access,
+ struct policy_handle *pol,
+ NTSTATUS *result);
NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
bool sec_qos, uint32 des_access,
struct policy_handle *pol);
+
NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, bool sec_qos,
uint32 des_access, struct policy_handle *pol);