]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
refuse to start with relative paths + RunAsDaemon
authorRoger Dingledine <arma@torproject.org>
Sun, 4 Nov 2018 12:30:46 +0000 (07:30 -0500)
committerAlexander Færøy <ahf@torproject.org>
Tue, 6 Nov 2018 14:50:56 +0000 (15:50 +0100)
Resume refusing to start with relative file paths and RunAsDaemon
set (regression from the fix for bug 22731).

Fixes bug 28298; bugfix on 0.3.3.1-alpha.

changes/bug28298 [new file with mode: 0644]
src/or/config.c

diff --git a/changes/bug28298 b/changes/bug28298
new file mode 100644 (file)
index 0000000..8db340f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (configuration):
+    - Resume refusing to start with relative file paths and RunAsDaemon
+      set (regression from the fix for bug 22731). Fixes bug 28298;
+      bugfix on 0.3.3.1-alpha.
index 58080c65e313c4bc0cceb7fd8c9fb0e11f74a981..783412acc4c0b3c01fcfede42fcd4f271497f07c 100644 (file)
@@ -3307,12 +3307,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
    * Always use the value of UseEntryGuards, not UseEntryGuards_option. */
   options->UseEntryGuards = options->UseEntryGuards_option;
 
-  if (warn_about_relative_paths(options) && options->RunAsDaemon) {
-    REJECT("You have specified at least one relative path (see above) "
-           "with the RunAsDaemon option. RunAsDaemon is not compatible "
-           "with relative paths.");
-  }
-
   if (server_mode(options) &&
       (!strcmpstart(uname, "Windows 95") ||
        !strcmpstart(uname, "Windows 98") ||
@@ -3329,6 +3323,14 @@ options_validate(or_options_t *old_options, or_options_t *options,
   if (validate_data_directories(options)<0)
     REJECT("Invalid DataDirectory");
 
+  /* need to check for relative paths after we populate
+   * options->DataDirectory (just above). */
+  if (warn_about_relative_paths(options) && options->RunAsDaemon) {
+    REJECT("You have specified at least one relative path (see above) "
+           "with the RunAsDaemon option. RunAsDaemon is not compatible "
+           "with relative paths.");
+  }
+
   if (options->Nickname == NULL) {
     if (server_mode(options)) {
       options->Nickname = tor_strdup(UNNAMED_ROUTER_NICKNAME);