match_pattern
if (addr != NULL && match_pattern(addr, cp) == 1)
if (match_pattern(type, sc->timeouts[i].type_pattern))
ret = match_pattern(lhost, allowed_open->listen_host);
if (match_pattern(name, options.send_env[j])) {
if (match_pattern(groups_byname[i], groups[j]))
if (match_pattern(string, sub)) {
return match_pattern(user, pattern);
if ((ret = match_pattern(user, pat)) == 1)
int match_pattern(const char *, const char *);
if (match_pattern(name, options.send_env[i]))
if (match_pattern(host, arg)) {
if (!match_pattern(options->send_env[i], arg + 1)) {
actual = match_pattern(input, pattern);
ASSERT_INT_EQ(match_pattern("", ""), 1);
ASSERT_INT_EQ(match_pattern("", "aaa"), 0);
ASSERT_INT_EQ(match_pattern("aaa", ""), 0);
ASSERT_INT_EQ(match_pattern("aaa", "aaaa"), 0);
ASSERT_INT_EQ(match_pattern("aaaa", "aaa"), 0);
ASSERT_INT_EQ(match_pattern("abc", "abc"), 1);
ASSERT_INT_EQ(match_pattern("abc", "abd"), 0);
ASSERT_INT_EQ(match_pattern("abc", "abcd"), 0);
ASSERT_INT_EQ(match_pattern("abcd", "abc"), 0);
ASSERT_INT_EQ(match_pattern("", "*"), 1);
ASSERT_INT_EQ(match_pattern("", "**"), 1);
ASSERT_INT_EQ(match_pattern("", "***"), 1);
ASSERT_INT_EQ(match_pattern("", "?"), 0);
ASSERT_INT_EQ(match_pattern("", "*?"), 0);
ASSERT_INT_EQ(match_pattern("", "?*"), 0);
ASSERT_INT_EQ(match_pattern("", "**a*"), 0);
ASSERT_INT_EQ(match_pattern("a", "?"), 1);
ASSERT_INT_EQ(match_pattern("aa", "a?"), 1);
ASSERT_INT_EQ(match_pattern("a", "*"), 1);
ASSERT_INT_EQ(match_pattern("aa", "a*"), 1);
ASSERT_INT_EQ(match_pattern("aa", "?*"), 1);
ASSERT_INT_EQ(match_pattern("aa", "?a"), 1);
ASSERT_INT_EQ(match_pattern("aa", "*a"), 1);
ASSERT_INT_EQ(match_pattern("ba", "a?"), 0);
ASSERT_INT_EQ(match_pattern("ba", "a*"), 0);
ASSERT_INT_EQ(match_pattern("ab", "?a"), 0);
ASSERT_INT_EQ(match_pattern("ab", "*a"), 0);
ASSERT_INT_EQ(match_pattern("aa", "**"), 1);
ASSERT_INT_EQ(match_pattern("ab", "a***b"), 1);
ASSERT_INT_EQ(match_pattern("axb", "a***b"), 1);
ASSERT_INT_EQ(match_pattern("axxb", "a***b"), 1);
ASSERT_INT_EQ(match_pattern("ax", "a***b"), 0);
ASSERT_INT_EQ(match_pattern("abbb", "a*b*b"), 1);
ASSERT_INT_EQ(match_pattern("abbb", "a*b*c"), 0);
ASSERT_INT_EQ(match_pattern("aaaaaaaaac", "a*a*a*a*b"), 0);
ASSERT_INT_EQ(match_pattern("aaaaaaaaab", "a*a*a*a*b"), 1);
ASSERT_INT_EQ(match_pattern("ab", "*b"), 1);
ASSERT_INT_EQ(match_pattern("ab", "*a*"), 1);
ASSERT_INT_EQ(match_pattern("ab", "*a*b"), 1);
ASSERT_INT_EQ(match_pattern("ab", "*a*c"), 0);
ASSERT_INT_EQ(match_pattern("abc", "a?c"), 1);
ASSERT_INT_EQ(match_pattern("abc", "??c"), 1);
ASSERT_INT_EQ(match_pattern("abc", "???"), 1);
ASSERT_INT_EQ(match_pattern("abc", "a?d"), 0);
ASSERT_INT_EQ(match_pattern("ab", "???"), 0);
ASSERT_INT_EQ(match_pattern("abc", "ab*"), 1);
ASSERT_INT_EQ(match_pattern("ab", "ab*"), 1);
ASSERT_INT_EQ(match_pattern("a", "ab*"), 0);
ASSERT_INT_EQ(match_pattern("abc", "ab?"), 1);
ASSERT_INT_EQ(match_pattern("ab", "ab?"), 0);
ASSERT_INT_EQ(match_pattern("abcd", "ab?"), 0);
ASSERT_INT_EQ(match_pattern("abc", "?bc"), 1);
ASSERT_INT_EQ(match_pattern("abc", "?b*"), 1);
ASSERT_INT_EQ(match_pattern("abc", "?c"), 0);
ASSERT_INT_EQ(match_pattern("abc", "a*?c"), 1);
ASSERT_INT_EQ(match_pattern("ac", "a*?c"), 0);
ASSERT_INT_EQ(match_pattern("abbc", "a*?c"), 1);
ASSERT_INT_EQ(match_pattern("abc", "a?*c"), 1);
ASSERT_INT_EQ(match_pattern("ac", "a?*c"), 0);
ASSERT_INT_EQ(match_pattern("abbc", "a?*c"), 1);
ASSERT_INT_EQ(match_pattern("abc", "a*?*c"), 1);
ASSERT_INT_EQ(match_pattern("ac", "a*?*c"), 0);
ASSERT_INT_EQ(match_pattern("abc", "?*c"), 1);
ASSERT_INT_EQ(match_pattern("ac", "?*c"), 1);
ASSERT_INT_EQ(match_pattern("c", "?*c"), 0);
ASSERT_INT_EQ(match_pattern("abc", "*?c"), 1);
ASSERT_INT_EQ(match_pattern("ac", "*?c"), 1);
ASSERT_INT_EQ(match_pattern("c", "*?c"), 0);
ASSERT_INT_EQ(match_pattern("abc", "a?*"), 1);
ASSERT_INT_EQ(match_pattern("ab", "a?*"), 1);
ASSERT_INT_EQ(match_pattern("a", "a?*"), 0);
ASSERT_INT_EQ(match_pattern("abc", "a*?"), 1);
ASSERT_INT_EQ(match_pattern("ab", "a*?"), 1);
ASSERT_INT_EQ(match_pattern("a", "a*?"), 0);
ASSERT_INT_EQ(match_pattern("abb", "a*b"), 1);
ASSERT_INT_EQ(match_pattern("abbc", "a*b"), 0);
if (match_pattern(name, options.accept_env[i])) {
!match_pattern(user, d->to.user))
if (match_pattern(name, k->cert->principals[i])) {
if (match_pattern(cert->cert->principals[i], cp)) {
union match_pattern pattern;
struct dev_match_pattern match_pattern;
match_pattern.type = DEV_MATCH_DEVICE;
device_pattern = &match_pattern.pattern.device_pattern;
cdm.patterns = &match_pattern;
cdm.pattern_buf_len = sizeof(match_pattern);