diff options
author | Stefan Metzmacher <metze@samba.org> | 2015-06-27 09:31:21 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2015-07-02 14:41:31 +0200 |
commit | f87e70a93028cb64ed4793cb1db6b978fa917697 (patch) | |
tree | 3166cb6b6af0cee1a0ff574537690549bbdd1575 /source3/libads | |
parent | ddc4c6767a98bb087bb435ed3a4591e75637b1e8 (diff) | |
download | samba-f87e70a93028cb64ed4793cb1db6b978fa917697.tar.gz |
s3:libads: improve debug levels/messages in ads_find_dc()
We should not flood the logs (and syslog) with fallback warnings.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jul 2 14:41:31 CEST 2015 on sn-devel-104
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/ldap.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 5c53c6326e0..87631641ff1 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -467,7 +467,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) } if (!*c_realm && !*c_domain) { - DEBUG(1, ("ads_find_dc: no realm or workgroup! Don't know " + DEBUG(0, ("ads_find_dc: no realm or workgroup! Don't know " "what to do\n")); return NT_STATUS_INVALID_PARAMETER; /* rather need MISSING_PARAMETER ... */ } @@ -515,10 +515,10 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) * - Guenther */ if (sitename) { - DEBUG(1, ("ads_find_dc: failed to find a valid DC on " - "our site (%s), " - "trying to find another DC\n", - sitename)); + DEBUG(3, ("ads_find_dc: failed to find a valid DC on " + "our site (%s), Trying to find another DC " + "for realm '%s' (domain '%s')\n", + sitename, c_realm, c_domain)); namecache_delete(c_realm, 0x1C); status = resolve_and_ping_dns(ads, NULL, c_realm); @@ -536,14 +536,20 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) or if configuration specifically requests it */ if (*c_domain) { if (*c_realm) { - DEBUG(1, ("ads_find_dc: falling back to netbios " - "name resolution for domain %s\n", - c_domain)); + DEBUG(3, ("ads_find_dc: falling back to netbios " + "name resolution for domain '%s' (realm '%s')\n", + c_domain, c_realm)); } status = resolve_and_ping_netbios(ads, c_domain, c_realm); + if (NT_STATUS_IS_OK(status)) { + return status; + } } + DEBUG(1, ("ads_find_dc: " + "name resolution for realm '%s' (domain '%s') failed: %s\n", + c_realm, c_domain, nt_errstr(status))); return status; } |