]> source.dussan.org Git - rspamd.git/commitdiff
Add guard for fuzzy storage.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Aug 2015 14:39:13 +0000 (15:39 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Aug 2015 14:39:13 +0000 (15:39 +0100)
src/fuzzy_storage.c
src/libserver/fuzzy_backend.c

index 96785fd754deff2232d6656ab73cf8820f7f5abb..c0ead682880f2ce3b62f01b6d40ca45bd9588362 100644 (file)
@@ -346,7 +346,7 @@ start_fuzzy (struct rspamd_worker *worker)
        if ((ctx->backend = rspamd_fuzzy_backend_open (ctx->hashfile, &err)) == NULL) {
                msg_err ("cannot open backend: %e", err);
                g_error_free (err);
-               exit (EXIT_FAILURE);
+               exit (EXIT_SUCCESS);
        }
 
        server_stat->fuzzy_hashes = rspamd_fuzzy_backend_count (ctx->backend);
index a5bf28c7ca19387b384801d323ee7bc233f24b1c..aebd9fd4884599c32e026a1ed6861443b925cfe0 100644 (file)
@@ -391,6 +391,11 @@ rspamd_fuzzy_backend_open (const gchar *path, GError **err)
                        fallback_journal[] = "PRAGMA journal_mode=\"off\";";
        int rc;
 
+       if (path == NULL) {
+               g_set_error (err, rspamd_fuzzy_backend_quark (),
+                               ENOENT, "Path has not been specified");
+               return NULL;
+       }
        /* First of all we check path for existence */
        dir = g_path_get_dirname (path);
        if (dir == NULL) {