pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for nfsurlconv+URL parsing+MSYS2 support+testing+misc, 2024-11-25
Posted by Anonymous on Mon 25th Nov 2024 18:29
raw | new post

  1. From c6a48533a570662524f77d26cc6cc5c65530174d Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Mon, 25 Nov 2024 12:48:34 +0100
  4. Subject: [PATCH 1/8] daemon,tests: Add workaround for Cygwin's "silly rename"
  5.  with invalid UTF-16 filenames
  6.  
  7. Add workaround for Cygwin's "silly rename" with invalid UTF-16 filename
  8. prefix.
  9.  
  10. Cygwin has it's own variation of "silly rename" (i.e. if
  11. someone deletes a file while someone else still has
  12. a valid fd to that file it first renames that file with a
  13. special prefix, see
  14. newlib-cygwin/winsup/cygwin/syscalls.cc, function
  15. |try_to_bin()|).
  16.  
  17. Unfortunately on filesystems supporting Unicode
  18. (i.e. |FILE_UNICODE_ON_DISK|) Cygwin adds the prefix
  19. L".\xdc63\xdc79\xdc67", which is NOT a valid UTF-16 sequence,
  20. and will be rejected by a filesystem validating the
  21. UTF-16 sequence (e.g. SAMBA, ReFS, OpenZFS, ...; for SAMBA
  22. Cygwin uses the ".cyg" prefix used for
  23. non-|FILE_UNICODE_ON_DISK| filesystems).
  24. In our case the NFSv4.1 protocol requires valid UTF-8
  25. sequences, and the NFS server will reject filenames if either
  26. the server or the exported filesystem will validate the UTF-8
  27. sequence.
  28.  
  29. Since Cygwin only does a |rename()| and never a lookup by
  30. that filename we just stomp the prefix with the ".cyg" prefix
  31. used for non-|FILE_UNICODE_ON_DISK| filesystems.
  32. We ignore the side-effects here, e.g. that Win32 will still
  33. "remember" the original filename in the file name cache.
  34.  
  35. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  36. ---
  37. daemon/setattr.c         | 42 ++++++++++++++++++++++++++++++++++++++++
  38.  tests/manual_testing.txt |  6 ++++++
  39.  2 files changed, 48 insertions(+)
  40.  
  41. diff --git a/daemon/setattr.c b/daemon/setattr.c
  42. index 9eaafb5..34796e1 100644
  43. --- a/daemon/setattr.c
  44. +++ b/daemon/setattr.c
  45. @@ -284,6 +284,48 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  46.  
  47.      EASSERT((rename->FileNameLength%sizeof(WCHAR)) == 0);
  48.  
  49. +#define CYGWIN_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE 1
  50. +
  51. +#ifdef CYGWIN_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE
  52. +    /*
  53. +     * Stomp Cygwin "silly rename" invalid Unicode sequence
  54. +     *
  55. +     * Cygwin has it's own variation of "silly rename" (i.e. if
  56. +     * someone deletes a file while someone else still has
  57. +     * a valid fd to that file it first renames that file with a
  58. +     * special prefix, see
  59. +     * newlib-cygwin/winsup/cygwin/syscalls.cc, function
  60. +     * |try_to_bin()|).
  61. +     *
  62. +     * Unfortunately on filesystems supporting Unicode
  63. +     * (i.e. |FILE_UNICODE_ON_DISK|) Cygwin adds the prefix
  64. +     * L".\xdc63\xdc79\xdc67", which is NOT a valid UTF-16 sequence,
  65. +     * and will be rejected by a filesystem validating the
  66. +     * UTF-16 sequence (e.g. SAMBA, ReFS, OpenZFS, ...; for SAMBA
  67. +     * Cygwin uses the ".cyg" prefix used for
  68. +     * non-|FILE_UNICODE_ON_DISK| filesystems).
  69. +     * In our case the NFSv4.1 protocol requires valid UTF-8
  70. +     * sequences, and the NFS server will reject filenames if either
  71. +     * the server or the exported filesystem will validate the UTF-8
  72. +     * sequence.
  73. +     *
  74. +     * Since Cygwin only does a |rename()| and never a lookup by
  75. +     * that filename we just stomp the prefix with the ".cyg" prefix
  76. +     * used for non-|FILE_UNICODE_ON_DISK| filesystems.
  77. +     * We ignore the side-effects here, e.g. that Win32 will still
  78. +     * "remember" the original filename in the file name cache.
  79. +     */
  80. +    if ((rename->FileNameLength > (4*sizeof(wchar_t))) &&
  81. +        (!memcmp(rename->FileName,
  82. +            L".\xdc63\xdc79\xdc67", (4*sizeof(wchar_t))))) {
  83. +        DPRINTF(1, ("handle_nfs41_rename(args->path='%s'): "
  84. +            "Cygwin sillyrename prefix \".\\xdc63\\xdc79\\xdc67\" "
  85. +            "detected, squishing prefix to \".cyg\"\n",
  86. +            args->path));
  87. +        (void)memcpy(rename->FileName, L".cyg", 4*sizeof(wchar_t));
  88. +    }
  89. +#endif /* CYGWIN_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE */
  90. +
  91.      dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8,
  92.          WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  93.          rename->FileName, rename->FileNameLength/sizeof(WCHAR),
  94. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  95. index 16972b0..699d20e 100644
  96. --- a/tests/manual_testing.txt
  97. +++ b/tests/manual_testing.txt
  98. @@ -432,7 +432,13 @@ bash /usr/share/msnfs41client/tests/misc/wintartest_comparewinvsgnu001.bash myta
  99.  # The NFS server has a weekly cron job removing files called ".nfs*" which
  100.  # are more than a week old to deal with .nfs* files from NFS clients which
  101.  # crashed while having deleted files open.
  102. +#
  103. +# The test here comes in two variations, one using "rm myfile" (which triggers
  104. +# Cygwin "silly rename" (see newlib-cygwin/winsup/cygwin/syscalls.cc,
  105. +# function |try_to_bin()|), and one using $ cmd /C "del myfile" #, which
  106. +# bypasses the Cygwin code
  107.  bash -c 'set -o errexit ; rm -Rf sillytestdir ; mkdir sillytestdir ; cd sillytestdir ; touch sillytest ; ( command exec {n}<"sillytest" ; printf "fd=%d\n" $n ; sleep 10) & sleep 1 ; ls -la ; cmd /C "del sillytest" ; ls -la ; if [[ "$(ls -1 .nfs*)" != "" ]] ; then echo "# test OK" ; else echo "# test FAILED" ; fi ; wait'
  108. +bash -c 'set -o errexit ; rm -Rf sillytestdir ; mkdir sillytestdir ; cd sillytestdir ; touch sillytest ; ( command exec {n}<"sillytest" ; printf "fd=%d\n" $n ; sleep 10) & sleep 1 ; ls -la ; rm -f sillytest ; ls -la ; if [[ "$(ls -1 .nfs*)" != "" ]] ; then echo "# test OK" ; else echo "# test FAILED" ; fi ; wait'
  109.  
  110.  #
  111.  # EOF.
  112. --
  113. 2.45.1
  114.  
  115. From a936e7a852c91facacf3d9fdc27edcb7247887c0 Mon Sep 17 00:00:00 2001
  116. From: Roland Mainz <roland.mainz@nrubsig.org>
  117. Date: Mon, 25 Nov 2024 13:39:35 +0100
  118. Subject: [PATCH 2/8] cygwin: nfsurlconv in shell-safe mode should also encode
  119.  '(', ')'
  120.  
  121. nfsurlconv in shell-safe mode should also encode '(', ')'
  122.  
  123. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  124. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  125. ---
  126. cygwin/utils/nfsurlconv/nfsurlconv.ksh | 7 ++++---
  127.  1 file changed, 4 insertions(+), 3 deletions(-)
  128.  
  129. diff --git a/cygwin/utils/nfsurlconv/nfsurlconv.ksh b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  130. index d7c2671..8dbe955 100644
  131. --- a/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  132. +++ b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  133. @@ -224,8 +224,9 @@ function urlencodestr
  134.                 # ("/" for nfs://-URLS) are allowed
  135.                 #
  136.                 if (( posix_shell_safe != 0 )) ; then
  137. -                       # in POSIX shell safe mode we also encode '!', '*', '$'
  138. -                       if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/-_.+\'(),[:alnum:]] ]] ; then
  139. +                       # in POSIX shell safe mode we also encode
  140. +                       # '!', '*', '$', "(", ")", "{", "}", "#"
  141. +                       if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/-_.,[:alnum:]] ]] ; then
  142.                                 url+="%$ch_hexval"
  143.                         else
  144.                                 url+="$ch"
  145. @@ -283,7 +284,7 @@ function main
  146.  
  147.         # fixme: Need better text layout for $ nfsurlconv --man #
  148.         typeset -r nfsurlconv_usage=$'+
  149. -       [-?\n@(#)\$Id: nfsurlconv (Roland Mainz) 2024-11-22 \$\n]
  150. +       [-?\n@(#)\$Id: nfsurlconv (Roland Mainz) 2024-11-25 \$\n]
  151.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  152.         [+NAME?nfsurlconv - convert hostname,port,path from/to a nfs://-URL]
  153.         [+DESCRIPTION?\bnfsurlconv\b convert { hostname, port, path } from/to a nfs://-URL.]
  154. --
  155. 2.45.1
  156.  
  157. From 18e3d236d5cf7156e71ae645bb42681e6d6966c4 Mon Sep 17 00:00:00 2001
  158. From: Roland Mainz <roland.mainz@nrubsig.org>
  159. Date: Mon, 25 Nov 2024 14:06:25 +0100
  160. Subject: [PATCH 3/8] cygwin: mount_sshnfs,nfsurlconv,sshnfs: Fix URL decoding
  161.  with path "+c"
  162.  
  163. mount_sshnfs,nfsurlconv,sshnfs: Fix URL decoding in function "urldecodestr"
  164. with path "+c", e.g. "nfs://bbb:12049//a/b/%2bc"
  165.  
  166. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  167. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  168. ---
  169. cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | 8 ++++----
  170.  cygwin/utils/nfsurlconv/nfsurlconv.ksh     | 2 +-
  171.  cygwin/utils/sshnfs/sshnfs.ksh             | 2 +-
  172.  3 files changed, 6 insertions(+), 6 deletions(-)
  173.  
  174. diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  175. index 861a010..ace325a 100644
  176. --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  177. +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  178. @@ -254,7 +254,7 @@ function urldecodestr
  179.         # urldecode '+' to ' '
  180.         s="${s//+/ }"
  181.         # urldecode %<hexdigit><hexdigit>
  182. -       s="${s//~(E)(?:%([[:xdigit:]][[:xdigit:]]))/\\x}"
  183. +       s="${s//~(E)(?:%([[:xdigit:]][[:xdigit:]]))/\\x[]}"
  184.         # quote any remaining "%" to make it safe for printf(1)
  185.         s="${s//%/%%}"
  186.  
  187. @@ -422,7 +422,7 @@ function cmd_mount
  188.  
  189.         # fixme: Need better text layout for $ mount_sshnfs mount --man #
  190.         typeset -r mount_sshnfs_cmdmount_usage=$'+
  191. -       [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2024-09-03 \$\n]
  192. +       [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2024-11-25 \$\n]
  193.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  194.         [+NAME?mount_sshnfs mount - mount NFSv4 filesystem through ssh
  195.                 tunnel]
  196. @@ -788,7 +788,7 @@ function cmd_umount
  197.         typeset mydebug=false # fixme: should be "bool" for ksh93v
  198.         # fixme: Need better text layout for $ mount_sshnfs mount --man #
  199.         typeset -r mount_sshnfs_cmdumount_usage=$'+
  200. -       [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2024-09-03 \$\n]
  201. +       [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2024-11-25 \$\n]
  202.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  203.         [+NAME?mount_sshnfs umount - unmount NFSv4 filesystem mounted
  204.                 via mount_sshnfs mount]
  205. @@ -892,7 +892,7 @@ function main
  206.  
  207.         # fixme: Need better text layout for $ mount_sshnfs --man #
  208.         typeset -r mount_sshnfs_usage=$'+
  209. -       [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2024-09-03 \$\n]
  210. +       [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2024-11-25 \$\n]
  211.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  212.         [+NAME?mount_sshnfs - mount/umount NFSv4 filesystem via ssh
  213.                 tunnel]
  214. diff --git a/cygwin/utils/nfsurlconv/nfsurlconv.ksh b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  215. index 8dbe955..063ad77 100644
  216. --- a/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  217. +++ b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  218. @@ -52,7 +52,7 @@ function urldecodestr
  219.         # urldecode '+' to ' '
  220.         s="${s//+/ }"
  221.         # urldecode %<hexdigit><hexdigit>
  222. -       s="${s//~(E)(?:%([[:xdigit:]][[:xdigit:]]))/\\x}"
  223. +       s="${s//~(E)(?:%([[:xdigit:]][[:xdigit:]]))/\\x[]}"
  224.         # quote any remaining "%" to make it safe for printf(1)
  225.         s="${s//%/%%}"
  226.  
  227. diff --git a/cygwin/utils/sshnfs/sshnfs.ksh b/cygwin/utils/sshnfs/sshnfs.ksh
  228. index 29f5dc0..6582ae2 100644
  229. --- a/cygwin/utils/sshnfs/sshnfs.ksh
  230. +++ b/cygwin/utils/sshnfs/sshnfs.ksh
  231. @@ -236,7 +236,7 @@ function urldecodestr
  232.         # urldecode '+' to ' '
  233.         s="${s//+/ }"
  234.         # urldecode %<hexdigit><hexdigit>
  235. -       s="${s//~(E)(?:%([[:xdigit:]][[:xdigit:]]))/\\x}"
  236. +       s="${s//~(E)(?:%([[:xdigit:]][[:xdigit:]]))/\\x[]}"
  237.         # quote any remaining "%" to make it safe for printf(1)
  238.         s="${s//%/%%}"
  239.  
  240. --
  241. 2.45.1
  242.  
  243. From d68f6349b7fb3db70e62b748f46b9c6c282d2eae Mon Sep 17 00:00:00 2001
  244. From: Roland Mainz <roland.mainz@nrubsig.org>
  245. Date: Mon, 25 Nov 2024 14:18:46 +0100
  246. Subject: [PATCH 4/8] cygwin: nfsurlconv: Always encode '+'
  247.  
  248. cygwin: nfsurlconv must always encode '+' to make sure
  249. it is not decoded as <space>.
  250.  
  251. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  252. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  253. ---
  254. cygwin/utils/nfsurlconv/nfsurlconv.ksh | 5 ++++-
  255.  1 file changed, 4 insertions(+), 1 deletion(-)
  256.  
  257. diff --git a/cygwin/utils/nfsurlconv/nfsurlconv.ksh b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  258. index 063ad77..505fb56 100644
  259. --- a/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  260. +++ b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  261. @@ -223,6 +223,9 @@ function urlencodestr
  262.                 # Only alphanumerics, "$-_.+!*'()," and reserved characters
  263.                 # ("/" for nfs://-URLS) are allowed
  264.                 #
  265. +               # Note that '+' must always be encoded to make sure
  266. +               # it is not decoded as <space>
  267. +               #
  268.                 if (( posix_shell_safe != 0 )) ; then
  269.                         # in POSIX shell safe mode we also encode
  270.                         # '!', '*', '$', "(", ")", "{", "}", "#"
  271. @@ -233,7 +236,7 @@ function urlencodestr
  272.                         fi
  273.  
  274.                 else
  275. -                       if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/$-_.+!*\'(),[:alnum:]] ]] ; then
  276. +                       if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/$-_.!*\'(),[:alnum:]] ]] ; then
  277.                                 url+="%$ch_hexval"
  278.                         else
  279.                                 url+="$ch"
  280. --
  281. 2.45.1
  282.  
  283. From e2a80807a871a115d5b9a6d409e2bb7859f02b3e Mon Sep 17 00:00:00 2001
  284. From: Roland Mainz <roland.mainz@nrubsig.org>
  285. Date: Mon, 25 Nov 2024 16:45:07 +0100
  286. Subject: [PATCH 5/8] daemon: Add workaround for MSYS2's "silly rename" with
  287.  invalid UTF-16 filenames
  288.  
  289. Add workaround for MSYS2's "silly rename" with invalid UTF-16 filename
  290. prefix. Since MSYS2 is a fork of Cygwin they share almost all code,
  291. except that the prefix for the files is different.
  292.  
  293. Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
  294. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  295. ---
  296. daemon/setattr.c | 19 +++++++++++++++++++
  297.  1 file changed, 19 insertions(+)
  298.  
  299. diff --git a/daemon/setattr.c b/daemon/setattr.c
  300. index 34796e1..84efb70 100644
  301. --- a/daemon/setattr.c
  302. +++ b/daemon/setattr.c
  303. @@ -285,6 +285,7 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  304.      EASSERT((rename->FileNameLength%sizeof(WCHAR)) == 0);
  305.  
  306.  #define CYGWIN_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE 1
  307. +#define MSYS2_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE 1
  308.  
  309.  #ifdef CYGWIN_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE
  310.      /*
  311. @@ -325,6 +326,24 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  312.          (void)memcpy(rename->FileName, L".cyg", 4*sizeof(wchar_t));
  313.      }
  314.  #endif /* CYGWIN_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE */
  315. +#ifdef MSYS2_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE
  316. +    /*
  317. +     * Stomp MSYS2 "silly rename" invalid Unicode sequence
  318. +     *
  319. +     * Same procedure as Cygwin "silly rename", just with a different
  320. +     * prefix (L".\xdc6d\xdc73\xdc79\xdc73")
  321. +     */
  322. +    if ((rename->FileNameLength > (5*sizeof(wchar_t))) &&
  323. +        (!memcmp(rename->FileName,
  324. +            L".\xdc6d\xdc73\xdc79\xdc73", (5*sizeof(wchar_t))))) {
  325. +        DPRINTF(1, ("handle_nfs41_rename(args->path='%s'): "
  326. +            "msys2 sillyrename prefix "
  327. +            "\".\\xdc6d\\xdc73\\xdc79\\xdc73\" detected, squishing "
  328. +            "prefix to \".msys\"\n",
  329. +            args->path));
  330. +        (void)memcpy(rename->FileName, L".msys", 5*sizeof(wchar_t));
  331. +    }
  332. +#endif /* MSYS2_STOMP_SILLY_RENAME_INVALID_UTF16_SEQUENCE */
  333.  
  334.      dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8,
  335.          WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  336. --
  337. 2.45.1
  338.  
  339. From 8dc5082d8656d2b378590ff50f2d34e11c0595ac Mon Sep 17 00:00:00 2001
  340. From: Roland Mainz <roland.mainz@nrubsig.org>
  341. Date: Mon, 25 Nov 2024 17:38:47 +0100
  342. Subject: [PATCH 6/8] cygwin: Add MSYS2 as supported toolkit to
  343.  README.bintarball
  344.  
  345. Add MSYS2 as supported toolkit to README.bintarball
  346.  
  347. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  348. ---
  349. cygwin/README.bintarball.txt | 86 +++++++++++++++++++++++++++++-------
  350.  1 file changed, 69 insertions(+), 17 deletions(-)
  351.  
  352. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  353. index 050007e..f335787 100644
  354. --- a/cygwin/README.bintarball.txt
  355. +++ b/cygwin/README.bintarball.txt
  356. @@ -43,10 +43,10 @@ NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  357.        characters in the mount path, independent of current locale.
  358.  
  359.  - UNC paths
  360. -    - Mounting UNC paths without DOS driver letter
  361. +    - Mounting UNC paths without DOS driver letterpacman -S --noconfirm
  362.      - IPv6 support in UNC paths
  363. -    - /sbin/nfs_mount prints UNC paths in Win32+Cygwin formats
  364. -    - Cygwin bash+ksh93 support UNC paths, e.g.
  365. +    - /sbin/nfs_mount prints UNC paths in Win32+Cygwin/MSYS2 formats
  366. +    - Cygwin/MSYS2 bash+ksh93 support UNC paths, e.g.
  367.        cd //derfwnb4966@2049/nfs4/bigdisk/mysqldb4/
  368.  
  369.  - WSL support
  370. @@ -70,11 +70,11 @@ NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  371.      - See Linux export(5) refer= option, nfsref(5) or
  372.          https://docs.oracle.com/cd/E86824_01/html/E54764/nfsref-1m.html
  373.  
  374. -- SFU/Cygwin support, including:
  375. +- SFU/Cygwin/MSYS2 support, including:
  376.      - POSIX uid/gid+mode
  377.      - Backwards compatibility to Microsoft's NFSv3 driver
  378.      - Cygwin ACLs, e.g. setfacl/getfacl
  379. -    - Cygwin symlinks
  380. +    - Cygwin/MSYS2 symlinks
  381.  
  382.  - Custom primary group support
  383.      - Supports primary group changes in the calling process/thread
  384. @@ -89,7 +89,7 @@ NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  385.  - Software compatibility:
  386.      - Any NFSv4.1 server (Linux, Solaris, Illumos, FreeBSD, nfs4j,
  387.          ...)
  388. -    - All tools from Cygwin/MinGW
  389. +    - All tools from Cygwin/MSYS2/MinGW
  390.      - Visual Studio
  391.      - VMware Workstation (can use VMs hosted on NFSv4.1 filesystem)
  392.  
  393. @@ -141,6 +141,38 @@ NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  394.          bison
  395.          cygport
  396.          libiconv-devel
  397. +- MSYS2 (64bit, optional):
  398. +    - Packages (recommended):
  399. +        base-devel
  400. +        gcc
  401. +        clang
  402. +        sed
  403. +        time
  404. +        coreutils
  405. +        util-linux
  406. +        grep
  407. +        sed
  408. +        emacs
  409. +        gdb
  410. +        make
  411. +        gettext
  412. +        gettext-devel
  413. +        git
  414. +        subversion
  415. +        flex
  416. +        bison
  417. +        unzip
  418. +        pax
  419. +        tar
  420. +        libiconv-devel
  421. +        ncurses-devel
  422. +        gmp-devel
  423. +        mpfr-devel
  424. +        mpc-devel
  425. +        isl-devel
  426. +        procps-ng
  427. +        libiconv-devel
  428. +
  429.  
  430.  #
  431.  # 4. Download and install Cygwin (if not installed yet):
  432. @@ -183,7 +215,25 @@ setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crou
  433.  
  434.  
  435.  #
  436. -# 5. Download "ms-nfs41-client" installation tarball:
  437. +# 5. Download and install MSYS2/64bit [OPTIONAL]
  438. +#
  439. +# 1. Download&&install from Cygwin
  440. +# ---- snip ----
  441. +mkdir -p download && cd download
  442. +wget 'https://github.com/msys2/msys2-installer/releases/download/2024-11-16/msys2-x86_64-20241116.exe'
  443. +chmod a+x msys2-x86_64-20241116.exe
  444. +./msys2-x86_64-20241116 --default-answer --root 'C:\msys64' install
  445. +# ---- snip ----
  446. +
  447. +# 2. Install extra packages:
  448. +# Start MSYS2 UCRT mintty and execute this:
  449. +# ---- snip ----
  450. +pacman -S --noconfirm base-devel gcc clang sed time coreutils util-linux grep sed emacs gdb make gettext gettext-devel git subversion flex bison unzip pax tar libiconv-devel ncurses-devel gmp-devel mpfr-devel mpc-devel isl-devel procps-ng libiconv-devel
  451. +# ---- snip ----
  452. +
  453. +
  454. +#
  455. +# 6. Download "ms-nfs41-client" installation tarball:
  456.  #
  457.  # (from a Cygwin terminal)
  458.  $ mkdir -p ~/download
  459. @@ -194,7 +244,7 @@ SHA2-256(${bintarball.base_filename}.tar.bz2)= ${bintarball.archive_sha256hash}
  460.  
  461.  
  462.  #
  463. -# 6. Installation (as "Administrator"):
  464. +# 7. Installation (as "Administrator"):
  465.  #
  466.  $ (cd / && tar -xf ~/download/${bintarball.base_filename}.tar.bz2 )
  467.  $ /sbin/msnfs41client install
  468. @@ -202,14 +252,14 @@ $ /sbin/msnfs41client install
  469.  
  470.  
  471.  #
  472. -# 7. Deinstallation:
  473. +# 8. Deinstallation:
  474.  #
  475.  $ (set -o xtrace ; cd / && tar -tf ~/download/${bintarball.base_filename}.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
  476.  <REBOOT>
  477.  
  478.  
  479.  #
  480. -# 8. Usage:
  481. +# 9. Usage:
  482.  #
  483.  
  484.  # Option a)
  485. @@ -353,10 +403,10 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  486.    limitation
  487.  - Not all POSIX file types (e.g. block devices) etc. are supported
  488.  
  489. +
  490.  #
  491. -# 9. Notes:
  492. +# 10. Notes:
  493.  #
  494. -
  495.  - Idmapping (including uid/gid mapping) between NFSv4 client and
  496.    NFSv4 server works via /lib/msnfs41client/cygwin_idmapper.ksh,
  497.    which either uses builtin static data, or /usr/bin/getent passwd
  498. @@ -368,7 +418,7 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  499.    client and server side.
  500.  
  501.  - UNC paths are supported, after successful mounting /sbin/nfs_mount
  502. -  will list the paths in Cygwin UNC format.
  503. +  will list the paths in Cygwin/MSYS2 UNC format.
  504.  
  505.  - SIDs work, users with valid Windows accounts (see Cygwin idmapping
  506.    above get their SIDs, unknown users with valid uid/gid values get
  507. @@ -380,7 +430,7 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  508.    - pass URL to nfs_mount.exe like this:
  509.      $ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #
  510.  
  511. -- Cygwin symlinks are supported, but might require
  512. +- Cygwin/MSYS2 symlinks are supported, but might require
  513.    $ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #.
  514.    This includes symlinks to UNC paths, e.g. as Admin
  515.    $ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #
  516. @@ -451,8 +501,9 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  517.    user+groups to a small script for the NFSv4 server to set-up
  518.    these accounts on the server side.
  519.  
  520. +
  521.  #
  522. -# 10. Known issues:
  523. +# 11. Known issues:
  524.  #
  525.  - The kernel driver ("nfs41_driver.sys") does not yet have a
  526.    cryptographic signature for SecureBoot - which means it will only
  527. @@ -567,8 +618,9 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  528.    OR "nocache" option, e.g.
  529.    $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
  530.  
  531. +
  532.  #
  533. -# 11. Notes for troubleshooting && finding bugs/debugging:
  534. +# 12. Notes for troubleshooting && finding bugs/debugging:
  535.  #
  536.  - nfsd_debug.exe has the -d option to set a level for debug
  537.    output.
  538. @@ -603,7 +655,7 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  539.  
  540.  
  541.  #
  542. -# 12. Source code:
  543. +# 13. Source code:
  544.  #
  545.  - Source code can be obtained from https://github.com/kofemann/ms-nfs41-client
  546.    or as git bundle from /usr/src/msnfs41client/msnfs41client_git.bundle
  547. --
  548. 2.45.1
  549.  
  550. From 08cc3d52d011043335596f9be65b11d602307fce Mon Sep 17 00:00:00 2001
  551. From: Roland Mainz <roland.mainz@nrubsig.org>
  552. Date: Mon, 25 Nov 2024 17:39:39 +0100
  553. Subject: [PATCH 7/8] tests: Add MSYS2 installation instructions for tests
  554.  
  555. Add MSYS2 installation instructions for tests
  556.  
  557. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  558. ---
  559. tests/manual_testing.txt | 43 +++++++++++++++++++++++++++++++++++++++-
  560.  1 file changed, 42 insertions(+), 1 deletion(-)
  561.  
  562. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  563. index 699d20e..48614f2 100644
  564. --- a/tests/manual_testing.txt
  565. +++ b/tests/manual_testing.txt
  566. @@ -7,7 +7,8 @@
  567.  
  568.  #
  569.  # Notes:
  570. -# - The following Cygwin packages must be installed for running the tests:
  571. +# - Cygwin enviroment:
  572. +#   The following Cygwin packages must be installed for running the tests:
  573.  #   ---- snip ----
  574.  #   gcc-core
  575.  #   gcc-g++
  576. @@ -42,6 +43,46 @@
  577.  #   gettext-devel
  578.  #   ---- snip ----
  579.  #
  580. +# - MSYS2 environment:
  581. +#   - Install the env with:
  582. +#   $ mkdir -p download && cd download
  583. +#   $ wget 'https://github.com/msys2/msys2-installer/releases/download/2024-11-16/msys2-x86_64-20241116.exe'
  584. +#   $ chmod a+x msys2-x86_64-20241116.exe
  585. +#   $ ./msys2-x86_64-20241116 --default-answer --root 'C:\msys64' install
  586. +#   - The following MSYS2 packages should be installed for running the tests with MSYS2:
  587. +#   (install with $ pacman -S --noconfirm ${name_of_package} # (use space to separate package names)
  588. +#   ---- snip ----
  589. +#   base-devel
  590. +#   gcc
  591. +#   clang
  592. +#   sed
  593. +#   time
  594. +#   coreutils
  595. +#   util-linux
  596. +#   grep
  597. +#   sed
  598. +#   emacs
  599. +#   gdb
  600. +#   make
  601. +#   gettext
  602. +#   gettext-devel
  603. +#   git
  604. +#   subversion
  605. +#   flex
  606. +#   bison
  607. +#   unzip
  608. +#   pax
  609. +#   tar
  610. +#   libiconv-devel
  611. +#   ncurses-devel
  612. +#   gmp-devel
  613. +#   mpfr-devel
  614. +#   mpc-devel
  615. +#   isl-devel
  616. +#   procps-ng
  617. +#   libiconv-devel
  618. +#   ---- snip ----
  619. +#
  620.  # - Benchmarking/profiling should be done with the realtime virus checker
  621.  #   disabled, e.g. disable it like this from an "Adminstrator" terminal:
  622.  #   $ powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1' #
  623. --
  624. 2.45.1
  625.  
  626. From a1d0ceb97ad59c75429fd09d02f9ba65941f80b2 Mon Sep 17 00:00:00 2001
  627. From: Roland Mainz <roland.mainz@nrubsig.org>
  628. Date: Mon, 25 Nov 2024 19:21:47 +0100
  629. Subject: [PATCH 8/8] tests: Add MSYS2 support to nfsbuildtest bash build
  630.  
  631. tests: Add MSYS2 support to nfsbuildtest.ksh93
  632.  
  633. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  634. ---
  635. tests/nfsbuildtest/nfsbuildtest.ksh93 | 157 +++++++++++++++++---------
  636.  1 file changed, 101 insertions(+), 56 deletions(-)
  637.  
  638. diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
  639. index 4823005..ecda2cd 100644
  640. --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
  641. +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
  642. @@ -117,7 +117,7 @@ function gcc_build
  643.         # patch sources and configure build
  644.         #
  645.  
  646. -       # Cygwin: workaround for configure using cp -p where ln -s should be used
  647. +       # Cygwin/MSYS2: workaround for configure using cp -p where ln -s should be used
  648.         # (this is an automake/autoconf issue, they should trust Cygwin and not use
  649.         # ancient workarounds for issues which no longer exists)
  650.         (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name 'configure') )
  651. @@ -285,8 +285,8 @@ function bash_build
  652.         # disable loadable plugins
  653.         sed -i -E 's/-\( cd \$\(LOADABLES_DIR\) && \$\(MAKE\) \$\(MFLAGS\) DESTDIR=\$\(DESTDIR\) \$@ \)//' Makefile.in
  654.  
  655. -       # Cygwin: workaround for configure using cp -p where ln -s should be used
  656. -       # (this is an automake/autoconf issue, they should trust Cygwin and not use
  657. +       # Cygwin/MSYS2: workaround for configure using cp -p where ln -s should be used
  658. +       # (this is an automake/autoconf issue, they should trust Cygwin/MSYS2 and not use
  659.         # ancient workarounds for issues which no longer exists)
  660.         (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name 'configure') )
  661.  
  662. @@ -329,10 +329,18 @@ function bash_build
  663.         #
  664.         # build bash
  665.         #
  666. -       if (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
  667. -               time ksh93 -c 'export SHELL=/bin/ksh93 ; bmake -j8 install DESTDIR=$PWD/install_root'
  668. +       if $config_use_posix_ksh93_builtins ; then
  669. +               if is_cygwin && (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
  670. +                       time ksh93 -c 'export SHELL=/bin/ksh93 ; bmake -j8 install DESTDIR=$PWD/install_root'
  671. +               else
  672. +                       time ksh93 -c 'export SHELL=/bin/ksh93 ; make -j8 install DESTDIR=$PWD/install_root'
  673. +               fi
  674.         else
  675. -               time ksh93 -c 'export SHELL=/bin/ksh93 ; make -j8 install DESTDIR=$PWD/install_root'
  676. +               if is_cygwin && (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
  677. +                       time bash -c 'export SHELL=/bin/bash ; bmake -j8 install DESTDIR=$PWD/install_root'
  678. +               else
  679. +                       time bash -c 'export SHELL=/bin/bash ; make -j8 install DESTDIR=$PWD/install_root'
  680. +               fi
  681.         fi
  682.         echo $?
  683.  
  684. @@ -464,7 +472,7 @@ function msnfs41client_clean
  685.  function get_cpv_cygwin_version
  686.  {
  687.         nameref c_vers=$1
  688. -       typeset uname_r="${ uname -r ; }"
  689. +       typeset uname_r="${ /usr/bin/uname -r ; }"
  690.         typeset leftover
  691.  
  692.         leftover="${uname_r/~(Elr)([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-([[:digit:]]+)\..+/x}"
  693. @@ -483,21 +491,50 @@ function get_cpv_cygwin_version
  694.         return 0
  695.  }
  696.  
  697. +function is_cygwin
  698. +{
  699. +       if [[ "$(/usr/bin/uname -s)" == ~(El)CYGWIN_NT ]] ; then
  700. +               return 0
  701. +       fi
  702. +
  703. +       return 1
  704. +}
  705. +
  706. +function is_mingw64
  707. +{
  708. +       if [[ "$(/usr/bin/uname -s)" == ~(El)MINGW64_NT ]] ; then
  709. +               return 0
  710. +       fi
  711. +
  712. +       return 1
  713. +}
  714.  
  715.  #
  716. -# Enumerate installed Cygwin packages and fill
  717. +# Enumerate installed toolkit packages and fill
  718.  # an associative array with the package names
  719.  #
  720. -function enumerate_cygwin_packages
  721. +function enumerate_toolkit_packages
  722.  {
  723.         nameref package_arr=$1
  724.         typeset i j
  725.  
  726. -       # cygcheck in Cygwin 3.3 does not support -n
  727. -       /usr/bin/cygcheck -c -d | while read i j ; do
  728. -               package_arr["$i"]='true'
  729. -       done
  730. -       return 0
  731. +       if is_cygwin ; then
  732. +               # cygcheck in Cygwin 3.3 does not support -n
  733. +               /usr/bin/cygcheck -c -d | while read i j ; do
  734. +                       package_arr["$i"]='true'
  735. +               done
  736. +               return 0
  737. +       elif is_mingw64 ; then
  738. +               # cygcheck in Cygwin 3.3 does not support -n
  739. +               /usr/bin/pacman -Qqn | while read i j ; do
  740. +                       package_arr["$i"]='true'
  741. +               done
  742. +               return 0
  743. +       fi
  744. +
  745. +       print -u2 -f $"%s: Unsupported toolkit.\n" "$0"
  746. +
  747. +       return 1
  748.  }
  749.  
  750.  
  751. @@ -505,12 +542,12 @@ function enumerate_cygwin_packages
  752.  # test if a Cygwin package is installed, based on
  753.  # the array of package names passed as $1
  754.  #
  755. -function is_cygwin_pkg_installed
  756. +function is_toolkit_pkg_installed
  757.  {
  758.         nameref package_arr=$1
  759.         typeset package_name="$2"
  760.         if [[ ! -v package_arr["$package_name"] ]] ; then
  761. -               print -u2 -f $"Cygwin package '%s' not installed.\n" "$package_name"
  762. +               print -u2 -f $"Toolkit package '%s' not installed.\n" "$package_name"
  763.                 return 1
  764.         fi
  765.  
  766. @@ -520,7 +557,7 @@ function is_cygwin_pkg_installed
  767.  
  768.  function main
  769.  {
  770. -       typeset -A icp # installed cygwin packages
  771. +       typeset -A itp # installed toolkit packages
  772.         integer errc=0 # error counter
  773.         typeset target="$1"
  774.         typeset subcmd="$2"
  775. @@ -528,28 +565,28 @@ function main
  776.  
  777.         get_cpv_cygwin_version cygwin_vers
  778.  
  779. -       enumerate_cygwin_packages icp
  780. +       enumerate_toolkit_packages itp
  781.  
  782.         case "${target}_${subcmd}" in
  783.                 'gcc_createcache')
  784. -                       is_cygwin_pkg_installed icp 'git' || (( errc++ ))
  785. +                       is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  786.                         gcc_createcache
  787.                         return $?
  788.                         ;;
  789.                 'gcc_build')
  790. -                       is_cygwin_pkg_installed icp 'git' || (( errc++ ))
  791. -                       is_cygwin_pkg_installed icp 'gcc-core' || (( errc++ ))
  792. -                       is_cygwin_pkg_installed icp 'gcc-g++' || (( errc++ ))
  793. -                       is_cygwin_pkg_installed icp 'make' || (( errc++ ))
  794. -                       is_cygwin_pkg_installed icp 'flex' || (( errc++ ))
  795. -                       is_cygwin_pkg_installed icp 'bison' || (( errc++ ))
  796. -                       is_cygwin_pkg_installed icp 'libgmp-devel' || (( errc++ ))
  797. -                       is_cygwin_pkg_installed icp 'libmpfr-devel' || (( errc++ ))
  798. -                       is_cygwin_pkg_installed icp 'libmpc-devel' || (( errc++ ))
  799. -                       is_cygwin_pkg_installed icp 'libintl-devel' || (( errc++ ))
  800. -                       is_cygwin_pkg_installed icp 'libisl-devel' || (( errc++ ))
  801. -                       is_cygwin_pkg_installed icp 'gettext' || (( errc++ ))
  802. -                       is_cygwin_pkg_installed icp 'gettext-devel' || (( errc++ ))
  803. +                       is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  804. +                       is_toolkit_pkg_installed itp 'gcc-core' || (( errc++ ))
  805. +                       is_toolkit_pkg_installed itp 'gcc-g++' || (( errc++ ))
  806. +                       is_toolkit_pkg_installed itp 'make' || (( errc++ ))
  807. +                       is_toolkit_pkg_installed itp 'flex' || (( errc++ ))
  808. +                       is_toolkit_pkg_installed itp 'bison' || (( errc++ ))
  809. +                       is_toolkit_pkg_installed itp 'libgmp-devel' || (( errc++ ))
  810. +                       is_toolkit_pkg_installed itp 'libmpfr-devel' || (( errc++ ))
  811. +                       is_toolkit_pkg_installed itp 'libmpc-devel' || (( errc++ ))
  812. +                       is_toolkit_pkg_installed itp 'libintl-devel' || (( errc++ ))
  813. +                       is_toolkit_pkg_installed itp 'libisl-devel' || (( errc++ ))
  814. +                       is_toolkit_pkg_installed itp 'gettext' || (( errc++ ))
  815. +                       is_toolkit_pkg_installed itp 'gettext-devel' || (( errc++ ))
  816.                         (( errc > 0 )) && return 1
  817.                         gcc_build
  818.                         return $?
  819. @@ -559,25 +596,31 @@ function main
  820.                         return $?
  821.                         ;;
  822.                 'bash_createcache')
  823. -                       is_cygwin_pkg_installed icp 'git' || (( errc++ ))
  824. +                       is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  825.                         bash_createcache
  826.                         return $?
  827.                         ;;
  828.                 'bash_build')
  829. -                       is_cygwin_pkg_installed icp 'git' || (( errc++ ))
  830. -                       is_cygwin_pkg_installed icp 'gcc-core' || (( errc++ ))
  831. -                       is_cygwin_pkg_installed icp 'gcc-g++' || (( errc++ ))
  832. -                       if (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
  833. -                               print '# bash_build: Using Cygwin >= 3.5 config'
  834. -                               # Only Cygwin >= 3.5 has /usr/bin/bmake
  835. -                               is_cygwin_pkg_installed icp 'bmake' || (( errc++ ))
  836. +                       is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  837. +                       is_toolkit_pkg_installed itp 'gcc-core' || (( errc++ ))
  838. +                       is_toolkit_pkg_installed itp 'gcc-g++' || (( errc++ ))
  839. +                       if is_cygwin ; then
  840. +                               if (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
  841. +                                       print '# bash_build: Using Cygwin >= 3.5 config'
  842. +                                       # Only Cygwin >= 3.5 has /usr/bin/bmake
  843. +                                       is_toolkit_pkg_installed itp 'bmake' || (( errc++ ))
  844. +                               else
  845. +                                       print '# bash_build: Using Cygwin < 3.5 config'
  846. +                                       is_toolkit_pkg_installed itp 'make' || (( errc++ ))
  847. +                               fi
  848. +                       elif is_mingw64 ; then
  849. +                               is_toolkit_pkg_installed itp 'make' || (( errc++ ))
  850.                         else
  851. -                               print '# bash_build: Using Cygwin < 3.5 config'
  852. -                               is_cygwin_pkg_installed icp 'make' || (( errc++ ))
  853. +                               print '# bash_build: unsupported toolkit'
  854.                         fi
  855. -                       is_cygwin_pkg_installed icp 'libncurses-devel' || (( errc++ ))
  856. -                       is_cygwin_pkg_installed icp 'gettext' || (( errc++ ))
  857. -                       is_cygwin_pkg_installed icp 'gettext-devel' || (( errc++ ))
  858. +                       is_toolkit_pkg_installed itp 'libncurses-devel' || (( errc++ ))
  859. +                       is_toolkit_pkg_installed itp 'gettext' || (( errc++ ))
  860. +                       is_toolkit_pkg_installed itp 'gettext-devel' || (( errc++ ))
  861.                         (( errc > 0 )) && return 1
  862.                         bash_build
  863.                         return $?
  864. @@ -587,20 +630,20 @@ function main
  865.                         return $?
  866.                         ;;
  867.                 'msnfs41client_createcache')
  868. -                       is_cygwin_pkg_installed icp 'git' || (( errc++ ))
  869. +                       is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  870.                         msnfs41client_createcache
  871.                         return $?
  872.                         ;;
  873.                 'msnfs41client_build')
  874. -                       is_cygwin_pkg_installed icp 'git' || (( errc++ ))
  875. -                       is_cygwin_pkg_installed icp 'gcc-core' || (( errc++ ))
  876. -                       is_cygwin_pkg_installed icp 'gcc-g++' || (( errc++ ))
  877. -                       is_cygwin_pkg_installed icp 'mingw64-i686-clang' || (( errc++ ))
  878. -                       is_cygwin_pkg_installed icp 'mingw64-x86_64-clang' || (( errc++ ))
  879. -                       is_cygwin_pkg_installed icp 'make' || (( errc++ ))
  880. -                       is_cygwin_pkg_installed icp 'tar' || (( errc++ ))
  881. -                       is_cygwin_pkg_installed icp 'bzip2' || (( errc++ ))
  882. -                       is_cygwin_pkg_installed icp 'openssl' || (( errc++ ))
  883. +                       is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  884. +                       is_toolkit_pkg_installed itp 'gcc-core' || (( errc++ ))
  885. +                       is_toolkit_pkg_installed itp 'gcc-g++' || (( errc++ ))
  886. +                       is_toolkit_pkg_installed itp 'mingw64-i686-clang' || (( errc++ ))
  887. +                       is_toolkit_pkg_installed itp 'mingw64-x86_64-clang' || (( errc++ ))
  888. +                       is_toolkit_pkg_installed itp 'make' || (( errc++ ))
  889. +                       is_toolkit_pkg_installed itp 'tar' || (( errc++ ))
  890. +                       is_toolkit_pkg_installed itp 'bzip2' || (( errc++ ))
  891. +                       is_toolkit_pkg_installed itp 'openssl' || (( errc++ ))
  892.                         (( errc > 0 )) && return 1
  893.                         msnfs41client_build
  894.                         return $?
  895. @@ -626,7 +669,9 @@ function main
  896.  #
  897.  builtin id
  898.  builtin mkdir
  899. -builtin uname
  900. +# builtin uname - for now (until we have a native MSYS2 ksh93) we
  901. +# should not use the builtin uname here, because it will store the
  902. +# toolkit name (Cygwin, MSYS2, ...) at libast built time
  903.  
  904.  main "$@"
  905.  return $?
  906. --
  907. 2.45.1

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at