summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-22 07:28:41 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-22 07:28:41 +0000
commit8de48f3093a0e84bb732b24e7355780368f25a67 (patch)
tree476d8e2ce85c643e39b061daee46d966f6a14141 /source3/rpc_server
parent69321d1fc48795aaff73b64455c0330beb458a02 (diff)
downloadsamba-8de48f3093a0e84bb732b24e7355780368f25a67.tar.gz
samba-8de48f3093a0e84bb732b24e7355780368f25a67.tar.bz2
samba-8de48f3093a0e84bb732b24e7355780368f25a67.zip
Make our 'get DNS domain name' code try a bit harder - if gethostname() doesn't
include a domain portion, do a gethostbyname() lookup on that name. Use this name in our PolicyPrimaryDomainInformation reply (_lsa_query_info2) that Win2k uses when trying to trust us as a trusted domain. (We need to do a better mapping between our Netbios and Win2k domain names, but this will do for now - particularly annoying is the way this possibly needs to map with our kerberos realm). Andrew Bartlett (This used to be commit 3be03271030208a69da29c6e2a7b92cdbaa8c6aa)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_lsa_nt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 10c583b70d..7771e0ebfa 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -52,7 +52,7 @@ static void free_lsa_info(void *ptr)
{
struct lsa_info *lsa = (struct lsa_info *)ptr;
- SAFE_FREE(lsa);
+ SAFE_FRE(lsa);
}
/***************************************************************************
@@ -1222,6 +1222,7 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I
char *forest_name = NULL;
DOM_SID *sid = NULL;
GUID guid;
+ fstring dnsdomname;
ZERO_STRUCT(guid);
r_u->status = NT_STATUS_OK;
@@ -1241,8 +1242,15 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I
case ROLE_DOMAIN_BDC:
nb_name = lp_workgroup();
/* ugly temp hack for these next two */
- dns_name = lp_realm();
- forest_name = lp_realm();
+
+ /* This should be a 'netbios domain -> DNS domain' mapping */
+ dnsdomname[0] = '\0';
+ get_mydomname(dnsdomname);
+ strlower(dnsdomname);
+
+ dns_name = dnsdomname;
+ forest_name = dnsdomname;
+
sid = get_global_sam_sid();
secrets_fetch_domain_guid(lp_workgroup(), &guid);
break;