]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
list-keywords: fix when not using default install
authorEric Leblond <eric@regit.org>
Fri, 2 Nov 2012 15:21:36 +0000 (16:21 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 19 Nov 2012 15:36:38 +0000 (16:36 +0100)
As we don't parse the YAML file when listing of keywords is asked,
suricata make a test on existence of the build-default directory.
So with a non standard (working) install (even a single configure
without option lead to a failure), the keyword listing fails
because the default logging directory does not exist.

src/suricata.c

index 3e714a42ddbdc7c29c82f02cbd05b2ce864100c4..25c36b8befcd6b7f46e43df5ebb8b48a30808b5f 100644 (file)
@@ -1315,15 +1315,18 @@ int main(int argc, char **argv)
         log_dir = DEFAULT_LOG_DIR;
 #endif /* OS_WIN32 */
     }
+
+    if (!list_keywords && !list_app_layer_protocols) {
 #ifdef OS_WIN32
-    if (_stat(log_dir, &buf) != 0) {
+        if (_stat(log_dir, &buf) != 0) {
 #else
-    if (stat(log_dir, &buf) != 0) {
+        if (stat(log_dir, &buf) != 0) {
 #endif /* OS_WIN32 */
-        SCLogError(SC_ERR_LOGDIR_CONFIG, "The logging directory \"%s\" "
-                    "supplied by %s (default-log-dir) doesn't exist. "
-                    "Shutting down the engine", log_dir, conf_filename);
-        exit(EXIT_FAILURE);
+            SCLogError(SC_ERR_LOGDIR_CONFIG, "The logging directory \"%s\" "
+                        "supplied by %s (default-log-dir) doesn't exist. "
+                        "Shutting down the engine", log_dir, conf_filename);
+            exit(EXIT_FAILURE);
+        }
     }
 
     /* Pull the max pending packets from the config, if not found fall