summaryrefslogtreecommitdiff
path: root/src/test/test_checkdir.c
diff options
context:
space:
mode:
authormeejah <meejah@meejah.ca>2014-10-15 02:17:54 -0600
committermeejah <meejah@meejah.ca>2014-10-21 00:14:57 -0600
commit3d0d49be230a8720ebdadf668b993f8ba2c5b2ca (patch)
treefd992eeaa04520c162972911c211c421afd5eaff /src/test/test_checkdir.c
parentb59fd2efb61e0b6def3fdbf4b8e359acc852776c (diff)
downloadtor-3d0d49be230a8720ebdadf668b993f8ba2c5b2ca.tar.gz
tor-3d0d49be230a8720ebdadf668b993f8ba2c5b2ca.zip
Additional test for error-case
This error-case was already fixed by previous changes, this is to cover it in case there's a regression.
Diffstat (limited to 'src/test/test_checkdir.c')
-rw-r--r--src/test/test_checkdir.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_checkdir.c b/src/test/test_checkdir.c
index 1580e6271d..7bf735e061 100644
--- a/src/test/test_checkdir.c
+++ b/src/test/test_checkdir.c
@@ -43,6 +43,14 @@ test_checkdir_perms(void *testdata)
tt_int_op(0, ==, (st.st_mode & unix_verify_optsmask));
tor_free(testdir);
+ /* test: should get an error on existing dir with
+ wrong perms */
+ testdir = get_datadir_fname("checkdir_new_groupok_err");
+ tt_int_op(0, ==, mkdir(testdir, 027));
+ cpd_chkopts = CPD_CHECK_MODE_ONLY|CPD_CREATE|CPD_GROUP_OK;
+ tt_int_op(-1, ==, check_private_dir(testdir, cpd_chkopts, NULL));
+ tor_free(testdir);
+
/* test: create new dir, CPD_GROUP_READ option set. */
testdir = get_datadir_fname("checkdir_new_groupread");
cpd_chkopts = CPD_CREATE|CPD_GROUP_READ;