From 78544acf99a0921b2f71fe7ad525a001330ee95c Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 9 Oct 2024 20:01:32 +0200 Subject: [PATCH] CONFDB: don't hard fail in add_implicit_services() if no explicitly configured domains found. There are might be 'enable_files_domain = true' or app domains that are expanded later. --- src/confdb/confdb.c | 3 ++- src/monitor/monitor.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c index a9b07436ae7..7515da45d05 100644 --- a/src/confdb/confdb.c +++ b/src/confdb/confdb.c @@ -662,7 +662,8 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx ret = confdb_get_enabled_domain_list(cdb, tmp_ctx, &domain_names); if (ret == ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, "No domains configured!\n"); + /* confdb_expand_app_domains() wasn't called yet, so this might be ok */ + ret = EOK; goto done; } else if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, "Error retrieving domains list [%d]: %s\n", diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index a454ca9a46a..0d2eb687020 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2056,7 +2056,11 @@ int main(int argc, const char *argv[]) } monitor->cdb = main_ctx->confdb_ctx; - get_monitor_config(monitor); + ret = get_monitor_config(monitor); + if (ret = EOK) { + ret = 1; + goto out; + } monitor->is_daemon = !opt_interactive; monitor->parent_pid = main_ctx->parent_pid; monitor->ev = main_ctx->event_ctx;