summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-30 11:21:42 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-30 11:21:42 +0000
commit2b975fda870e33dc7fd28510fb0ea670e6c92ed6 (patch)
treed61328dafebdd1cc9f88cf20d5c7bbf3fd5154b9
parentedb9158f09d488d9f98dffe477808dd3909b693a (diff)
downloadsamba-2b975fda870e33dc7fd28510fb0ea670e6c92ed6.tar.gz
samba-2b975fda870e33dc7fd28510fb0ea670e6c92ed6.tar.bz2
samba-2b975fda870e33dc7fd28510fb0ea670e6c92ed6.zip
- if we are in ADS mode then avoid an expensive netbios lookup to find
the servers netbios name when we don't need it. This also fixes ADS mode when the DC has netbios disabled. - if the password server is specified as an IP then actually use that IP, don't do a lookup for the servers name :) (This used to be commit 72042e94ef0f6841afcfa48eafb9809545860725)
-rw-r--r--source3/auth/auth_domain.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c
index 0f084dc1de..9134a3fc63 100644
--- a/source3/auth/auth_domain.c
+++ b/source3/auth/auth_domain.c
@@ -60,22 +60,31 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
return NT_STATUS_NO_LOGON_SERVERS;
}
- if (!name_status_find("*", 0x20, 0x20, to_ip, remote_machine)) {
+ if (lp_security() == SEC_ADS) {
+ /* if in ADS mode then we know that port 445
+ will work and *SMBSERVER will be recognised
+ anyway. This avoids an expensive netbios
+ lookup. */
+ fstrcpy(remote_machine, "*SMBSERVER");
+ } else if (!name_status_find("*", 0x20, 0x20, to_ip, remote_machine)) {
DEBUG(0, ("connect_to_domain_password_server: Can't "
"resolve name for IP %s\n", server));
return NT_STATUS_NO_LOGON_SERVERS;
}
+
+ /* we know the IP - smb.conf specified it! */
+ dest_ip = to_ip;
} else {
fstrcpy(remote_machine, server);
+ strupper(remote_machine);
+ if (!resolve_name(remote_machine, &dest_ip, 0x20)) {
+ DEBUG(1,("connect_to_domain_password_server: Can't resolve address for %s\n",
+ remote_machine));
+ return NT_STATUS_NO_LOGON_SERVERS;
+ }
}
standard_sub_basic(current_user_info.smb_name, remote_machine, sizeof(remote_machine));
- strupper(remote_machine);
-
- if(!resolve_name( remote_machine, &dest_ip, 0x20)) {
- DEBUG(1,("connect_to_domain_password_server: Can't resolve address for %s\n", remote_machine));
- return NT_STATUS_NO_LOGON_SERVERS;
- }
if (ismyip(dest_ip)) {
DEBUG(1,("connect_to_domain_password_server: Password server loop - not using password server %s\n",