- From e198296876c13c0621a984bf66b27e42bc92c606 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 14 Jun 2025 20:21:52 +0200
- Subject: [PATCH 1/2] daemon: Add workaround "...\isctype.cpp(36) : Assertion
- failed: c >= -1 && c <= 255" assertions in CPV parser
- Add workaround for
- "minkernel\crts\ucrt\src\appcrt\convert\isctype.cpp(36) :
- Assertion failed: c >= -1 && c <= 255" assertions in ksh93 compound
- variable (CPV) parser when it encounters non-ASCII characters.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/cpvparser1.c | 23 ++++++++++++++++++++---
- 1 file changed, 20 insertions(+), 3 deletions(-)
- diff --git a/daemon/cpvparser1.c b/daemon/cpvparser1.c
- index 285fc76..48aa111 100644
- --- a/daemon/cpvparser1.c
- +++ b/daemon/cpvparser1.c
- @@ -2,7 +2,7 @@
- /*
- * MIT License
- *
- - * Copyright (c) 2023 Roland Mainz <roland.mainz@nrubsig.org>
- + * Copyright (c) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- @@ -37,7 +37,7 @@
- *
- * ToDo:
- * - arrays (indexed, sparse indexed and associative)
- - * - multibyte characters
- + * - multibyte characters (e.g. use |wchar_t| API)
- *
- * Written by Roland Mainz <roland.mainz@nrubsig.org>
- */
- @@ -52,7 +52,24 @@
- #ifdef _WIN32
- #define strdup(s) _strdup(s)
- -#endif
- +#ifdef _MSC_VER
- +/*
- + * Hack to avoid UCRT assertion
- + * "minkernel\crts\ucrt\src\appcrt\convert\isctype.cpp(36) :
- + * Assertion failed: c >= -1 && c <= 255"
- + * This hack works for UTF-8 because UTF-8 and ASCII are identical for code
- + * codepoints between 0 and 127 (i.e. UTF-8 is intentionally
- + * backwards-compatible to ASCII).
- + * Permanent fix would be to switch over to the |wchar_t| API.
- + */
- +#undef isspace
- +#define isspace(c) isspace((((c) >= 0) && ((c) < 127))?(c):0)
- +#undef isalpha
- +#define isalpha(c) isalpha((((c) >= 0) && ((c) < 127))?(c):0)
- +#undef isalnum
- +#define isalnum(c) isalnum((((c) >= 0) && ((c) < 127))?(c):0)
- +#endif /* _MSC_VER */
- +#endif /* _WIN32 */
- /* private data! */
- typedef struct cpv_parse_context {
- --
- 2.45.1
- From 92e17f7fa7b93251d751883ae24a6e06eb1ca626 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 14 Jun 2025 21:19:14 +0200
- Subject: [PATCH 2/2] tests: Add test entries for group names with non-ASCII
- characters
- Add test entries for group names with non-ASCII characters
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 21 ++++++++++++++++-----
- 1 file changed, 16 insertions(+), 5 deletions(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index ea82965..c7e83fd 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -1,5 +1,5 @@
- #
- -# ms-nfs41-client manual testing sequence, 2025-05-10
- +# ms-nfs41-client manual testing sequence, 2025-06-14
- #
- # Draft version, needs to be turned into automated tests
- # if possible
- @@ -194,6 +194,9 @@ ksh93 -c 'builtin cp ; rm -f x y ; touch x ; cp -p x y && print OK ; true'
- ksh93 -c 'builtin cp ; rm -f x y ; touch x ; /usr/bin/cp -p x y && print OK ; true'
- ksh93 -c 'builtin id ; rm -f x ; touch x ; chown "$(id -u -n):$(id -g -n)" x && print OK'
- ksh93 -c 'builtin id ; rm -f x ; touch x ; chgrp "$(id -g -n)" x && print OK'
- +# Extra tests if the cygwingrp*-groups exist on a test system:
- +ksh93 -c 'builtin chgrp; rm -f x ; touch x ; chgrp "cygwingrp2" x && print OK'
- +ksh93 -c 'builtin chgrp; rm -f x ; touch x ; chgrp "$(printf "cygwingrp_\u00F6\u00E4\u00FC_4")" x && print OK'
- ---- snip ----
- @@ -290,33 +293,41 @@ mkdir //derfwnb4966_ipv6linklocal@2049/nfs4/bigdisk/builds/bash_build1/a2/b2 ||
- #
- # Tests for groups
- -# (Add groups "cygwingrp1" and "cygwingrp2" to both Linux NFSv4 server
- -# and Windows machine, after that $ chgrp cygwingrp2 # should work)
- +# (Add groups "cygwingrp1", "cygwingrp2" and "cygwingrp_<oe><ae<ue>_4"
- +# to both Linux NFSv4 server and Windows machine, after that
- +# $ chgrp cygwingrp2 filename # and
- +# $ chgrp $'cygwingrp_\u00F6\u00E4\u00FC_4' filename # should work)
- #
- ---- snip ----
- # "WINHOST1" is the Windows machine,
- # "DERFWNB4966" is the Linux NFSv4 server:
- -# create two groups on the Windows machine
- +# create three groups on the Windows machine
- WINHOST1:~$ net localgroup cygwingrp1 /add
- WINHOST1:~$ net localgroup cygwingrp2 /add
- +WINHOST1:~$ powershell -Command 'New-LocalGroup -Name "cygwingrp_$([char]0x00F6)$([char]0x00E4)$([char]0x00FC)_4" -Description "Cygwin test group with non-ASCII chars in name"'
- # add user "roland_mainz" to both new groups
- WINHOST1:~$ net localgroup cygwingrp1 roland_mainz /add
- WINHOST1:~$ net localgroup cygwingrp2 roland_mainz /add
- +WINHOST1:~$ powershell -Command 'Add-LocalGroupMember -Group "cygwingrp_$([char]0x00F6)$([char]0x00E4)$([char]0x00FC)_4" -Member roland_mainz'
- # get gid from both groups
- WINHOST1:~$ getent group cygwingrp1
- cygwingrp1:S-1-5-21-3286904461-661230000-4220857270-1003:197611:
- WINHOST1:~$ getent group cygwingrp2
- cygwingrp2:S-1-5-21-3286904461-661230000-4220857270-1004:197612:
- +WINHOST1:~$ getent group $'cygwingrp_\u00F6\u00E4\u00FC_4'
- +cygwingrp_<oe><ae<ue>_4:S-1-5-21-1849874161-1103376535-3295315891-1008:197616:
- # add the two groups to the Linux NFSv4 server, including the gids
- -("197611" and "197612"):
- +("197611", "197612" and "197616"):
- root@DERFWNB4966:~# groupadd -g 197611 cygwingrp1
- root@DERFWNB4966:~# groupadd -g 197612 cygwingrp2
- +root@DERFWNB4966:~# printf "cygwingrp_\u00F6\u00E4\u00FC_4:x:197616:\n" >>'/etc/group'
- root@DERFWNB4966:~# usermod -a -G cygwingrp1 roland_mainz
- root@DERFWNB4966:~# usermod -a -G cygwingrp2 roland_mainz
- +# user "roland_mainz" must be manually added to group "cygwingrp2_<oe><ae<ue>_4"
- ---- snip ---
- #
- --
- 2.45.1
msnfs41client: Patch to add tests for non-ASCII group names+misc, 2025-06-14
Posted by Anonymous on Sat 14th Jun 2025 20:32
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.