[icinga-checkins] icinga.org: icinga-core/mfriedrich/ido: classic ui: fix logic on " standalone_installation" setting (if set, ignore icinga.cfg but use cgi.cfg )

git at icinga.org git at icinga.org
Sat Apr 13 15:57:18 CEST 2013


Module: icinga-core
Branch: mfriedrich/ido
Commit: 530bca9d90fa85612c381628adfcd7af214ec9bd
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=530bca9d90fa85612c381628adfcd7af214ec9bd

Author: Michael Friedrich <Michael.Friedrich at netways.de>
Date:   Sat Apr 13 15:13:12 2013 +0200

classic ui: fix logic on "standalone_installation" setting (if set, ignore icinga.cfg but use cgi.cfg)

refs #3869

---

 cgi/cgiutils.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/cgi/cgiutils.c b/cgi/cgiutils.c
index 5e46d4a..dbc8c83 100644
--- a/cgi/cgiutils.c
+++ b/cgi/cgiutils.c
@@ -756,19 +756,30 @@ int read_cgi_config_file(char *filename) {
 
 	if (!strcmp(main_config_file, "")) {
 
-		//	If standalone_installation is switched on, we assume that
-		//	all vars are defined in cgi.cfg
 		if (standalone_installation == TRUE) {
+			/*
+			 * if standalone_installation is switched on, we assume that
+			 * all vars are defined in cgi.cfg
+			 */
 			strncpy(main_config_file, filename, sizeof(main_config_file));
 			main_config_file[sizeof(main_config_file) - 1] = '\x0';
 
-		//	If not, we assume default location for main_config_file
+			/*
+			 * If not, we assume default location for main_config_file
+			 */
 		} else {
 			strncpy(main_config_file, DEFAULT_CONFIG_FILE, sizeof(main_config_file));
 			main_config_file[sizeof(main_config_file) - 1] = '\x0';
 		}
 	}
 
+	/* if we are standalone install, we force to use cgi.cfg instead of icinga.cfg! */
+	if (standalone_installation == TRUE) {
+		strncpy(main_config_file, filename, sizeof(main_config_file));
+		main_config_file[sizeof(main_config_file) - 1] = '\x0';
+	}
+
+
 	return OK;
 }
 





More information about the icinga-checkins mailing list