summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2013-10-27 15:34:40 -0400
committerGravatar Karl Ramm <kcr@1ts.org>2013-10-27 15:34:40 -0400
commit3c69550a493e472f994623fe0808fc2103c79a80 (patch)
tree795b73eea3cd84e0bce9d05ac6bca0945f92aa4a
parentc5ff590650307a4259da459e78b34aa1eb72dd7c (diff)
test wildcards in the acl
-rw-r--r--server/test_server.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/test_server.c b/server/test_server.c
index 6438af2..4c5770d 100644
--- a/server/test_server.c
+++ b/server/test_server.c
@@ -318,6 +318,29 @@ test_acl_files(){
TEST(acl_check(filename, "bar@TIM.EDU", &who_zero) == 1);
TEST(acl_check(filename, "bar@TIM.EDU", &who_localhost) == 0);
+ lseek(fd, 0, SEEK_SET);
+ ftruncate(fd, 0);
+ write(fd, "*/root@TIM.EDU\n", 15);
+ acl_cache_reset();
+ PP("acl */root@TIM.EDU");
+ TEST(acl_check(filename, NULL, NULL) == 0);
+ TEST(acl_check(filename, "foo", NULL) == 0);
+ TEST(acl_check(filename, "bar", NULL) == 0);
+ TEST(acl_check(filename, "bar@TIM.EDU", NULL) == 0);
+ TEST(acl_check(filename, "bar@TIM.EDU", NULL) == 0);
+ TEST(acl_check(filename, "foo/root@TIM.EDU", NULL) == 1);
+ TEST(acl_check(filename, "bar/root@TIM.EDU", NULL) == 1);
+
+ lseek(fd, 0, SEEK_SET);
+ ftruncate(fd, 0);
+ write(fd, "foo/*@TIM.EDU\n", 14);
+ acl_cache_reset();
+ PP("acl foo/*@TIM.EDU");
+ TEST(acl_check(filename, "foo@TIM.EDU", NULL) == 0);
+ TEST(acl_check(filename, "bar@TIM.EDU", NULL) == 0);
+ TEST(acl_check(filename, "foo/root@TIM.EDU", NULL) == 1);
+ TEST(acl_check(filename, "bar/root@TIM.EDU", NULL) == 0);
+
PP("check vs. nonexistent acl");
TEST(acl_check("/nonexistent", "foo", NULL) == 0);
unlink(filename);