dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From 6e82ba82e4f2ce1440588437ca9e23a1b159df09 Mon Sep 17 00:00:00 2001
From: Samuel Cabrero <scabrero@suse.de>
Date: Fri, 19 Jul 2019 12:19:53 +0200
Subject: [PATCH 19/21] MONITOR: Propagate error when resolv.conf does not
 exists in polling mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Return ENOENT when resolv.conf is missing after falling back to polling
mode. This way missing_resolv_conf will schedule a timer to check again
after some seconds.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>

Reviewed-by: Sumit Bose <sbose@redhat.com>
(cherry picked from commit d20a7f9d5e56d1e9af273d97c7fd42fe8b2eda47)

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
---
 src/monitor/monitor.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 12250a15e..04e0017a2 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1908,18 +1908,14 @@ static errno_t monitor_config_file_fallback(TALLOC_CTX *parent_ctx,
     if (ret < 0) {
         err = errno;
         if (err == ENOENT) {
-             DEBUG(SSSDBG_MINOR_FAILURE,
-                   "file [%s] is missing. Will not update online status "
-                   "based on watching the file\n", file);
-             return EOK;
-
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  "file [%s] is missing. Will try again later.\n", file);
         } else {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "Could not stat file [%s]. Error [%d:%s]\n",
                   file, err, strerror(err));
-
-            return err;
         }
+        return err;
     }
 
     file_ctx->poll_check.parent_ctx = parent_ctx;
-- 
2.21.1