Author: jelmer
Date: 2007-12-07 13:30:23 +0000 (Fri, 07 Dec 2007)
New Revision: 26333

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26333

Log:
No more global_loadparm in finddcs.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/libcli/finddcs.c
   branches/SAMBA_4_0/source/libnet/libnet_lookup.c
   branches/SAMBA_4_0/source/winbind/wb_dom_info.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/libcli/finddcs.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/finddcs.c  2007-12-07 11:45:17 UTC (rev 
26332)
+++ branches/SAMBA_4_0/source/libcli/finddcs.c  2007-12-07 13:30:23 UTC (rev 
26333)
@@ -34,6 +34,7 @@
        struct composite_context *ctx;
        struct messaging_context *msg_ctx;
 
+       const char *my_netbios_name;
        const char *domain_name;
        struct dom_sid *domain_sid;
 
@@ -60,6 +61,7 @@
  */
 
 struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
+                                      const char *my_netbios_name,
                                       const char *domain_name,
                                       int name_type,
                                       struct dom_sid *domain_sid,
@@ -80,6 +82,7 @@
 
        state->ctx = c;
 
+       state->my_netbios_name = talloc_strdup(state, my_netbios_name);
        state->domain_name = talloc_strdup(state, domain_name);
        if (composite_nomem(state->domain_name, c)) return c;
 
@@ -144,9 +147,8 @@
 
        state->r.in.domainname = state->domain_name;
        state->r.in.ip_address = state->dcs[0].address;
-       state->r.in.my_computername = lp_netbios_name(global_loadparm);
-       state->r.in.my_accountname = talloc_asprintf(state, "%s$",
-                                       lp_netbios_name(global_loadparm));
+       state->r.in.my_computername = state->my_netbios_name;
+       state->r.in.my_accountname = talloc_asprintf(state, "%s$", 
state->my_netbios_name);
        if (composite_nomem(state->r.in.my_accountname, state->ctx)) return;
        state->r.in.account_control = ACB_WSTRUST;
        state->r.in.domain_sid = state->domain_sid;
@@ -244,6 +246,7 @@
 }
 
 NTSTATUS finddcs(TALLOC_CTX *mem_ctx,
+                const char *my_netbios_name,
                 const char *domain_name, int name_type, 
                 struct dom_sid *domain_sid,
                 const char **methods,
@@ -252,6 +255,7 @@
                 int *num_dcs, struct nbt_dc_name **dcs)
 {
        struct composite_context *c = finddcs_send(mem_ctx,
+                                                  my_netbios_name,
                                                   domain_name, name_type,
                                                   domain_sid, methods, 
                                                   event_ctx, msg_ctx);

Modified: branches/SAMBA_4_0/source/libnet/libnet_lookup.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_lookup.c    2007-12-07 11:45:17 UTC 
(rev 26332)
+++ branches/SAMBA_4_0/source/libnet/libnet_lookup.c    2007-12-07 13:30:23 UTC 
(rev 26333)
@@ -194,7 +194,8 @@
        struct messaging_context *msg_ctx = 
                messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, 
ctx->lp_ctx), ctx->event_ctx);
 
-       c = finddcs_send(mem_ctx, io->in.domain_name, io->in.name_type,
+       c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx),
+                        io->in.domain_name, io->in.name_type,
                         NULL, ctx->name_res_methods, ctx->event_ctx, msg_ctx);
        return c;
 }

Modified: branches/SAMBA_4_0/source/winbind/wb_dom_info.c
===================================================================
--- branches/SAMBA_4_0/source/winbind/wb_dom_info.c     2007-12-07 11:45:17 UTC 
(rev 26332)
+++ branches/SAMBA_4_0/source/winbind/wb_dom_info.c     2007-12-07 13:30:23 UTC 
(rev 26333)
@@ -67,7 +67,8 @@
        dom_sid = dom_sid_dup(mem_ctx, sid);
        if (dom_sid == NULL) goto failed;
 
-       ctx = finddcs_send(mem_ctx, domain_name, NBT_NAME_LOGON, 
+       ctx = finddcs_send(mem_ctx, lp_netbios_name(service->task->lp_ctx),
+                          domain_name, NBT_NAME_LOGON, 
                           dom_sid, 
                           lp_name_resolve_order(service->task->lp_ctx), 
                           service->task->event_ctx, 

Reply via email to