Use Cygwin-specific matching only for users+groups.
Patch from vinschen at redhat.com, updated a little by me.
diff --git a/match.c b/match.c
index ff0815e..fcf6959 100644
--- a/match.c
+++ b/match.c
@@ -111,8 +111,6 @@
/* 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 @@
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
}