Displaying 4 results from an estimated 4 matches for "__match_pattern".
2019 Feb 22
2
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
...st char *, const char *);
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index f721fca9d998..1e4cdc9280d4 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -128,7 +128,7 @@ free_windows_environment(char **p)
*/
static int
-__match_pattern (const wchar_t *s, const wchar_t *pattern, int caseinsensitive)
+__match_pattern (const wchar_t *s, const wchar_t *pattern)
{
for (;;) {
/* If at end of pattern, accept if also at end of string. */
@@ -152,8 +152,7 @@ __match_pattern (const wchar_t *s, const wchar_t *pattern, int caseinsensit...
2019 Feb 22
3
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
On Wed, 20 Feb 2019 at 23:54, Corinna Vinschen <vinschen at redhat.com> wrote:
> The previous revert enabled case-insensitive user names again. This
> patch implements the case-insensitive user and group name matching.
> To allow Unicode chars, implement the matcher using wchar_t chars in
> Cygwin-specific code. Keep the generic code changes as small as possible.
> Cygwin:
2019 Feb 20
3
[PATCH 0/2] Cygwin: allow user and group case-insensitive Unicode strings
Windows usernames are case-insensitive and almost any Unicode character
is allowed in a username. The user should be able to login with her
username given in any case and not be refused. However, this opens up
a security problem in terms of the sshd_config Match rules. The match
rules for user and group names have to operate case-insensitive as well,
otherwise the user can override her settings
2019 Mar 12
2
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
...;
> mbstowcs(ws, s, len + 1);
> if ((len = mbstowcs(NULL, pattern, 0)) < 0)
> return 0;
> - wpattern = (wchar_t *) alloca((len + 1) * sizeof (wchar_t));
> + wpattern = (wchar_t *) xcalloc(len + 1, sizeof (wchar_t));
> mbstowcs(wpattern, pattern, len + 1);
> - return __match_pattern (ws, wpattern);
> + ret = __match_pattern (ws, wpattern);
> + free(ws);
> + free(wpattern);
> + return ret;
> }
Great idea. I just built and tested it. Please go ahead.
What about my other patch to contrib/cygwin/ssh-host-config?
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Ma...