summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2019-03-12 09:19:19 +1100
committerDarren Tucker <dtucker@dtucker.net>2019-03-12 09:19:19 +1100
commitdaa7505aadca68ba1a2c70cbdfce423208eb91ee (patch)
tree5a928d2516bac7be6f0fde98dfdb7eb7b266dec9 /match.c
parentfd10cf027b56f9aaa80c9e3844626a05066589a4 (diff)
Use Cygwin-specific matching only for users+groups.
Patch from vinschen at redhat.com, updated a little by me.
Diffstat (limited to 'match.c')
-rw-r--r--match.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/match.c b/match.c
index ff0815ef..fcf69596 100644
--- a/match.c
+++ b/match.c
@@ -111,8 +111,6 @@ match_pattern(const char *s, const char *pattern)
/* NOTREACHED */
}
-#ifndef HAVE_CYGWIN /* Cygwin version in openbsd-compat/bsd-cygwin_util.c */
-
/*
* Tries to match the string against the
* comma-separated sequence of subpatterns (each possibly preceded by ! to
@@ -172,18 +170,16 @@ match_pattern_list(const char *string, const char *pattern, int dolower)
return got_positive;
}
-#endif
-
/* Match a list representing users or groups. */
int
match_usergroup_pattern_list(const char *string, const char *pattern)
{
-#ifndef HAVE_CYGWIN
- /* Case sensitive match */
- return match_pattern_list(string, pattern, 0);
+#ifdef HAVE_CYGWIN
+ /* Windows usernames may be Unicode and are not case sensitive */
+ return cygwin_ug_match_pattern_list(string, pattern);
#else
/* Case insensitive match */
- return match_pattern_list(string, pattern, 1);
+ return match_pattern_list(string, pattern, 0);
#endif
}