mirror of
https://github.com/samba-team/samba.git
synced 2025-09-12 13:44:19 +03:00
readability reformatting
stop this function from maiking my eyes bleed
This commit is contained in:
@@ -1392,7 +1392,8 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesW(struct dcesrv_call_state *dce_c
|
|||||||
/*
|
/*
|
||||||
netr_DsRGetDCNameEx2
|
netr_DsRGetDCNameEx2
|
||||||
*/
|
*/
|
||||||
static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
|
static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call,
|
||||||
|
TALLOC_CTX *mem_ctx,
|
||||||
struct netr_DsRGetDCNameEx2 *r)
|
struct netr_DsRGetDCNameEx2 *r)
|
||||||
{
|
{
|
||||||
const char * const attrs[] = { "objectGUID", NULL };
|
const char * const attrs[] = { "objectGUID", NULL };
|
||||||
@@ -1401,10 +1402,12 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
|
|||||||
struct ldb_dn *domain_dn;
|
struct ldb_dn *domain_dn;
|
||||||
int ret;
|
int ret;
|
||||||
struct netr_DsRGetDCNameInfo *info;
|
struct netr_DsRGetDCNameInfo *info;
|
||||||
|
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
|
||||||
|
|
||||||
ZERO_STRUCTP(r->out.info);
|
ZERO_STRUCTP(r->out.info);
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info);
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
|
dce_call->conn->auth_state.session_info);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@@ -1412,8 +1415,7 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
|
|||||||
/* Windows 7 sends the domain name in the form the user typed, so we
|
/* Windows 7 sends the domain name in the form the user typed, so we
|
||||||
* have to cope with both the short and long form here */
|
* have to cope with both the short and long form here */
|
||||||
if (r->in.domain_name != NULL &&
|
if (r->in.domain_name != NULL &&
|
||||||
!lp_is_my_domain_or_realm(dce_call->conn->dce_ctx->lp_ctx,
|
!lp_is_my_domain_or_realm(lp_ctx, r->in.domain_name)) {
|
||||||
r->in.domain_name)) {
|
|
||||||
return WERR_NO_SUCH_DOMAIN;
|
return WERR_NO_SUCH_DOMAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1432,18 +1434,21 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
|
|||||||
W_ERROR_HAVE_NO_MEMORY(info);
|
W_ERROR_HAVE_NO_MEMORY(info);
|
||||||
|
|
||||||
/* TODO: - return real IP address
|
/* TODO: - return real IP address
|
||||||
* - check all r->in.* parameters (server_unc is ignored by w2k3!)
|
* - check all r->in.* parameters
|
||||||
|
* (server_unc is ignored by w2k3!)
|
||||||
*/
|
*/
|
||||||
info->dc_unc = talloc_asprintf(mem_ctx, "\\\\%s.%s",
|
info->dc_unc = talloc_asprintf(mem_ctx, "\\\\%s.%s",
|
||||||
lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx),
|
lp_netbios_name(lp_ctx),
|
||||||
lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx));
|
lp_dnsdomain(lp_ctx));
|
||||||
W_ERROR_HAVE_NO_MEMORY(info->dc_unc);
|
W_ERROR_HAVE_NO_MEMORY(info->dc_unc);
|
||||||
|
|
||||||
info->dc_address = talloc_strdup(mem_ctx, "\\\\0.0.0.0");
|
info->dc_address = talloc_strdup(mem_ctx, "\\\\0.0.0.0");
|
||||||
W_ERROR_HAVE_NO_MEMORY(info->dc_address);
|
W_ERROR_HAVE_NO_MEMORY(info->dc_address);
|
||||||
|
|
||||||
info->dc_address_type = DS_ADDRESS_TYPE_INET;
|
info->dc_address_type = DS_ADDRESS_TYPE_INET;
|
||||||
info->domain_guid = samdb_result_guid(res[0], "objectGUID");
|
info->domain_guid = samdb_result_guid(res[0], "objectGUID");
|
||||||
info->domain_name = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
|
info->domain_name = lp_dnsdomain(lp_ctx);
|
||||||
info->forest_name = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
|
info->forest_name = lp_dnsdomain(lp_ctx);
|
||||||
info->dc_flags = DS_DNS_FOREST_ROOT |
|
info->dc_flags = DS_DNS_FOREST_ROOT |
|
||||||
DS_DNS_DOMAIN |
|
DS_DNS_DOMAIN |
|
||||||
DS_DNS_CONTROLLER |
|
DS_DNS_CONTROLLER |
|
||||||
@@ -1455,10 +1460,13 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
|
|||||||
DS_SERVER_LDAP |
|
DS_SERVER_LDAP |
|
||||||
DS_SERVER_GC |
|
DS_SERVER_GC |
|
||||||
DS_SERVER_PDC;
|
DS_SERVER_PDC;
|
||||||
|
|
||||||
info->dc_site_name = samdb_server_site_name(sam_ctx, mem_ctx);
|
info->dc_site_name = samdb_server_site_name(sam_ctx, mem_ctx);
|
||||||
W_ERROR_HAVE_NO_MEMORY(info->dc_site_name);
|
W_ERROR_HAVE_NO_MEMORY(info->dc_site_name);
|
||||||
|
|
||||||
/* FIXME: Hardcoded site name */
|
/* FIXME: Hardcoded site name */
|
||||||
info->client_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name");
|
info->client_site_name = talloc_strdup(mem_ctx,
|
||||||
|
"Default-First-Site-Name");
|
||||||
W_ERROR_HAVE_NO_MEMORY(info->client_site_name);
|
W_ERROR_HAVE_NO_MEMORY(info->client_site_name);
|
||||||
|
|
||||||
*r->out.info = info;
|
*r->out.info = info;
|
||||||
|
Reference in New Issue
Block a user