don't define a default database URI
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 17 May 2013 20:32:04 +0000 (22:32 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 21 Jun 2013 21:25:22 +0000 (23:25 +0200)
src/libimcv/imcv.c
src/libimcv/imv/imv_database.c
src/libimcv/imv/imv_policy_manager.c

index cb0222e..de85901 100644 (file)
@@ -23,7 +23,6 @@
 #include <syslog.h>
 
 #define IMCV_DEBUG_LEVEL                       1
-#define IMCV_DEFAULT_DATABASE_URI      "sqlite:///etc/pts/config.db"
 #define IMCV_DEFAULT_POLICY_SCRIPT     "ipsec _imv_policy"
 
 
@@ -150,7 +149,7 @@ bool libimcv_init(bool is_imv)
                if (is_imv)
                {
                        uri = lib->settings->get_str(lib->settings,
-                                               "libimcv.database", IMCV_DEFAULT_DATABASE_URI);
+                                               "libimcv.database", NULL);
                        script = lib->settings->get_str(lib->settings,
                                                "libimcv.policy_script", IMCV_DEFAULT_POLICY_SCRIPT);
                        if (uri)
index 4c35d75..2703ae2 100644 (file)
@@ -303,7 +303,7 @@ METHOD(imv_database_t, get_database, database_t*,
 METHOD(imv_database_t, destroy, void,
        private_imv_database_t *this)
 {
-       this->db->destroy(this->db);
+       DESTROY_IF(this->db);
        this->sessions->destroy_offset(this->sessions,
                                                        offsetof(imv_session_t, destroy));
        this->mutex->destroy(this->mutex);
index 128c7a2..7819a10 100644 (file)
@@ -142,9 +142,8 @@ int main(int argc, char *argv[])
        }
        session_id = atoi(tnc_session_id);
        
-       /* attach database */
-       uri = lib->settings->get_str(lib->settings, "imv_policy_manager.database",
-                                                                                               "sqlite:///etc/pts/config.db");
+       /* attach IMV database */
+       uri = lib->settings->get_str(lib->settings, "libimcv.database", NULL);
        db = lib->db->create(lib->db, uri);
        if (!db)
        {