diff options
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/common/server_info.c | 12 | ||||
-rw-r--r-- | source4/rpc_server/lsa/lsa_lookup.c | 17 | ||||
-rw-r--r-- | source4/rpc_server/netlogon/dcerpc_netlogon.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 7 | ||||
-rw-r--r-- | source4/rpc_server/service_rpc.c | 11 | ||||
-rw-r--r-- | source4/rpc_server/srvsvc/dcesrv_srvsvc.c | 8 | ||||
-rw-r--r-- | source4/rpc_server/wkssvc/dcesrv_wkssvc.c | 8 |
7 files changed, 38 insertions, 29 deletions
diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index cf46954c33..0a44493df5 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -64,21 +64,21 @@ const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_con } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { - return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_major", 5); + return lp_parm_int(lp_ctx, NULL, "server_info", "version_major", 5); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { - return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_minor", 2); + return lp_parm_int(lp_ctx, NULL, "server_info", "version_minor", 2); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { - return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_build", 3790); + return lp_parm_int(lp_ctx, NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c index cb4092355e..bcc2af97a7 100644 --- a/source4/rpc_server/lsa/lsa_lookup.c +++ b/source4/rpc_server/lsa/lsa_lookup.c @@ -195,7 +195,8 @@ static NTSTATUS lookup_well_known_sids(TALLOC_CTX *mem_ctx, /* lookup a SID for 1 name */ -static NTSTATUS dcesrv_lsa_lookup_name(struct lsa_policy_state *state, TALLOC_CTX *mem_ctx, +static NTSTATUS dcesrv_lsa_lookup_name(struct loadparm_context *lp_ctx, + struct lsa_policy_state *state, TALLOC_CTX *mem_ctx, const char *name, const char **authority_name, struct dom_sid **sid, enum lsa_SidType *rtype) { @@ -217,7 +218,7 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct lsa_policy_state *state, TALLOC_CT } username = p + 1; } else if (strchr_m(name, '@')) { - status = crack_name_to_nt4_name(mem_ctx, global_loadparm, DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL, name, &domain, &username); + status = crack_name_to_nt4_name(mem_ctx, lp_ctx, DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL, name, &domain, &username); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -263,7 +264,7 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct lsa_policy_state *state, TALLOC_CT if (!name) { return NT_STATUS_NO_MEMORY; } - status = dcesrv_lsa_lookup_name(state, mem_ctx, name, authority_name, sid, rtype); + status = dcesrv_lsa_lookup_name(lp_ctx, state, mem_ctx, name, authority_name, sid, rtype); if (NT_STATUS_IS_OK(status)) { return status; } @@ -273,7 +274,7 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct lsa_policy_state *state, TALLOC_CT if (!name) { return NT_STATUS_NO_MEMORY; } - status = dcesrv_lsa_lookup_name(state, mem_ctx, name, authority_name, sid, rtype); + status = dcesrv_lsa_lookup_name(lp_ctx, state, mem_ctx, name, authority_name, sid, rtype); if (NT_STATUS_IS_OK(status)) { return status; } @@ -283,7 +284,7 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct lsa_policy_state *state, TALLOC_CT if (!name) { return NT_STATUS_NO_MEMORY; } - status = dcesrv_lsa_lookup_name(state, mem_ctx, name, authority_name, sid, rtype); + status = dcesrv_lsa_lookup_name(lp_ctx, state, mem_ctx, name, authority_name, sid, rtype); if (NT_STATUS_IS_OK(status)) { return status; } @@ -679,6 +680,7 @@ NTSTATUS dcesrv_lsa_LookupNames3(struct dcesrv_call_state *dce_call, struct lsa_policy_state *policy_state; struct dcesrv_handle *policy_handle; int i; + struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx; DCESRV_PULL_HANDLE(policy_handle, r->in.handle, LSA_HANDLE_POLICY); @@ -719,7 +721,7 @@ NTSTATUS dcesrv_lsa_LookupNames3(struct dcesrv_call_state *dce_call, r->out.sids->sids[i].sid_index = 0xFFFFFFFF; r->out.sids->sids[i].unknown = 0; - status2 = dcesrv_lsa_lookup_name(policy_state, mem_ctx, name, &authority_name, &sid, &rtype); + status2 = dcesrv_lsa_lookup_name(lp_ctx, policy_state, mem_ctx, name, &authority_name, &sid, &rtype); if (!NT_STATUS_IS_OK(status2) || sid->num_auths == 0) { continue; } @@ -812,6 +814,7 @@ NTSTATUS dcesrv_lsa_LookupNames2(struct dcesrv_call_state *dce_call, struct lsa_policy_state *state; struct dcesrv_handle *h; int i; + struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx; r->out.domains = NULL; @@ -851,7 +854,7 @@ NTSTATUS dcesrv_lsa_LookupNames2(struct dcesrv_call_state *dce_call, r->out.sids->sids[i].sid_index = 0xFFFFFFFF; r->out.sids->sids[i].unknown = 0; - status2 = dcesrv_lsa_lookup_name(state, mem_ctx, name, + status2 = dcesrv_lsa_lookup_name(lp_ctx, state, mem_ctx, name, &authority_name, &sid, &rtype); if (!NT_STATUS_IS_OK(status2)) { continue; diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 0ddc11c8b8..15916a81fc 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -246,7 +246,7 @@ static NTSTATUS dcesrv_netr_creds_server_step_check(struct loadparm_context *lp_ struct ldb_context *ldb; int ret; - ldb = schannel_db_connect(mem_ctx, global_loadparm); + ldb = schannel_db_connect(mem_ctx, lp_ctx); if (!ldb) { return NT_STATUS_ACCESS_DENIED; } @@ -262,7 +262,7 @@ static NTSTATUS dcesrv_netr_creds_server_step_check(struct loadparm_context *lp_ * update the structure */ nt_status = schannel_fetch_session_key_ldb(ldb, ldb, computer_name, - lp_workgroup(global_loadparm), + lp_workgroup(lp_ctx), &creds); if (NT_STATUS_IS_OK(nt_status)) { nt_status = creds_server_step_check(creds, diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index dcb1554740..9a6ebe43b7 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -494,9 +494,10 @@ static NTSTATUS dcesrv_samr_info_DomInfo1(struct samr_domain_state *state, /* return DomInfo2 */ -static NTSTATUS dcesrv_samr_info_DomInfo2(struct samr_domain_state *state, TALLOC_CTX *mem_ctx, - struct ldb_message **dom_msgs, - struct samr_DomInfo2 *info) +static NTSTATUS dcesrv_samr_info_DomInfo2(struct samr_domain_state *state, + TALLOC_CTX *mem_ctx, + struct ldb_message **dom_msgs, + struct samr_DomInfo2 *info) { enum server_role role = lp_server_role(global_loadparm); diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c index e5ed3bd0cf..9cce529238 100644 --- a/source4/rpc_server/service_rpc.c +++ b/source4/rpc_server/service_rpc.c @@ -107,7 +107,7 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn) struct dcesrv_connection *dcesrv_conn = NULL; struct auth_session_info *session_info = NULL; - status = auth_anonymous_session_info(srv_conn, global_loadparm, &session_info); + status = auth_anonymous_session_info(srv_conn, dcesrv_sock->dcesrv_ctx->lp_ctx, &session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("dcesrv_sock_accept: auth_anonymous_session_info failed: %s\n", nt_errstr(status))); @@ -234,6 +234,7 @@ static NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, "unix", e->ep_description->endpoint, &port, + lp_socket_options(lp_ctx), dcesrv_sock); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("service_setup_stream_socket(path=%s) failed - %s\n", @@ -271,7 +272,9 @@ static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, dcesrv_sock->dcesrv_ctx = talloc_reference(dcesrv_sock, dce_ctx); status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, - "unix", full_path, &port, dcesrv_sock); + "unix", full_path, &port, + lp_socket_options(lp_ctx), + dcesrv_sock); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("service_setup_stream_socket(identifier=%s,path=%s) failed - %s\n", e->ep_description->endpoint, full_path, nt_errstr(status))); @@ -350,7 +353,9 @@ static NTSTATUS add_socket_rpc_tcp_iface(struct dcesrv_context *dce_ctx, struct dcesrv_sock->dcesrv_ctx = talloc_reference(dcesrv_sock, dce_ctx); status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, - "ipv4", address, &port, dcesrv_sock); + "ipv4", address, &port, + lp_socket_options(dce_ctx->lp_ctx), + dcesrv_sock); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("service_setup_stream_socket(address=%s,port=%u) failed - %s\n", address, port, nt_errstr(status))); diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c index d76e83ba17..55a647b7ef 100644 --- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c +++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c @@ -1496,8 +1496,8 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA info101->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, r->in.server_unc); W_ERROR_HAVE_NO_MEMORY(info101->server_name); - info101->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx); - info101->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx); + info101->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx->lp_ctx); + info101->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx->lp_ctx); info101->server_type = dcesrv_common_get_server_type(mem_ctx, dce_ctx); info101->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(info101->comment); @@ -1516,8 +1516,8 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA info102->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, r->in.server_unc); W_ERROR_HAVE_NO_MEMORY(info102->server_name); - info102->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx); - info102->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx); + info102->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx->lp_ctx); + info102->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx->lp_ctx); info102->server_type = dcesrv_common_get_server_type(mem_ctx, dce_ctx); info102->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx)); W_ERROR_HAVE_NO_MEMORY(info102->comment); diff --git a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c index 556272afd5..cbade288ca 100644 --- a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c +++ b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c @@ -51,8 +51,8 @@ static WERROR dcesrv_wkssvc_NetWkstaGetInfo(struct dcesrv_call_state *dce_call, W_ERROR_HAVE_NO_MEMORY(info100->server_name); info100->domain_name = dcesrv_common_get_domain_name(mem_ctx, dce_ctx); W_ERROR_HAVE_NO_MEMORY(info100->domain_name); - info100->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx); - info100->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx); + info100->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx->lp_ctx); + info100->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx->lp_ctx); r->out.info->info100 = info100; return WERR_OK; @@ -69,8 +69,8 @@ static WERROR dcesrv_wkssvc_NetWkstaGetInfo(struct dcesrv_call_state *dce_call, W_ERROR_HAVE_NO_MEMORY(info101->server_name); info101->domain_name = dcesrv_common_get_domain_name(mem_ctx, dce_ctx); W_ERROR_HAVE_NO_MEMORY(info101->domain_name); - info101->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx); - info101->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx); + info101->version_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx->lp_ctx); + info101->version_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx->lp_ctx); info101->lan_root = dcesrv_common_get_lan_root(mem_ctx, dce_ctx); r->out.info->info101 = info101; |