s3-rpc_client: Added dcerpc_lsa_open_policy.
authorAndreas Schneider <asn@samba.org>
Tue, 7 Sep 2010 09:24:52 +0000 (11:24 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 10 Jan 2011 17:20:54 +0000 (18:20 +0100)
Signed-off-by: Günther Deschner <gd@samba.org>
source3/rpc_client/cli_lsarpc.c
source3/rpc_client/cli_lsarpc.h

index 29cb09cdddd86bf764589620c3bf527dbc34f048..59f377ac9d0c2b08db04107a72854184bc89e7ee 100644 (file)
  * 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
index d971ee9b588379a5602a466cbf647f39779c98a9..c1666a71ce81c250b7c91ad1b424e74fa288e3a8 100644 (file)
@@ -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);