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

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