Hi Andreas,
- Log -----------------------------------------------------------------
commit b2866ad88163ca1dd25a4d54c64f8d98dfa3a4ba
Author: Andreas Schneider <[email protected]>
Date: Mon Jan 12 17:03:35 2026 +0100
s3:libsmb: Rework check_negative_conn_cache()
The name and results are confusing. Rename the function and use a bool that it
is easier to understand.
Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
Autobuild-User(master): Andreas Schneider <[email protected]>
Autobuild-Date(master): Tue Jan 13 17:00:06 UTC 2026 on atb-devel-224
-----------------------------------------------------------------------
Summary of changes:
source3/include/proto.h | 2 +-
source3/libads/kerberos.c | 4 ++--
source3/libads/ldap.c | 16 ++++++++++------
source3/libsmb/conncache.c | 36 ++++++++++++++++++++++++++----------
source3/libsmb/namequery.c | 24 ++++++++++++++++--------
source3/libsmb/namequery_dc.c | 5 +++--
source3/winbindd/winbindd_cm.c | 15 +++++++++------
7 files changed, 67 insertions(+), 35 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 854945e8db7..8847c3f4617 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -576,7 +576,7 @@ unsigned wins_srv_count_tag(const char *tag);
/* The following definitions come from libsmb/conncache.c */
-NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
+bool has_negative_conn_cache_entry( const char *domain, const char *server);
void add_failed_connection_entry(const char *domain, const char *server,
NTSTATUS result) ;
void flush_negative_conn_cache_for_domain(const char *domain);
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 5593364c397..ed8d52f7866 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -1259,10 +1259,10 @@ static char *get_kdc_ip_string(char *mem_ctx,
cldap_reply = &responses[i]->data.nt5_ex;
if (cldap_reply->pdc_dns_name != NULL) {
- status = check_negative_conn_cache(
+ bool has_entry = has_negative_conn_cache_entry(
realm,
cldap_reply->pdc_dns_name);
- if (!NT_STATUS_IS_OK(status)) {
+ if (has_entry) {
/* propagate blacklisting from name to ip */
add_failed_connection_entry(realm, addr,
status);
continue;
This looks strange, what is 'status' at this point?
It used to be the status stored in the name based record.
I'm wondering about the motivation about this patch,
my first reaction was: this is not simpler now.
metze