s4:auth_winbind: use irpc_binding_handle_by_name()
authorStefan Metzmacher <metze@samba.org>
Fri, 3 Sep 2010 14:59:05 +0000 (16:59 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 3 Sep 2010 15:01:56 +0000 (17:01 +0200)
metze

source4/auth/ntlm/auth_winbind.c
source4/auth/ntlm/wscript_build

index 86526dc64bf379ff2fef7788fe64fbec17117583..0dc52b916973c1973faa1303cf2b66601865c1e5 100644 (file)
@@ -25,7 +25,7 @@
 #include "auth/auth.h"
 #include "auth/ntlm/auth_proto.h"
 #include "auth/auth_sam_reply.h"
-#include "librpc/gen_ndr/ndr_winbind.h"
+#include "librpc/gen_ndr/ndr_winbind_c.h"
 #include "lib/messaging/irpc.h"
 #include "param/param.h"
 #include "nsswitch/libwbclient/wbclient.h"
@@ -134,7 +134,7 @@ static NTSTATUS winbind_check_password(struct auth_method_context *ctx,
                                       struct auth_serversupplied_info **server_info)
 {
        NTSTATUS status;
-       struct server_id *winbind_servers;
+       struct dcerpc_binding_handle *irpc_handle;
        struct winbind_check_password_state *s;
        const struct auth_usersupplied_info *user_info_new;
        struct netr_IdentityInfo *identity_info;
@@ -147,8 +147,10 @@ static NTSTATUS winbind_check_password(struct auth_method_context *ctx,
        s = talloc(mem_ctx, struct winbind_check_password_state);
        NT_STATUS_HAVE_NO_MEMORY(s);
 
-       winbind_servers = irpc_servers_byname(ctx->auth_ctx->msg_ctx, s, "winbind_server");
-       if ((winbind_servers == NULL) || (winbind_servers[0].id == 0)) {
+       irpc_handle = irpc_binding_handle_by_name(s, ctx->auth_ctx->msg_ctx,
+                                                 "winbind_server",
+                                                 &ndr_table_winbind);
+       if (irpc_handle == NULL) {
                DEBUG(0, ("Winbind authentication for [%s]\\[%s] failed, " 
                          "no winbind_server running!\n",
                          user_info->client.domain_name, user_info->client.account_name));
@@ -209,9 +211,7 @@ static NTSTATUS winbind_check_password(struct auth_method_context *ctx,
 
        s->req.in.validation_level      = 3;
 
-       status = IRPC_CALL(ctx->auth_ctx->msg_ctx, winbind_servers[0],
-                          winbind, WINBIND_SAMLOGON,
-                          &s->req, s);
+       status = dcerpc_winbind_SamLogon_r(irpc_handle, s, &s->req);
        NT_STATUS_NOT_OK_RETURN(status);
 
        status = make_server_info_netlogon_validation(mem_ctx,
index 6368d2d1ca4ddd7e007edceeb4b7a1206d2907f1..c3ce36407798873af8116c578a0ecc96db3fb193 100644 (file)
@@ -27,7 +27,7 @@ bld.SAMBA_MODULE('auth_winbind',
        source='auth_winbind.c',
        subsystem='auth',
        init_function='auth_winbind_init',
-       deps='NDR_WINBIND MESSAGING LIBWBCLIENT'
+       deps='RPC_NDR_WINBIND MESSAGING LIBWBCLIENT'
        )