pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for nfs_ea util, install Cygwin sys/nobody+misc, 2025-04-09
Posted by Anonymous on Wed 9th Apr 2025 18:20
raw | new post

  1. From fdd1ee29166828696e26ffd45037b626188b2575 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 9 Apr 2025 17:25:04 +0200
  4. Subject: [PATCH 1/4] tests: nfs_ea: EA names are not $'\0'-terminated, we need
  5.  to use |EaNameLength|
  6.  
  7. nfs_ea: EA names are not $'\0'-terminated, we need to use |EaNameLength|
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. tests/ea/main.c | 21 ++++++++++++++++-----
  12.  1 file changed, 16 insertions(+), 5 deletions(-)
  13.  
  14. diff --git a/tests/ea/main.c b/tests/ea/main.c
  15. index d4e818f..fe6655d 100644
  16. --- a/tests/ea/main.c
  17. +++ b/tests/ea/main.c
  18. @@ -1,5 +1,6 @@
  19.  /* NFSv4.1 client for Windows
  20. - * Copyright (C) 2012 The Regents of the University of Michigan
  21. + * Copyright (C) 2012 The Regents of the University of Michigan
  22. + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
  23.   *
  24.   * Olga Kornievskaia <aglo@umich.edu>
  25.   * Casey Bodley <cbodley@umich.edu>
  26. @@ -73,7 +74,10 @@ on_overflow:
  27.      }
  28.  
  29.      while (EaBuffer) {
  30. -        printf("%s = %.*s\n", EaBuffer->EaName, EaBuffer->EaValueLength,
  31. +        (void)printf("'%.*s' = '%.*s'\n",
  32. +            EaBuffer->EaNameLength,
  33. +            EaBuffer->EaName,
  34. +            EaBuffer->EaValueLength,
  35.              EaBuffer->EaName + EaBuffer->EaNameLength + 1);
  36.  
  37.          if (EaBuffer->NextEntryOffset == 0)
  38. @@ -148,9 +152,13 @@ static NTSTATUS ea_get(
  39.      }
  40.  
  41.      while (EaBuffer) {
  42. -        printf("%s = %.*s\n", EaBuffer->EaName, EaBuffer->EaValueLength,
  43. +        (void)printf("'%.*s' = '%.*s'\n",
  44. +            EaBuffer->EaNameLength,
  45. +            EaBuffer->EaName,
  46. +            EaBuffer->EaValueLength,
  47.              EaBuffer->EaName + EaBuffer->EaNameLength + 1);
  48.  
  49. +
  50.          if (EaBuffer->NextEntryOffset == 0)
  51.              break;
  52.          EaBuffer = (PFILE_FULL_EA_INFORMATION)
  53. @@ -197,7 +205,7 @@ static NTSTATUS ea_get_nfs3attr(
  54.          goto out;
  55.      }
  56.  
  57. -    (void)printf("%s:\n", EaBuffer->EaName);
  58. +    (void)printf("%.*s:\n", EaBuffer->EaNameLength, EaBuffer->EaName);
  59.      nfs3_attrs *n3a = (void *)(EaBuffer->EaName + EaBuffer->EaNameLength + 1);
  60.      (void)printf("(\n"
  61.          "\ttype=%d\n"
  62. @@ -289,7 +297,10 @@ static NTSTATUS ea_set(
  63.      status = ZwSetEaFile(FileHandle, &IoStatusBlock, EaBuffer, EaLength);
  64.      switch (status) {
  65.      case STATUS_SUCCESS:
  66. -        printf("%s = %.*s\n", EaBuffer->EaName, EaBuffer->EaValueLength,
  67. +        (void)printf("'%.*s' = '%.*s'\n",
  68. +            EaBuffer->EaNameLength,
  69. +            EaBuffer->EaName,
  70. +            EaBuffer->EaValueLength,
  71.              EaBuffer->EaName + EaBuffer->EaNameLength + 1);
  72.          break;
  73.      default:
  74. --
  75. 2.45.1
  76.  
  77. From 8fabb9e6b521a7ce4645c5c88ae59a7936f4842e Mon Sep 17 00:00:00 2001
  78. From: Roland Mainz <roland.mainz@nrubsig.org>
  79. Date: Wed, 9 Apr 2025 17:34:52 +0200
  80. Subject: [PATCH 2/4] tests: nfs_ea: Add Cygwin usage example
  81.  
  82. nfs_ea: Add Cygwin usage example
  83.  
  84. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  85. ---
  86. tests/ea/main.c | 3 ++-
  87.  1 file changed, 2 insertions(+), 1 deletion(-)
  88.  
  89. diff --git a/tests/ea/main.c b/tests/ea/main.c
  90. index fe6655d..fb99e36 100644
  91. --- a/tests/ea/main.c
  92. +++ b/tests/ea/main.c
  93. @@ -330,8 +330,9 @@ int wmain(int argc, const wchar_t *argv[])
  94.  
  95.      if (argc < 3) {
  96.          fwprintf(stderr, L"Usage: nfs_ea <ntobjectpath> <create|set|get|getnfs3attr|list> ...\n");
  97. -        fwprintf(stderr, L"Example:\n");
  98. +        fwprintf(stderr, L"Examples:\n");
  99.          fwprintf(stderr, L"\tnfs_ea '\\??\\L:\\builds\\bash_build1' getnfs3attr\n");
  100. +        fwprintf(stderr, L"\tnfs_ea \"\\\\??\\\\$(cygpath -w \"$PWD/bash_build1\")\" getnfs3attr\n");
  101.          status = STATUS_INVALID_PARAMETER;
  102.          goto out;
  103.      }
  104. --
  105. 2.45.1
  106.  
  107. From 776becd75360e6e02a994f0e4b59fc9aebcf5c43 Mon Sep 17 00:00:00 2001
  108. From: Roland Mainz <roland.mainz@nrubsig.org>
  109. Date: Wed, 9 Apr 2025 17:40:06 +0200
  110. Subject: [PATCH 3/4] tests: Fix typo in nfs_server_setup, /etc/groups should
  111.  be /etc/group
  112.  
  113. Fix typo in nfs_server_setup, /etc/groups should be /etc/group.
  114.  
  115. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  116. ---
  117. tests/nfs_server_setup.txt | 4 ++--
  118.  1 file changed, 2 insertions(+), 2 deletions(-)
  119.  
  120. diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
  121. index df90d3d..83c2ff6 100644
  122. --- a/tests/nfs_server_setup.txt
  123. +++ b/tests/nfs_server_setup.txt
  124. @@ -76,8 +76,8 @@ zfs set sync=disabled rpool
  125.  
  126.  ##### 2. Windows ms-nfs41-client setup:
  127.  # Add entries for groups "sys" and "nobody" used by Solaris nfsd
  128. -printf "sys:S-1-0-3:3:\n" >>/etc/groups
  129. -printf "nobody:S-1-0-65534:65534:\n" >>/etc/group
  130. +printf "sys:S-1-0-3:3:\n" >>'/etc/group'
  131. +printf "nobody:S-1-0-65534:65534:\n" >>'/etc/group'
  132.  
  133.  ##### 3. Misc commands:
  134.  ls -v filename # list ACLs
  135. --
  136. 2.45.1
  137.  
  138. From 17c3383c1c7f562133b3b5658e1ba84037030771 Mon Sep 17 00:00:00 2001
  139. From: Roland Mainz <roland.mainz@nrubsig.org>
  140. Date: Wed, 9 Apr 2025 19:01:05 +0200
  141. Subject: [PATCH 4/4] cygwin: msnfs41client.bash should create "sys"+"nobody"
  142.  /etc/group entries
  143.  
  144. msnfs41client.bash should create "sys"+"nobody" /etc/group entries
  145. required by Solaris/Illumos nfsd if they do not exist yet.
  146.  
  147. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  148. ---
  149. cygwin/devel/msnfs41client.bash | 17 +++++++++++++++++
  150.  1 file changed, 17 insertions(+)
  151.  
  152. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  153. index 4a391dd..004a11e 100755
  154. --- a/cygwin/devel/msnfs41client.bash
  155. +++ b/cygwin/devel/msnfs41client.bash
  156. @@ -281,6 +281,23 @@ function nfsclient_install
  157.         # query new 'ms-nfs41-client-globalmountall-service'
  158.         sc query 'ms-nfs41-client-globalmountall-service'
  159.  
  160. +       #
  161. +       # Add entries for groups "sys" and "nobody" used by
  162. +       # Solaris/Illumos nfsd
  163. +       #
  164. +       if { getent group 'sys' >'/dev/null' 2>&1 ; (( $? == 2 )) ; } ; then
  165. +               {
  166. +                       printf '# "sys" entry added by ms-nfs41-client for Solaris/Illumos nfsd\n'
  167. +                       printf "sys:S-1-0-3:3:\n"
  168. +               } >>'/etc/group'
  169. +       fi
  170. +       if { getent group 'nobody' >'/dev/null' 2>&1 ; (( $? == 2 )) ; } ; then
  171. +               {
  172. +                       printf '# "nobody" entry added by ms-nfs41-client for Solaris/Illumos nfsd\n'
  173. +                       printf "nobody:S-1-0-65534:65534:\n"
  174. +               } >>'/etc/group'
  175. +       fi
  176. +
  177.         #
  178.         # check whether ksh93 works
  179.         # (The ms-nfs41-client cygwin idmapper uses ksh93 scripts for
  180. --
  181. 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