[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: idoutils: minor fix for checking dbversion string before comparing it #1368

git at icinga.org git at icinga.org
Wed Apr 27 23:04:42 CEST 2011


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Apr 27 23:03:02 2011 +0200

idoutils: minor fix for checking dbversion string before comparing it #1368

refs #1368

---

 module/idoutils/src/db.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/module/idoutils/src/db.c b/module/idoutils/src/db.c
index 7bf294c..1a72332 100644
--- a/module/idoutils/src/db.c
+++ b/module/idoutils/src/db.c
@@ -1311,6 +1311,10 @@ int ido2db_db_version_check(ido2db_idi *idi) {
 	free(name);
 
 	/* check dbversion against program version */
+	if(idi->dbinfo.dbversion==NULL){
+		syslog(LOG_ERR, "Error: DB Version cannot be retrieved. Please check the upgrade docs and verify the db schema!");
+		return IDO_ERROR;
+	}
 	if(strcmp(idi->dbinfo.dbversion, IDO2DB_VERSION)!=0){
 		syslog(LOG_ERR, "Error: DB Version %s does not match program version %s. Please check the upgrade docs!", idi->dbinfo.dbversion, IDO2DB_VERSION);
 		return IDO_ERROR;





More information about the icinga-checkins mailing list