s3-rpc_client: Added dcerpc_lsa_open_policy2.
authorAndreas Schneider <asn@samba.org>
Tue, 7 Sep 2010 10:19:25 +0000 (12:19 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 10 Jan 2011 17:20:55 +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 59f377ac9d0c2b08db04107a72854184bc89e7ee..55aeddc4032728297ad1d1bda31df1880300428a 100644 (file)
@@ -99,14 +99,13 @@ NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
        return result;
 }
 
-/** Open a LSA policy handle
-  *
-  * @param cli Handle on an initialised SMB connection
-  */
-
-NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
-                                TALLOC_CTX *mem_ctx, bool sec_qos,
-                                uint32 des_access, struct policy_handle *pol)
+NTSTATUS dcerpc_lsa_open_policy2(struct dcerpc_binding_handle *h,
+                                TALLOC_CTX *mem_ctx,
+                                const char *srv_name_slash,
+                                bool sec_qos,
+                                uint32_t des_access,
+                                struct policy_handle *pol,
+                                NTSTATUS *result)
 {
        struct lsa_ObjectAttribute attr;
        struct lsa_QosInfo qos;
@@ -124,11 +123,38 @@ NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
                attr.sec_qos            = &qos;
        }
 
-       return rpccli_lsa_OpenPolicy2(cli, mem_ctx,
-                                     cli->srv_name_slash,
+       return dcerpc_lsa_OpenPolicy2(h,
+                                     mem_ctx,
+                                     srv_name_slash,
                                      &attr,
                                      des_access,
-                                     pol);
+                                     pol,
+                                     result);
+}
+
+/** Open a LSA policy handle
+  *
+  * @param cli Handle on an initialised SMB connection
+  */
+
+NTSTATUS rpccli_lsa_open_policy2(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;
 }
 
 /* Lookup a list of sids
index c1666a71ce81c250b7c91ad1b424e74fa288e3a8..bdcbb69a7817fc4c7467420e46750f057e8c5825 100644 (file)
@@ -28,9 +28,34 @@ NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
                                bool sec_qos, uint32 des_access,
                                struct policy_handle *pol);
 
+/**
+ * @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_policy2(struct dcerpc_binding_handle *h,
+                                TALLOC_CTX *mem_ctx,
+                                const char *srv_name_slash,
+                                bool sec_qos,
+                                uint32_t des_access,
+                                struct policy_handle *pol,
+                                NTSTATUS *result);
 NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx, bool sec_qos,
                                 uint32 des_access, struct policy_handle *pol);
+
 NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                struct policy_handle *pol,