summaryrefslogtreecommitdiff
path: root/source4/rpc_server/netlogon
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-28 01:43:06 +0100
committerGünther Deschner <gd@samba.org>2008-10-29 08:56:52 +0100
commitf0697b0ad55fb1915541bf15adc8a4954462f005 (patch)
tree8484d27d9b92479a004475e3875704e0013f78e9 /source4/rpc_server/netlogon
parentf82a11783286abf30c8a36cc46a5098b3284d65d (diff)
downloadsamba-f0697b0ad55fb1915541bf15adc8a4954462f005.tar.gz
samba-f0697b0ad55fb1915541bf15adc8a4954462f005.tar.bz2
samba-f0697b0ad55fb1915541bf15adc8a4954462f005.zip
s4-netlogon: merge netr_DsRGetDCName{Ex,Ex2} from s3 idl.
Guenther
Diffstat (limited to 'source4/rpc_server/netlogon')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index d9717fdc57..5bf60d1578 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1125,8 +1125,9 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
struct ldb_message **res;
struct ldb_dn *domain_dn;
int ret;
+ struct netr_DsRGetDCNameInfo *info;
- ZERO_STRUCT(r->out);
+ 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);
if (sam_ctx == NULL) {
@@ -1144,23 +1145,23 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
return WERR_NO_SUCH_DOMAIN;
}
- r->out.info = talloc(mem_ctx, struct netr_DsRGetDCNameInfo);
- W_ERROR_HAVE_NO_MEMORY(r->out.info);
+ info = talloc(mem_ctx, struct netr_DsRGetDCNameInfo);
+ W_ERROR_HAVE_NO_MEMORY(info);
/* TODO: - return real IP address
* - check all r->in.* parameters (server_unc is ignored by w2k3!)
*/
- r->out.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_realm(dce_call->conn->dce_ctx->lp_ctx));
- W_ERROR_HAVE_NO_MEMORY(r->out.info->dc_unc);
- r->out.info->dc_address = talloc_strdup(mem_ctx, "\\\\0.0.0.0");
- W_ERROR_HAVE_NO_MEMORY(r->out.info->dc_address);
- r->out.info->dc_address_type = DS_ADDRESS_TYPE_INET;
- r->out.info->domain_guid = samdb_result_guid(res[0], "objectGUID");
- r->out.info->domain_name = samdb_result_string(res[0], "dnsDomain", NULL);
- r->out.info->forest_name = samdb_result_string(res[0], "dnsDomain", NULL);
- r->out.info->dc_flags = DS_DNS_FOREST |
+ W_ERROR_HAVE_NO_MEMORY(info->dc_unc);
+ info->dc_address = talloc_strdup(mem_ctx, "\\\\0.0.0.0");
+ W_ERROR_HAVE_NO_MEMORY(info->dc_address);
+ info->dc_address_type = DS_ADDRESS_TYPE_INET;
+ info->domain_guid = samdb_result_guid(res[0], "objectGUID");
+ info->domain_name = samdb_result_string(res[0], "dnsDomain", NULL);
+ info->forest_name = samdb_result_string(res[0], "dnsDomain", NULL);
+ info->dc_flags = DS_DNS_FOREST |
DS_DNS_DOMAIN |
DS_DNS_CONTROLLER |
DS_SERVER_WRITABLE |
@@ -1171,10 +1172,12 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
DS_SERVER_LDAP |
DS_SERVER_GC |
DS_SERVER_PDC;
- r->out.info->dc_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name");
- W_ERROR_HAVE_NO_MEMORY(r->out.info->dc_site_name);
- r->out.info->client_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name");
- W_ERROR_HAVE_NO_MEMORY(r->out.info->client_site_name);
+ info->dc_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name");
+ W_ERROR_HAVE_NO_MEMORY(info->dc_site_name);
+ info->client_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name");
+ W_ERROR_HAVE_NO_MEMORY(info->client_site_name);
+
+ *r->out.info = info;
return WERR_OK;
}
@@ -1197,12 +1200,10 @@ static WERROR dcesrv_netr_DsRGetDCNameEx(struct dcesrv_call_state *dce_call, TAL
r2.in.domain_name = r->in.domain_name;
r2.in.site_name = r->in.site_name;
r2.in.flags = r->in.flags;
- r2.out.info = NULL;
+ r2.out.info = r->out.info;
werr = dcesrv_netr_DsRGetDCNameEx2(dce_call, mem_ctx, &r2);
-
- r->out.info = r2.out.info;
-
+
return werr;
}
@@ -1225,15 +1226,12 @@ static WERROR dcesrv_netr_DsRGetDCName(struct dcesrv_call_state *dce_call, TALLO
r2.in.site_name = NULL; /* should fill in from site GUID */
r2.in.flags = r->in.flags;
- r2.out.info = NULL;
+ r2.out.info = r->out.info;
werr = dcesrv_netr_DsRGetDCNameEx2(dce_call, mem_ctx, &r2);
-
- r->out.info = r2.out.info;
-
+
return werr;
}
-
/*
netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
*/