mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
Merge from 3.0 - try harder to get our real DNS domain name, and send this
to the client when it asks for our DNS name and forest name. (needed for win2k to trust us as a trusted domain). Andrew Bartlett (This used to be commit 2a1015eb57da7b69caafd1221b871b6bff1af2fb)
This commit is contained in:
parent
cf86f85b08
commit
c2e997d6a7
@ -1012,6 +1012,7 @@ BOOL get_mydomname(fstring my_domname)
|
|||||||
{
|
{
|
||||||
pstring hostname;
|
pstring hostname;
|
||||||
char *p;
|
char *p;
|
||||||
|
struct hostent *hp;
|
||||||
|
|
||||||
*hostname = 0;
|
*hostname = 0;
|
||||||
/* get my host name */
|
/* get my host name */
|
||||||
@ -1023,17 +1024,31 @@ BOOL get_mydomname(fstring my_domname)
|
|||||||
/* Ensure null termination. */
|
/* Ensure null termination. */
|
||||||
hostname[sizeof(hostname)-1] = '\0';
|
hostname[sizeof(hostname)-1] = '\0';
|
||||||
|
|
||||||
|
|
||||||
p = strchr_m(hostname, '.');
|
p = strchr_m(hostname, '.');
|
||||||
|
|
||||||
if (!p)
|
if (p) {
|
||||||
|
p++;
|
||||||
|
|
||||||
|
if (my_domname)
|
||||||
|
fstrcpy(my_domname, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(hp = sys_gethostbyname(hostname))) {
|
||||||
return False;
|
return False;
|
||||||
|
}
|
||||||
p++;
|
|
||||||
|
|
||||||
if (my_domname)
|
p = strchr_m(hp->h_name, '.');
|
||||||
fstrcpy(my_domname, p);
|
|
||||||
|
|
||||||
return True;
|
if (p) {
|
||||||
|
p++;
|
||||||
|
|
||||||
|
if (my_domname)
|
||||||
|
fstrcpy(my_domname, p);
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -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;
|
char *forest_name = NULL;
|
||||||
DOM_SID *sid = NULL;
|
DOM_SID *sid = NULL;
|
||||||
GUID guid;
|
GUID guid;
|
||||||
|
fstring dnsdomname;
|
||||||
|
|
||||||
ZERO_STRUCT(guid);
|
ZERO_STRUCT(guid);
|
||||||
r_u->status = NT_STATUS_OK;
|
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:
|
case ROLE_DOMAIN_BDC:
|
||||||
nb_name = lp_workgroup();
|
nb_name = lp_workgroup();
|
||||||
/* ugly temp hack for these next two */
|
/* 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();
|
sid = get_global_sam_sid();
|
||||||
secrets_fetch_domain_guid(lp_workgroup(), &guid);
|
secrets_fetch_domain_guid(lp_workgroup(), &guid);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user