[icinga-checkins] icinga.org: icinga-core/master: Fix idomod segfault while try to use SSL on unix socket

git at icinga.org git at icinga.org
Tue Oct 20 23:06:10 CEST 2009


Module: icinga-core
Branch: master
Commit: b300d6c7534a2c842899387e860d880e085b155b
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=b300d6c7534a2c842899387e860d880e085b155b

Author: Hendrik Baecker <andurin at process-zero.de>
Date:   Tue Oct 20 23:06:04 2009 +0200

Fix idomod segfault while try to use SSL on unix socket

closes #153

---

 Changelog                    |    1 +
 module/idoutils/src/ido2db.c |    5 +++++
 module/idoutils/src/idomod.c |    5 +++++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/Changelog b/Changelog
index 5d8645a..fa915f4 100644
--- a/Changelog
+++ b/Changelog
@@ -33,6 +33,7 @@ Icinga 0.8.x Change Log
 * idoutils: workaround to handle more than 4k Data which may exceed service outputs incl. long perf_data
 * core init: delete 'su' usage since all previously su touched files were created by the icinga user
 * idoutils: fix unescape bug during tabstops
+* idoutils: fix idomod/icinga segfault while try to use ssl on unix sockets
 
 0.8.4 - 09/15/2009
 * idoutils: fix failure_prediction_options in tables hosts, services for postgres
diff --git a/module/idoutils/src/ido2db.c b/module/idoutils/src/ido2db.c
index ec25342..c6011fd 100644
--- a/module/idoutils/src/ido2db.c
+++ b/module/idoutils/src/ido2db.c
@@ -136,6 +136,11 @@ int main(int argc, char **argv){
 		exit(1);
         }
 
+	if (ndo2db_socket_type==NDO_SINK_UNIXSOCKET && use_ssl == NDO_TRUE){
+		printf("SSL is not allowed on socket_type=unix\n");
+		exit(1);
+	}
+
 #ifdef HAVE_SSL
 	        /* initialize SSL */
 	        if(use_ssl==NDO_TRUE){
diff --git a/module/idoutils/src/idomod.c b/module/idoutils/src/idomod.c
index 1d698e8..21a6bfd 100644
--- a/module/idoutils/src/idomod.c
+++ b/module/idoutils/src/idomod.c
@@ -114,6 +114,11 @@ int nebmodule_init(int flags, char *args, void *handle){
 		return -1;
 		}
 
+	if(ndomod_sink_type==NDO_SINK_UNIXSOCKET && use_ssl == NDO_TRUE){
+		ndomod_write_to_logs("idomod: use_ssl=1 while using socket_type=unix is not allowed. Aborting...",NSLOG_INFO_MESSAGE);
+		return -1;
+		}
+
 	/* do some initialization stuff... */
 	if(ndomod_init()==NDO_ERROR){
 		ndomod_write_to_logs("idomod: An error occurred while attempting to initialize.",NSLOG_INFO_MESSAGE);





More information about the icinga-checkins mailing list