Author: jelmer
Date: 2007-12-07 02:37:13 +0000 (Fri, 07 Dec 2007)
New Revision: 26328

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

Log:
remove more uses of global_loadparm.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c
   branches/SAMBA_4_0/source/libnet/libnet.c
   branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
   branches/SAMBA_4_0/source/libnet/libnet_join.c
   branches/SAMBA_4_0/source/libnet/libnet_lookup.c
   branches/SAMBA_4_0/source/libnet/libnet_samdump.c
   branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c
   branches/SAMBA_4_0/source/libnet/libnet_unbecome_dc.c
   branches/SAMBA_4_0/source/libnet/libnet_vampire.c
   branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
   branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.h


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/lib/messaging/tests/irpc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c        2007-12-07 
02:37:04 UTC (rev 26327)
+++ branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c        2007-12-07 
02:37:13 UTC (rev 26328)
@@ -226,7 +226,7 @@
 
        torture_assert(tctx, data->msg_ctx2 = 
                       messaging_init(tctx, 
-                                     lp_messaging_path(tctx, global_loadparm),
+                                     lp_messaging_path(tctx, tctx->lp_ctx),
                                      cluster_id(MSG_ID2), data->ev),
                       "Failed to init second messaging context");
 

Modified: branches/SAMBA_4_0/source/libnet/libnet.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet.c   2007-12-07 02:37:04 UTC (rev 
26327)
+++ branches/SAMBA_4_0/source/libnet/libnet.c   2007-12-07 02:37:13 UTC (rev 
26328)
@@ -45,7 +45,7 @@
        ctx->lp_ctx = lp_ctx;
 
        /* name resolution methods */
-       ctx->name_res_methods = str_list_copy(ctx, 
lp_name_resolve_order(global_loadparm));
+       ctx->name_res_methods = str_list_copy(ctx, 
lp_name_resolve_order(lp_ctx));
 
        /* connected services' params */
        ZERO_STRUCT(ctx->samr);

Modified: branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_become_dc.c 2007-12-07 02:37:04 UTC 
(rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_become_dc.c 2007-12-07 02:37:13 UTC 
(rev 26328)
@@ -738,7 +738,7 @@
        struct cldap_request *req;
 
        s->cldap.io.in.dest_address     = s->source_dsa.address;
-       s->cldap.io.in.dest_port        = lp_cldap_port(global_loadparm);
+       s->cldap.io.in.dest_port        = lp_cldap_port(s->libnet->lp_ctx);
        s->cldap.io.in.realm            = s->domain.dns_name;
        s->cldap.io.in.host             = s->dest_dsa.netbios_name;
        s->cldap.io.in.user             = NULL;
@@ -792,7 +792,7 @@
        url = talloc_asprintf(s, "ldap://%s/";, s->source_dsa.dns_name);
        NT_STATUS_HAVE_NO_MEMORY(url);
 
-       ldap->ldb = ldb_wrap_connect(s, global_loadparm, url,
+       ldap->ldb = ldb_wrap_connect(s, s->libnet->lp_ctx, url,
                                     NULL,
                                     s->libnet->cred,
                                     0, NULL);
@@ -1513,7 +1513,7 @@
        drsuapi->s = s;
 
        if (!drsuapi->binding) {
-               if (lp_parm_bool(global_loadparm, NULL, "become_dc", "print", 
false)) {
+               if (lp_parm_bool(s->libnet->lp_ctx, NULL, "become_dc", "print", 
false)) {
                        binding_str = talloc_asprintf(s, 
"ncacn_ip_tcp:%s[krb5,print,seal]", s->source_dsa.dns_name);
                        if (composite_nomem(binding_str, c)) return;
                } else {

Modified: branches/SAMBA_4_0/source/libnet/libnet_join.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_join.c      2007-12-07 02:37:04 UTC 
(rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_join.c      2007-12-07 02:37:13 UTC 
(rev 26328)
@@ -230,7 +230,7 @@
                return NT_STATUS_NO_MEMORY;
        }
 
-       remote_ldb = ldb_wrap_connect(tmp_ctx, global_loadparm, 
+       remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->lp_ctx, 
                                      remote_ldb_url, 
                                      NULL, ctx->cred, 0, NULL);
        if (!remote_ldb) {
@@ -538,8 +538,8 @@
                        connect_with_info->out.domain_name = 
talloc_strdup(tmp_ctx, r->in.domain_name);
                } else {
                        /* Bugger, we just lost our way to automaticly find the 
domain name */
-                       connect_with_info->out.domain_name = 
talloc_strdup(tmp_ctx, lp_workgroup(global_loadparm));
-                       connect_with_info->out.realm = talloc_strdup(tmp_ctx, 
lp_realm(global_loadparm));
+                       connect_with_info->out.domain_name = 
talloc_strdup(tmp_ctx, lp_workgroup(ctx->lp_ctx));
+                       connect_with_info->out.realm = talloc_strdup(tmp_ctx, 
lp_realm(ctx->lp_ctx));
                }
        }
 
@@ -891,7 +891,7 @@
        if (r->in.netbios_name != NULL) {
                netbios_name = r->in.netbios_name;
        } else {
-               netbios_name = talloc_reference(tmp_mem, 
lp_netbios_name(global_loadparm));
+               netbios_name = talloc_reference(tmp_mem, 
lp_netbios_name(ctx->lp_ctx));
                if (!netbios_name) {
                        r->out.error_string = NULL;
                        talloc_free(tmp_mem);
@@ -910,7 +910,7 @@
         * Local secrets are stored in secrets.ldb 
         * open it to make sure we can write the info into it after the join
         */
-       ldb = secrets_db_connect(tmp_mem, global_loadparm);
+       ldb = secrets_db_connect(tmp_mem, ctx->lp_ctx);
        if (!ldb) {
                r->out.error_string
                        = talloc_asprintf(mem_ctx, 

Modified: branches/SAMBA_4_0/source/libnet/libnet_lookup.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_lookup.c    2007-12-07 02:37:04 UTC 
(rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_lookup.c    2007-12-07 02:37:13 UTC 
(rev 26328)
@@ -192,7 +192,7 @@
 {
        struct composite_context *c;
        struct messaging_context *msg_ctx = 
-               messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, 
global_loadparm), ctx->event_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,
                         NULL, ctx->name_res_methods, ctx->event_ctx, msg_ctx);

Modified: branches/SAMBA_4_0/source/libnet/libnet_samdump.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_samdump.c   2007-12-07 02:37:04 UTC 
(rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_samdump.c   2007-12-07 02:37:13 UTC 
(rev 26328)
@@ -163,7 +163,7 @@
 
        r2.out.error_string            = NULL;
        r2.in.binding_string           = r->in.binding_string;
-       r2.in.rid_crypt                = lp_parm_bool(global_loadparm, NULL, 
"vampire", "rid decrypt", true);
+       r2.in.rid_crypt                = lp_parm_bool(ctx->lp_ctx, NULL, 
"vampire", "rid decrypt", true);
        r2.in.init_fn                  = NULL;
        r2.in.delta_fn                 = libnet_samdump_fn;
        r2.in.fn_ctx                   = samdump_state;

Modified: branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c       2007-12-07 
02:37:04 UTC (rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c       2007-12-07 
02:37:13 UTC (rev 26328)
@@ -1193,7 +1193,7 @@
                ldap_url = talloc_asprintf(state, "ldap://%s";, server);
                
                state->remote_ldb = ldb_wrap_connect(mem_ctx, 
-                                                    global_loadparm, 
+                                                    
state->samsync_state->machine_net_ctx->lp_ctx, 
                                                     ldap_url, 
                                                     NULL, 
state->samsync_state->machine_net_ctx->cred,
                                                     0, NULL);
@@ -1221,8 +1221,8 @@
        state->trusted_domains = NULL;
 
        state->sam_ldb         = ldb_wrap_connect(mem_ctx, 
-                                                 global_loadparm, 
-                                                 lp_sam_url(global_loadparm), 
+                                                 ctx->lp_ctx, 
+                                                 lp_sam_url(ctx->lp_ctx), 
                                                  r->in.session_info,
                                                  ctx->cred, 0, NULL);
 

Modified: branches/SAMBA_4_0/source/libnet/libnet_unbecome_dc.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_unbecome_dc.c       2007-12-07 
02:37:04 UTC (rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_unbecome_dc.c       2007-12-07 
02:37:13 UTC (rev 26328)
@@ -258,7 +258,7 @@
        struct cldap_request *req;
 
        s->cldap.io.in.dest_address     = s->source_dsa.address;
-       s->cldap.io.in.dest_port        = lp_cldap_port(global_loadparm);
+       s->cldap.io.in.dest_port        = lp_cldap_port(s->libnet->lp_ctx);
        s->cldap.io.in.realm            = s->domain.dns_name;
        s->cldap.io.in.host             = s->dest_dsa.netbios_name;
        s->cldap.io.in.user             = NULL;
@@ -309,7 +309,7 @@
        url = talloc_asprintf(s, "ldap://%s/";, s->source_dsa.dns_name);
        NT_STATUS_HAVE_NO_MEMORY(url);
 
-       s->ldap.ldb = ldb_wrap_connect(s, global_loadparm, url,
+       s->ldap.ldb = ldb_wrap_connect(s, s->libnet->lp_ctx, url,
                                       NULL,
                                       s->libnet->cred,
                                       0, NULL);

Modified: branches/SAMBA_4_0/source/libnet/libnet_vampire.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_vampire.c   2007-12-07 02:37:04 UTC 
(rev 26327)
+++ branches/SAMBA_4_0/source/libnet/libnet_vampire.c   2007-12-07 02:37:13 UTC 
(rev 26328)
@@ -185,7 +185,7 @@
                        talloc_free(samsync_ctx);
                        return NT_STATUS_NO_MEMORY;
                }
-               cli_credentials_set_conf(machine_account, global_loadparm);
+               cli_credentials_set_conf(machine_account, ctx->lp_ctx);
                nt_status = 
cli_credentials_set_machine_account(machine_account);
                if (!NT_STATUS_IS_OK(nt_status)) {
                        r->out.error_string = talloc_strdup(mem_ctx, "Could not 
obtain machine account password - are we joined to the domain?");

Modified: branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c     2007-12-07 
02:37:04 UTC (rev 26327)
+++ branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c     2007-12-07 
02:37:13 UTC (rev 26328)
@@ -445,6 +445,7 @@
                return NT_STATUS_NO_MEMORY;
        }
 
+       d_state->role = lp_server_role(dce_call->conn->dce_ctx->lp_ctx);
        d_state->connect_state = talloc_reference(d_state, c_state);
        d_state->sam_ctx = c_state->sam_ctx;
        d_state->domain_sid = dom_sid_dup(d_state, r->in.sid);
@@ -499,8 +500,6 @@
                                          struct ldb_message **dom_msgs,
                                          struct samr_DomInfo2 *info)
 {
-       enum server_role role = lp_server_role(global_loadparm);
-
        /* This pulls the NetBIOS name from the 
           cn=NTDS Settings,cn=<NETBIOS name of PDC>,....
           string */
@@ -514,7 +513,7 @@
 
        info->sequence_num = ldb_msg_find_attr_as_uint64(dom_msgs[0], 
"modifiedCount", 
                                                 0);
-       switch (role) {
+       switch (state->role) {
        case ROLE_DOMAIN_CONTROLLER:
                /* This pulls the NetBIOS name from the 
                   cn=NTDS Settings,cn=<NETBIOS name of PDC>,....
@@ -612,9 +611,7 @@
                                   struct samr_DomInfo7 *info)
 {
 
-       enum server_role role = lp_server_role(global_loadparm);
-
-       switch (role) {
+       switch (state->role) {
        case ROLE_DOMAIN_CONTROLLER:
                /* This pulls the NetBIOS name from the 
                   cn=NTDS Settings,cn=<NETBIOS name of PDC>,....

Modified: branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.h
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.h     2007-12-07 
02:37:04 UTC (rev 26327)
+++ branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.h     2007-12-07 
02:37:13 UTC (rev 26328)
@@ -19,6 +19,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "param/param.h"
+
 /*
   this type allows us to distinguish handle types
 */
@@ -49,6 +51,7 @@
        struct dom_sid *domain_sid;
        const char *domain_name;
        struct ldb_dn *domain_dn;
+       enum server_role role;
 };
 
 /*

Reply via email to