]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix the checkdir/perms test when umask==077
authorNick Mathewson <nickm@torproject.org>
Thu, 15 Jan 2015 15:24:27 +0000 (10:24 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 15 Jan 2015 15:24:27 +0000 (10:24 -0500)
Fixes 14215; bugfix on 0.2.6.2-alpha.  Reported by "cypherpunks".

changes/bug14215 [new file with mode: 0644]
src/test/test_checkdir.c

diff --git a/changes/bug14215 b/changes/bug14215
new file mode 100644 (file)
index 0000000..70bcdaa
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (tests):
+    - Make the checkdir/perms test complete successfully even if the
+      global umask is not 022. Fixes bug 14215; bugfix on 0.2.6.2-alpha.
+
+
index 882e3b3a6164ac19005b8f1e73914818b260def0..ae859449cbf700a53ffe14a8ada42374c5f567e2 100644 (file)
@@ -11,6 +11,7 @@
 #ifdef _WIN32
 #define mkdir(a,b) mkdir(a)
 #define tt_int_op_nowin(a,op,b) do { (void)(a); (void)(b); } while (0)
+#define umask(mask) ((void)0)
 #else
 #define tt_int_op_nowin(a,op,b) tt_int_op((a),op,(b))
 #endif
@@ -28,6 +29,8 @@ test_checkdir_perms(void *testdata)
   cpd_check_t  unix_verify_optsmask;
   struct stat st;
 
+  umask(022);
+
   /* setup data directory before tests. */
   tor_free(options->DataDirectory);
   options->DataDirectory = tor_strdup(get_fname(subdir));
@@ -134,7 +137,7 @@ test_checkdir_perms(void *testdata)
   { #name, test_checkdir_##name, (flags), NULL, NULL }
 
 struct testcase_t checkdir_tests[] = {
-  CHECKDIR(perms, 0),
+  CHECKDIR(perms, TT_FORK),
   END_OF_TESTCASES
 };