aboutsummaryrefslogtreecommitdiff
path: root/lib/krb5/test_acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/krb5/test_acl.c')
-rw-r--r--lib/krb5/test_acl.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/krb5/test_acl.c b/lib/krb5/test_acl.c
index e52f31a8b5a1..9e27c0408643 100644
--- a/lib/krb5/test_acl.c
+++ b/lib/krb5/test_acl.c
@@ -1,18 +1,18 @@
/*
- * Copyright (c) 2004 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
+ * Copyright (c) 2004 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
@@ -33,8 +33,6 @@
#include "krb5_locl.h"
#include <err.h>
-RCSID("$Id: test_acl.c 15036 2005-04-30 15:19:58Z lha $");
-
#define RETVAL(c, r, e, s) \
do { if (r != e) krb5_errx(c, 1, "%s", s); } while (0)
#define STRINGMATCH(c, s, _s1, _s2) \
@@ -72,6 +70,13 @@ test_match_string(krb5_context context)
RETVAL(context, ret, 0, "liternal fnmatch");
ret = krb5_acl_match_string(context, "foo/bar", "f", "foo/*");
RETVAL(context, ret, 0, "foo/*");
+ ret = krb5_acl_match_string(context, "foo/bar.example.org", "f",
+ "foo/*.example.org");
+ RETVAL(context, ret, 0, "foo/*.example.org");
+ ret = krb5_acl_match_string(context, "foo/bar.example.com", "f",
+ "foo/*.example.org");
+ RETVAL(context, ret, EACCES, "foo/*.example.com");
+
ret = krb5_acl_match_string(context, "foo/bar/baz", "f", "foo/*/baz");
RETVAL(context, ret, 0, "foo/*/baz");