summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-07 02:37:13 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:41 +0100
commit6c77f353d3d952b46b401ab29837ba5b75e353c2 (patch)
treec78d6030280662a3a96b5a94c677f76fa47d2ed4 /source4
parent4c4323009fa83f00ed319de59a3aad48fcd65994 (diff)
downloadsamba-6c77f353d3d952b46b401ab29837ba5b75e353c2.tar.gz
samba-6c77f353d3d952b46b401ab29837ba5b75e353c2.tar.bz2
samba-6c77f353d3d952b46b401ab29837ba5b75e353c2.zip
r26328: remove more uses of global_loadparm.
(This used to be commit 40ae12c08647c47a9c504d39ee6f61c32b4e5748)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/messaging/tests/irpc.c2
-rw-r--r--source4/libnet/libnet.c2
-rw-r--r--source4/libnet/libnet_become_dc.c6
-rw-r--r--source4/libnet/libnet_join.c10
-rw-r--r--source4/libnet/libnet_lookup.c2
-rw-r--r--source4/libnet/libnet_samdump.c2
-rw-r--r--source4/libnet/libnet_samsync_ldb.c6
-rw-r--r--source4/libnet/libnet_unbecome_dc.c4
-rw-r--r--source4/libnet/libnet_vampire.c2
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c9
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.h3
11 files changed, 24 insertions, 24 deletions
diff --git a/source4/lib/messaging/tests/irpc.c b/source4/lib/messaging/tests/irpc.c
index 28676c21c7..0618adcfb2 100644
--- a/source4/lib/messaging/tests/irpc.c
+++ b/source4/lib/messaging/tests/irpc.c
@@ -226,7 +226,7 @@ static bool irpc_setup(struct torture_context *tctx, void **_data)
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");
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c
index 4502599217..5c483a757c 100644
--- a/source4/libnet/libnet.c
+++ b/source4/libnet/libnet.c
@@ -45,7 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev,
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);
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index a691fca420..4d09422bec 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -738,7 +738,7 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s)
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 @@ static NTSTATUS becomeDC_ldap_connect(struct libnet_BecomeDC_state *s,
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 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s,
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 {
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index 2f14799ced..6d7fcd09ad 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -230,7 +230,7 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
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 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
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 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx,
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 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx,
* 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,
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 459e5b1985..5788a56a88 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -192,7 +192,7 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx,
{
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);
diff --git a/source4/libnet/libnet_samdump.c b/source4/libnet/libnet_samdump.c
index 2186271491..93e25aa428 100644
--- a/source4/libnet/libnet_samdump.c
+++ b/source4/libnet/libnet_samdump.c
@@ -163,7 +163,7 @@ NTSTATUS libnet_SamDump(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
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;
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index ea6013391d..23cfe630d5 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -1193,7 +1193,7 @@ static NTSTATUS libnet_samsync_ldb_init(TALLOC_CTX *mem_ctx,
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 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str
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);
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index a39df4f254..415912e34d 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -258,7 +258,7 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s)
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 @@ static NTSTATUS unbecomeDC_ldap_connect(struct libnet_UnbecomeDC_state *s)
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);
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index e4c8833156..574b34c246 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -185,7 +185,7 @@ NTSTATUS libnet_SamSync_netlogon(struct libnet_context *ctx, TALLOC_CTX *mem_ctx
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?");
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index db659ef5a3..03f3601257 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -445,6 +445,7 @@ static NTSTATUS dcesrv_samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLO
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 @@ static NTSTATUS dcesrv_samr_info_DomInfo2(struct samr_domain_state *state,
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 @@ static NTSTATUS dcesrv_samr_info_DomInfo2(struct samr_domain_state *state,
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 @@ static NTSTATUS dcesrv_samr_info_DomInfo7(struct samr_domain_state *state,
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>,....
diff --git a/source4/rpc_server/samr/dcesrv_samr.h b/source4/rpc_server/samr/dcesrv_samr.h
index bc701fb932..7a6978344b 100644
--- a/source4/rpc_server/samr/dcesrv_samr.h
+++ b/source4/rpc_server/samr/dcesrv_samr.h
@@ -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 samr_domain_state {
struct dom_sid *domain_sid;
const char *domain_name;
struct ldb_dn *domain_dn;
+ enum server_role role;
};
/*