From d875b7d620c1007f38fb886cb8d5342a2d261585 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 24 May 2007 23:38:46 +0000 Subject: r23129: Merge from 3_0: * netr_DsRGetDCName_flags, netr_DsRGetDCNameInfo_AddressType and netr_DsR_DcFlags * the mask in netr_DsRGetDCNameEx2 turns out to be samr_AcctFlags Guenther (This used to be commit 9cdd6d9782a7a70f01d748228beb80c454d1468b) --- source4/librpc/idl/netlogon.idl | 60 +++++++++++++++++++++++---- source4/rpc_server/netlogon/dcerpc_netlogon.c | 14 ++++++- source4/torture/rpc/netlogon.c | 10 ++--- 3 files changed, 69 insertions(+), 15 deletions(-) (limited to 'source4') diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl index 05b435aa0f..6f860a8ca4 100644 --- a/source4/librpc/idl/netlogon.idl +++ b/source4/librpc/idl/netlogon.idl @@ -4,7 +4,7 @@ who contributed! */ -import "lsa.idl", "samr.idl", "security.idl"; +import "lsa.idl", "samr.idl", "security.idl", "nbt.idl"; #include "idl_types.h" @@ -906,15 +906,59 @@ interface netlogon WERROR netr_NETRENUMERATETRUSTEDDOMAINS() ; /*****************/ - /* Function 0x14 */ + /* Function 0x14 */ + + /* two unkown bits still: DS_IP_VERSION_AGNOSTIC and + * DS_TRY_NEXTCLOSEST_SITE - Guenther */ + + typedef [bitmap32bit] bitmap { + DS_FORCE_REDISCOVERY = 0x00000001, + DS_DIRECTORY_SERVICE_REQUIRED = 0x00000010, + DS_DIRECTORY_SERVICE_PREFERRED = 0x00000020, + DS_GC_SERVER_REQUIRED = 0x00000040, + DS_PDC_REQUIRED = 0x00000080, + DS_BACKGROUND_ONLY = 0x00000100, + DS_IP_REQUIRED = 0x00000200, + DS_KDC_REQUIRED = 0x00000400, + DS_TIMESERV_REQUIRED = 0x00000800, + DS_WRITABLE_REQUIRED = 0x00001000, + DS_GOOD_TIMESERV_PREFERRED = 0x00002000, + DS_AVOID_SELF = 0x00004000, + DS_ONLY_LDAP_NEEDED = 0x00008000, + DS_IS_FLAT_NAME = 0x00010000, + DS_IS_DNS_NAME = 0x00020000, + DS_RETURN_DNS_NAME = 0x40000000, + DS_RETURN_FLAT_NAME = 0x80000000 + } netr_DsRGetDCName_flags; + + typedef [v1_enum] enum { + DS_ADDRESS_TYPE_INET = 1, + DS_ADDRESS_TYPE_NETBIOS = 2 + } netr_DsRGetDCNameInfo_AddressType; + + typedef [bitmap32bit] bitmap { + DS_SERVER_PDC = NBT_SERVER_PDC, + DS_SERVER_GC = NBT_SERVER_GC, + DS_SERVER_LDAP = NBT_SERVER_LDAP, + DS_SERVER_DS = NBT_SERVER_DS, + DS_SERVER_KDC = NBT_SERVER_KDC, + DS_SERVER_TIMESERV = NBT_SERVER_TIMESERV, + DS_SERVER_CLOSEST = NBT_SERVER_CLOSEST, + DS_SERVER_WRITABLE = NBT_SERVER_WRITABLE, + DS_SERVER_GOOD_TIMESERV = NBT_SERVER_GOOD_TIMESERV, + DS_DNS_CONTROLLER = 0x20000000, + DS_DNS_DOMAIN = 0x40000000, + DS_DNS_FOREST = 0x80000000 + } netr_DsR_DcFlags; + typedef struct { [string,charset(UTF16)] uint16 *dc_unc; [string,charset(UTF16)] uint16 *dc_address; - int32 dc_address_type; + netr_DsRGetDCNameInfo_AddressType dc_address_type; GUID domain_guid; [string,charset(UTF16)] uint16 *domain_name; [string,charset(UTF16)] uint16 *forest_name; - uint32 dc_flags; + netr_DsR_DcFlags dc_flags; [string,charset(UTF16)] uint16 *dc_site_name; [string,charset(UTF16)] uint16 *client_site_name; } netr_DsRGetDCNameInfo; @@ -924,7 +968,7 @@ interface netlogon [in] [string,charset(UTF16)] uint16 *domain_name, [in] GUID *domain_guid, [in] GUID *site_guid, - [in] uint32 flags, + [in] netr_DsRGetDCName_flags flags, [out] netr_DsRGetDCNameInfo *info ); @@ -968,7 +1012,7 @@ interface netlogon [in] [string,charset(UTF16)] uint16 *domain_name, [in] GUID *domain_guid, [in] [string,charset(UTF16)] uint16 *site_name, - [in] uint32 flags, + [in] netr_DsRGetDCName_flags flags, [out] netr_DsRGetDCNameInfo *info ); @@ -1079,11 +1123,11 @@ interface netlogon WERROR netr_DsRGetDCNameEx2( [in] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 *client_account, - [in] uint32 mask, + [in] samr_AcctFlags mask, [in] [string,charset(UTF16)] uint16 *domain_name, [in] GUID *domain_guid, [in] [string,charset(UTF16)] uint16 *site_name, - [in] uint32 flags, + [in] netr_DsRGetDCName_flags flags, [out] netr_DsRGetDCNameInfo *info ); diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 03625bfd43..619f678b3f 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -1010,11 +1010,21 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA 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 = 1; + 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 = 0xE00001FD; + r->out.info->dc_flags = DS_DNS_FOREST | + DS_DNS_DOMAIN | + DS_DNS_CONTROLLER | + DS_SERVER_WRITABLE | + DS_SERVER_CLOSEST | + DS_SERVER_TIMESERV | + DS_SERVER_KDC | + DS_SERVER_DS | + 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"); diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 7e8ef99bf6..967b615bc3 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -1224,7 +1224,7 @@ static BOOL test_netr_DsRGetDCName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) r.in.domain_name = talloc_asprintf(mem_ctx, "%s", lp_realm()); r.in.domain_guid = NULL; r.in.site_guid = NULL; - r.in.flags = 0x40000000; + r.in.flags = DS_RETURN_DNS_NAME; printf("Testing netr_DsRGetDCName\n"); @@ -1255,7 +1255,7 @@ static BOOL test_netr_DsRGetDCNameEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) r.in.domain_name = talloc_asprintf(mem_ctx, "%s", lp_realm()); r.in.domain_guid = NULL; r.in.site_name = NULL; - r.in.flags = 0x40000000; + r.in.flags = DS_RETURN_DNS_NAME; printf("Testing netr_DsRGetDCNameEx\n"); @@ -1288,7 +1288,7 @@ static BOOL test_netr_DsRGetDCNameEx2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx r.in.domain_name = talloc_asprintf(mem_ctx, "%s", lp_realm()); r.in.domain_guid = NULL; r.in.site_name = NULL; - r.in.flags = 0x40000000; + r.in.flags = DS_RETURN_DNS_NAME; printf("Testing netr_DsRGetDCNameEx2 without client account\n"); @@ -1301,8 +1301,8 @@ static BOOL test_netr_DsRGetDCNameEx2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx printf("Testing netr_DsRGetDCNameEx2 with client acount\n"); r.in.client_account = TEST_MACHINE_NAME"$"; - r.in.mask = 0x00002000; - r.in.flags = 0x80000000; + r.in.mask = ACB_SVRTRUST; + r.in.flags = DS_RETURN_FLAT_NAME; status = dcerpc_netr_DsRGetDCNameEx2(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { -- cgit