summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-11-29 05:50:32 +0000
committerTim Potter <tpot@samba.org>2001-11-29 05:50:32 +0000
commitff27a326f17223cba12b7e0b41ec84aad8238385 (patch)
treed1374839939104a08f1f309cab2004e223b9656c /source3/libsmb
parent5bfc7214afb23984acc7aba9fd7a57eec7c18d6d (diff)
downloadsamba-ff27a326f17223cba12b7e0b41ec84aad8238385.tar.gz
samba-ff27a326f17223cba12b7e0b41ec84aad8238385.tar.bz2
samba-ff27a326f17223cba12b7e0b41ec84aad8238385.zip
I think the lookup_pdc_name() should be called lookup_dc_name() and the
name_status_find() call here should look up a #1c name instead of #1d. This fixes some bugs currently with BDC authentication in winbindd and in smbd as you can't query the #1d name with the ip address of a BDC. Who is Uncle Tom Cobbley anyway? (This used to be commit 4215048f7b20a8f9e5877bdbb2f54841b2f7fa64)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/namequery.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index a181e3183f..8d00c50914 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -927,7 +927,7 @@ BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
if (strcmp(dest_host,"*") == 0) {
extern pstring global_myname;
ret = resolve_name(lp_workgroup(), ip, 0x1B);
- lookup_pdc_name(global_myname, lp_workgroup(), ip, dest_host);
+ lookup_dc_name(global_myname, lp_workgroup(), ip, dest_host);
} else {
ret = resolve_name(dest_host, ip, 0x20);
}
@@ -966,31 +966,32 @@ BOOL find_master_ip(char *group, struct in_addr *master_ip)
}
/********************************************************
- Lookup a PDC name given a Domain name and IP address.
+ Lookup a DC name given a Domain name and IP address.
*********************************************************/
-BOOL lookup_pdc_name(const char *srcname, const char *domain, struct in_addr *pdc_ip, char *ret_name)
+BOOL lookup_dc_name(const char *srcname, const char *domain,
+ struct in_addr *dc_ip, char *ret_name)
{
#if !defined(I_HATE_WINDOWS_REPLY_CODE)
+
+ fstring dc_name;
+ BOOL ret;
+
+ /*
+ * Due to the fact win WinNT *sucks* we must do a node status
+ * query here... JRA.
+ */
+
+ *dc_name = '\0';
+
+ ret = name_status_find(domain, 0x1c, 0x20, *dc_ip, dc_name);
- fstring pdc_name;
- BOOL ret;
-
- /*
- * Due to the fact win WinNT *sucks* we must do a node status
- * query here... JRA.
- */
-
- *pdc_name = '\0';
-
- ret = name_status_find(domain, 0x1b, 0x20,*pdc_ip,pdc_name);
-
- if(ret && *pdc_name) {
- fstrcpy(ret_name, pdc_name);
- return True;
- }
-
- return False;
+ if(ret && *dc_name) {
+ fstrcpy(ret_name, dc_name);
+ return True;
+ }
+
+ return False;
#else /* defined(I_HATE_WINDOWS_REPLY_CODE) */