[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ossec-cvs] ossec-hids: dbd-config.c (HEAD) dbd-config.h (HEAD) [dcid]



Module name:	ossec-hids
Changes by:	dcid	07/08/22 21:01:44

Modified files:
	dbd-config.c dbd-config.h

Log message:
Description: More database fixes (better handling error conditions, etc)
Reviewed by: dcid
Bug:

Index: dbd-config.c
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/config/dbd-config.c,v
diff -u -r1.1 -r1.2
--- dbd-config.c	14 Aug 2007 20:03:17 -0000	1.1
+++ dbd-config.c	23 Aug 2007 00:01:43 -0000	1.2
@@ -72,6 +72,21 @@
         {
             if(strcmp(node[i]->content, "mysql") == 0)
             {
+                #ifndef UMYSQL
+                merror(DB_COMPILED, ARGV0, node[i]->content);
+                return(OS_INVALID);
+                #endif
+
+                db_config->db_type = MYSQLDB;
+            }
+            if(strcmp(node[i]->content, "postgresql") == 0)
+            {
+                #ifndef UPOSTGRES
+                merror(DB_COMPILED, ARGV0, node[i]->content);
+                return(OS_INVALID);
+                #endif
+
+                db_config->db_type = POSTGDB;
             }
             else
             {

Index: dbd-config.h
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/config/dbd-config.h,v
diff -u -r1.3 -r1.4
--- dbd-config.h	18 Aug 2007 03:38:34 -0000	1.3
+++ dbd-config.h	23 Aug 2007 00:01:43 -0000	1.4
@@ -18,6 +18,7 @@
 /* Database config structure */
 typedef struct _DBConfig
 {
+    unsigned int db_type;
     unsigned int alert_id;
     unsigned int server_id;
 
@@ -32,5 +33,8 @@
     char **includes;
 }DBConfig;
 
+
+#define MYSQLDB 0x002
+#define POSTGDB 0x004
 
 #endif


OSSEC home | Main Index | Thread Index


OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.