Blame SOURCES/0054-sss_domain_info-add-not_found_counter.patch

7500e1
From 5d65411f1aa16af929ae2271ee4d3d9101728a67 Mon Sep 17 00:00:00 2001
7500e1
From: Sumit Bose <sbose@redhat.com>
7500e1
Date: Wed, 14 Apr 2021 17:22:06 +0200
7500e1
Subject: [PATCH 54/55] sss_domain_info: add not_found_counter
7500e1
MIME-Version: 1.0
7500e1
Content-Type: text/plain; charset=UTF-8
7500e1
Content-Transfer-Encoding: 8bit
7500e1
7500e1
This new counter should be used to track how often a domain could not be
7500e1
found while discovering the environment so that it can be deleted after
7500e1
a number of failed attempts.
7500e1
7500e1
Resolves: https://github.com/SSSD/sssd/issues/5528
7500e1
7500e1
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
7500e1
---
7500e1
 src/confdb/confdb.c       | 1 +
7500e1
 src/confdb/confdb.h       | 4 ++++
7500e1
 src/db/sysdb_subdomains.c | 2 ++
7500e1
 3 files changed, 7 insertions(+)
7500e1
7500e1
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
7500e1
index cca76159b..c554edda0 100644
7500e1
--- a/src/confdb/confdb.c
7500e1
+++ b/src/confdb/confdb.c
7500e1
@@ -1620,6 +1620,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
7500e1
     domain->view_name = NULL;
7500e1
 
7500e1
     domain->state = DOM_ACTIVE;
7500e1
+    domain->not_found_counter = 0;
7500e1
 
7500e1
     *_domain = domain;
7500e1
     ret = EOK;
7500e1
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
7500e1
index 81b68a0f1..c6c2514f8 100644
7500e1
--- a/src/confdb/confdb.h
7500e1
+++ b/src/confdb/confdb.h
7500e1
@@ -441,6 +441,10 @@ struct sss_domain_info {
7500e1
     char *gssapi_check_upn; /* true | false | NULL */
7500e1
     /* List of indicators associated with the specific PAM service */
7500e1
     char **gssapi_indicators_map;
7500e1
+
7500e1
+    /* Counts how often the domain was not found during a refresh of the
7500e1
+     * domain list */
7500e1
+    size_t not_found_counter;
7500e1
 };
7500e1
 
7500e1
 /**
7500e1
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
7500e1
index e2381c8af..348f242d0 100644
7500e1
--- a/src/db/sysdb_subdomains.c
7500e1
+++ b/src/db/sysdb_subdomains.c
7500e1
@@ -193,6 +193,8 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
7500e1
     dom->gssapi_services = parent->gssapi_services;
7500e1
     dom->gssapi_indicators_map = parent->gssapi_indicators_map;
7500e1
 
7500e1
+    dom->not_found_counter = 0;
7500e1
+
7500e1
     if (parent->sysdb == NULL) {
7500e1
         DEBUG(SSSDBG_OP_FAILURE, "Missing sysdb context in parent domain.\n");
7500e1
         goto fail;
7500e1
-- 
7500e1
2.26.3
7500e1