瀏覽代碼

Warn for bad combination of cookie options

Setting CookieAuthFileGroupReadable but without setting CookieAuthFile makes
no sense, because unix directory permissions for the data directory prevent
the group from accessing the file anyways.
Sebastian Hahn 15 年之前
父節點
當前提交
219f7415d1
共有 2 個文件被更改,包括 11 次插入0 次删除
  1. 4 0
      changes/bug1843
  2. 7 0
      src/or/config.c

+ 4 - 0
changes/bug1843

@@ -0,0 +1,4 @@
+  o Minor features:
+    - Warn when CookieAuthFileGroupReadable is set but CookieAuthFile is
+      not. This would lead to a cookie that is still not group readable.
+      Closes bug 1843. Suggested by katmagic.

+ 7 - 0
src/or/config.c

@@ -3501,6 +3501,13 @@ options_validate(or_options_t *old_options, or_options_t *options,
              "upgrade your Tor controller as soon as possible.");
   }
 
+  if (options->CookieAuthFileGroupReadable && !options->CookieAuthFile) {
+    log_warn(LD_CONFIG, "You set the CookieAuthFileGroupReadable but did "
+             "not configure a the path for the cookie file via "
+             "CookieAuthFile. This means your cookie will not be group "
+             "readable.");
+  }
+
   if (options->UseEntryGuards && ! options->NumEntryGuards)
     REJECT("Cannot enable UseEntryGuards with NumEntryGuards set to 0");