summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-05-04 13:10:01 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-07-15 17:32:26 +0200
commitfa7921c8259539b750f7e9e7bcd82aa72020826a (patch)
tree55cf44446be55c29376611539772b446eeefaaf2 /src/tests
parentfd04b25eaa5cd105da4122854d8bc1e702760e60 (diff)
downloadsssd-fa7921c8259539b750f7e9e7bcd82aa72020826a.tar.gz
sssd-fa7921c8259539b750f7e9e7bcd82aa72020826a.tar.xz
sssd-fa7921c8259539b750f7e9e7bcd82aa72020826a.zip
UTIL: Add sss_filter_sanitize_ex
Related: https://fedorahosted.org/sssd/ticket/2553 In order to support wildcard request, we need to introduce an optionally relaxed version of sss_filter_sanitize that allows to select which characters are exempt from sanitizing. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/util-tests.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tests/util-tests.c b/src/tests/util-tests.c
index 3d42f0193..bfdf07802 100644
--- a/src/tests/util-tests.c
+++ b/src/tests/util-tests.c
@@ -406,6 +406,15 @@ START_TEST(test_sss_filter_sanitize)
"Expected [%s], got [%s]",
has_all_expected, sanitized);
+ /* Input is reused from previous test - "\\(user)*name" */
+ const char has_all_allow_asterisk_expected[] = "\\5c\\28user\\29*name";
+ ret = sss_filter_sanitize_ex(test_ctx, has_all, &sanitized, "*");
+ fail_unless(ret == EOK, "has_all error [%d][%s]",
+ ret, strerror(ret));
+ fail_unless(strcmp(has_all_allow_asterisk_expected, sanitized)==0,
+ "Expected [%s], got [%s]",
+ has_all_expected, sanitized);
+
talloc_free(test_ctx);
}
END_TEST