[icinga-checkins] icinga.org: icinga-core/r1.3: Revert "idoutils: fix ido2db needs to check for empty command arguments on Solaris ( Julian Wiesner) #1047"

git at icinga.org git at icinga.org
Thu Jan 20 14:03:48 CET 2011


Module: icinga-core
Branch: r1.3
Commit: 3290e93e632675d9b33dd45af4f7795eac5bdf8c
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=3290e93e632675d9b33dd45af4f7795eac5bdf8c

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Jan 19 09:09:21 2011 +0100

Revert "idoutils: fix ido2db needs to check for empty command arguments on Solaris (Julian Wiesner) #1047"

This reverts commit 22800c3079b3c548ed90bcf6bb683ff9c2d5da93.

Conflicts:

	Changelog

---

 Changelog                        |    1 -
 THANKS                           |    1 -
 module/idoutils/src/dbhandlers.c |   31 ++++++-------------------------
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/Changelog b/Changelog
index 6e944f7..669582c 100644
--- a/Changelog
+++ b/Changelog
@@ -75,7 +75,6 @@ FIXES
 * install: add hint to configure that libpq is not yet fully working #622
 
 * idoutils: fix unescape display name (Matthieu Kermagoret) #1027
-* idoutils: fix ido2db needs to check for empty command arguments on Solaris (Julian Wiesner) #1047
 * idoutils: fix solaris <= lacks asprintf (Julian Wiesner) #1048
 * idoutils: fix unfreed oci handles in prepared statements #1093
 * idoutils: increase debugoutput for conversion functions #1094
diff --git a/THANKS b/THANKS
index 1b8c200..ce95a0f 100644
--- a/THANKS
+++ b/THANKS
@@ -315,7 +315,6 @@ in various ways.  If we missed your name, let us know.
 * Peter Westlake
 * Todd Wheeler
 * Florian Weimer
-* Julian Wiesner
 * Tim Wilde
 * Chris Witterholt
 * Evan Winter
diff --git a/module/idoutils/src/dbhandlers.c b/module/idoutils/src/dbhandlers.c
index 92048f0..35608af 100644
--- a/module/idoutils/src/dbhandlers.c
+++ b/module/idoutils/src/dbhandlers.c
@@ -5302,19 +5302,13 @@ int ido2db_handle_hostdefinition(ido2db_idi *idi) {
 	cmdptr = strtok(idi->buffered_input[IDO_DATA_HOSTCHECKCOMMAND], "!");
 	argptr = strtok(NULL, "\x0");
 	result = ido2db_get_object_id_with_insert(idi, IDO2DB_OBJECTTYPE_COMMAND, cmdptr, NULL, &check_command_id);
-	if(argptr != NULL)
-		es[2] = ido2db_db_escape_string(idi, argptr);
-	else
-		es[2] = "\0";
+	es[2] = ido2db_db_escape_string(idi, argptr);
 
 	/* get the event handler command */
 	cmdptr = strtok(idi->buffered_input[IDO_DATA_HOSTEVENTHANDLER], "!");
 	argptr = strtok(NULL, "\x0");
 	result = ido2db_get_object_id_with_insert(idi, IDO2DB_OBJECTTYPE_COMMAND, cmdptr, NULL, &eventhandler_command_id);
-	if(argptr != NULL)
-		es[3] = ido2db_db_escape_string(idi, argptr);
-	else
-		es[3] = "\0";
+	es[3] = ido2db_db_escape_string(idi, argptr);
 
 	es[4] = ido2db_db_escape_string(idi, idi->buffered_input[IDO_DATA_NOTES]);
 	es[5] = ido2db_db_escape_string(idi, idi->buffered_input[IDO_DATA_NOTESURL]);
@@ -5846,10 +5840,7 @@ int ido2db_handle_servicedefinition(ido2db_idi *idi) {
 
 	result = ido2db_get_object_id_with_insert(idi, IDO2DB_OBJECTTYPE_COMMAND, cmdptr, NULL, &check_command_id);
 
-	if(argptr != NULL)
-		es[1] = ido2db_db_escape_string(idi, argptr);
-	else
-		es[1] = "\0";
+	es[1] = ido2db_db_escape_string(idi, argptr);
 
 	/* get the event handler command */
 	cmdptr = strtok(idi->buffered_input[IDO_DATA_SERVICEEVENTHANDLER], "!");
@@ -5857,11 +5848,7 @@ int ido2db_handle_servicedefinition(ido2db_idi *idi) {
 
 	result = ido2db_get_object_id_with_insert(idi, IDO2DB_OBJECTTYPE_COMMAND, cmdptr, NULL, &eventhandler_command_id);
 
-	if(argptr != NULL)
-		es[2] = ido2db_db_escape_string(idi, argptr);
-	else
-		es[2] = "\0";
-
+	es[2] = ido2db_db_escape_string(idi, argptr);
 	es[3] = ido2db_db_escape_string(idi, idi->buffered_input[IDO_DATA_NOTES]);
 	es[4] = ido2db_db_escape_string(idi, idi->buffered_input[IDO_DATA_NOTESURL]);
 	es[5] = ido2db_db_escape_string(idi, idi->buffered_input[IDO_DATA_ACTIONURL]);
@@ -7262,10 +7249,7 @@ int ido2db_handle_contactdefinition(ido2db_idi *idi) {
 		/* find the command */
 		result = ido2db_get_object_id_with_insert(idi, IDO2DB_OBJECTTYPE_COMMAND, cmdptr, NULL, &command_id);
 
-		if(argptr != NULL)
-			es[0] = ido2db_db_escape_string(idi, argptr);
-		else
-			es[0] = "\0";
+		es[0] = ido2db_db_escape_string(idi, argptr);
 
 		/* save entry to db */
 	        data[0] = (void *) &idi->dbinfo.instance_id;
@@ -7310,10 +7294,7 @@ int ido2db_handle_contactdefinition(ido2db_idi *idi) {
 		/* find the command */
 		result = ido2db_get_object_id_with_insert(idi, IDO2DB_OBJECTTYPE_COMMAND, cmdptr, NULL, &command_id);
 
-		if(argptr != NULL)
-			es[0] = ido2db_db_escape_string(idi, argptr);
-		else
-			es[0] = "\0";
+		es[0] = ido2db_db_escape_string(idi, argptr);
 
 		/* save entry to db */
 





More information about the icinga-checkins mailing list