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");
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);
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;
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);
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 {
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) {
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));
}
}
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);
* 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,
{
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);
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;
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);
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);
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;
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);
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?");
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);
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 */
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>,....
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>,....
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "param/param.h"
+
/*
this type allows us to distinguish handle types
*/
struct dom_sid *domain_sid;
const char *domain_name;
struct ldb_dn *domain_dn;
+ enum server_role role;
};
/*