s3-netapi: use dcerpc_try_samr_connects().
authorGünther Deschner <gd@samba.org>
Wed, 6 Apr 2011 12:40:50 +0000 (14:40 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 12 Apr 2011 10:20:43 +0000 (12:20 +0200)
Guenther

source3/lib/netapi/samr.c

index f859c529f12e9300cd2eae1afb7ba87544ab9f92..fb30d4d71e72c20c16fd649da8d363002a1f31f7 100644 (file)
@@ -81,13 +81,20 @@ WERROR libnetapi_samr_open_domain(struct libnetapi_ctx *mem_ctx,
        }
 
        if (!is_valid_policy_hnd(connect_handle)) {
-               status = rpccli_try_samr_connects(pipe_cli, mem_ctx,
+               NTSTATUS result;
+               status = dcerpc_try_samr_connects(pipe_cli->binding_handle, mem_ctx,
+                                                 pipe_cli->srv_name_slash,
                                                  connect_mask,
-                                                 connect_handle);
+                                                 connect_handle,
+                                                 &result);
                if (!NT_STATUS_IS_OK(status)) {
                        werr = ntstatus_to_werror(status);
                        goto done;
                }
+               if (!NT_STATUS_IS_OK(result)) {
+                       werr = ntstatus_to_werror(result);
+                       goto done;
+               }
        }
 
        status = dcerpc_samr_EnumDomains(b, mem_ctx,
@@ -215,13 +222,20 @@ WERROR libnetapi_samr_open_builtin_domain(struct libnetapi_ctx *mem_ctx,
        }
 
        if (!is_valid_policy_hnd(connect_handle)) {
-               status = rpccli_try_samr_connects(pipe_cli, mem_ctx,
+               NTSTATUS result;
+               status = dcerpc_try_samr_connects(pipe_cli->binding_handle, mem_ctx,
+                                                 pipe_cli->srv_name_slash,
                                                  connect_mask,
-                                                 connect_handle);
+                                                 connect_handle,
+                                                 &result);
                if (!NT_STATUS_IS_OK(status)) {
                        werr = ntstatus_to_werror(status);
                        goto done;
                }
+               if (!NT_STATUS_IS_OK(result)) {
+                       werr = ntstatus_to_werror(result);
+                       goto done;
+               }
        }
 
        status = dcerpc_samr_OpenDomain(b, mem_ctx,