pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for Illumos NFSv4.1 server testing, FileCreationMode=0755+misc, 2025-03-15
Posted by Anonymous on Sat 15th Mar 2025 16:50
raw | new post

  1. From 28e6de1c2feef0abd4a7ee768695509e10e1f5c4 Mon Sep 17 00:00:00 2001
  2. From: Cedric Blancher <cedric.blancher@gmail.com>
  3. Date: Sat, 15 Mar 2025 16:36:22 +0100
  4. Subject: [PATCH 1/3] daemon: NFSv4.x minor version autonegotiation should stop
  5.  at minor version 1
  6.  
  7. NFSv4.x minor version autonegotiation should stop at minor version 1
  8. (i.e. try NFSv4.2, NFSv4.1, but NOT NFSv4.0).
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. daemon/namespace.c | 2 +-
  13.  1 file changed, 1 insertion(+), 1 deletion(-)
  14.  
  15. diff --git a/daemon/namespace.c b/daemon/namespace.c
  16. index 25cb94f..b5363eb 100644
  17. --- a/daemon/namespace.c
  18. +++ b/daemon/namespace.c
  19. @@ -423,7 +423,7 @@ retry_nfs41_exchange_id:
  20.      if (status) {
  21.          if (status == NFS4ERR_MINOR_VERS_MISMATCH) {
  22.              if (nfsminorvers_autonegotiate &&
  23. -                (root->nfsminorvers >= 1)) {
  24. +                (root->nfsminorvers > 1)) {
  25.                  root->nfsminorvers--;
  26.                  goto retry_nfs41_exchange_id;
  27.              }
  28. --
  29. 2.45.1
  30.  
  31. From 13a0d2d865f3d32ec1d8f0d7ba2fc325f8597625 Mon Sep 17 00:00:00 2001
  32. From: Cedric Blancher <cedric.blancher@gmail.com>
  33. Date: Sat, 15 Mar 2025 16:48:14 +0100
  34. Subject: [PATCH 2/3] tests: Add Illumos NFSv4.1 server setup
  35.  
  36. Add Illumos NFSv4.1 server setup.
  37.  
  38. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  39. ---
  40. tests/nfs_server_setup.txt | 37 +++++++++++++++++++++++++++++++++++++
  41.  1 file changed, 37 insertions(+)
  42.  
  43. diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
  44. index 4d81277..a4ff027 100644
  45. --- a/tests/nfs_server_setup.txt
  46. +++ b/tests/nfs_server_setup.txt
  47. @@ -75,4 +75,41 @@ chmod A... # to edit ACLs
  48.  See https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/manage-nfs/troubleshooting-network-file-systems1.html
  49.  
  50.  
  51. +#
  52. +# Illumos NFSv4.1 server setup
  53. +# (similar to Solaris 11)
  54. +#
  55. +
  56. +##### 1. Server setup
  57. +# enable ntp server "10.49.0.5"
  58. +printf "server 10.49.0.5\n" >/etc/inet/ntp.conf
  59. +svcadm enable ntp
  60. +svcadm restart ntp
  61. +
  62. +# configure&start NFS server
  63. +svcadm enable network/nfs/server
  64. +sharectl set -p nfsmapid_domain=global.loc nfs
  65. +sharectl set -p server_delegation=on nfs
  66. +sharectl set -p server_versmax=4.1 nfs
  67. +mkdir /nfsdata
  68. +chmod a+rwx /nfsdata
  69. +share -F nfs -o rw /nfsdata/
  70. +svcs svc:/network/nfs/server:default
  71. +
  72. +# performance: disable sync/ZIL on ZFS pool which exports NFS files
  73. +zfs set sync=disabled rpool
  74. +
  75. +##### 2. Windows ms-nfs41-client setup:
  76. +# Add entries for groups "sys" and "nobody" used by Solaris nfsd
  77. +printf "sys:S-1-0-3:3:\n" >>/etc/groups
  78. +printf "nobody:S-1-0-65534:65534:\n" >>/etc/group
  79. +
  80. +##### 3. Misc commands:
  81. +ls -v filename # list ACLs
  82. +chmod A... # to edit ACLs
  83. +
  84. +##### 4. Troubleshooting:
  85. +See https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/manage-nfs/troubleshooting-network-file-systems1.html
  86. +
  87. +
  88.  # EOF.
  89. --
  90. 2.45.1
  91.  
  92. From 88cf98351018b3d95870f877c55c8666390247e4 Mon Sep 17 00:00:00 2001
  93. From: Roland Mainz <roland.mainz@nrubsig.org>
  94. Date: Sat, 15 Mar 2025 17:32:17 +0100
  95. Subject: [PATCH 3/3] nfs41_build_features.h: Change default creation mode for
  96.  non-Cygwin/SFU files to 0755
  97.  
  98. Change default creation mode (NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE) for
  99. non-Cygwin/SFU files to 0755.
  100.  
  101. NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE should really be
  102. mode=0644, but in real life Windows installer software
  103. creates *.(exe|dll|com|sys) files without "GENERIC_EXECUTE" ACL
  104. entries, and without any |FILE_EXECUTE| set no binary (*.exe,
  105. and *.ddl dependicies) will start.
  106. Installers make it even worse by creating unpacked files with
  107. temporary names like "XXfoo.tmp", and then rename it "foo.exe",
  108. so there is no way to fix this at file creation time.
  109.  
  110. Fix is to set NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE=0755, but
  111. the side-effect is that all new files created by cmd.exe or powershell
  112. will have the +x mode bit set, too.
  113.  
  114. Reported-by: Lionel Cons <lionelcons1972@gmail.com>
  115. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  116. ---
  117. nfs41_build_features.h | 14 ++++++++++++--
  118.  1 file changed, 12 insertions(+), 2 deletions(-)
  119.  
  120. diff --git a/nfs41_build_features.h b/nfs41_build_features.h
  121. index d2fd138..0024d58 100644
  122. --- a/nfs41_build_features.h
  123. +++ b/nfs41_build_features.h
  124. @@ -127,10 +127,20 @@
  125.  /*
  126.   * Default POSIX permission mode bits for new files
  127.   * and directories.
  128. - * Can be ovrriden with a "NfsV3Attributes" EA
  129. + * Notes:
  130. + * - Can be overridden with a "NfsV3Attributes" EA, which Cygwin,
  131. + * ServicesForUNIX, etc. do by default for all "NFS" filesystems.
  132. + * - NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE should really be
  133. + * mode=0644, but in real life Windows installer software
  134. + * creates *.(exe|dll|com|sys) files without "GENERIC_EXECUTE" ACL
  135. + * entries, and without any |FILE_EXECUTE| set no binary (*.exe,
  136. + * and *.ddl dependicies) will start.
  137. + * Installers make it even worse by creating unpacked files with
  138. + * temporary names like "XXfoo.tmp", and then rename it "foo.exe",
  139. + * so there is no way to fix this at file creation time.
  140.   */
  141.  #define NFS41_DRIVER_DEFAULT_DIR_CREATE_MODE (0755)
  142. -#define NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE (0644)
  143. +#define NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE (0755)
  144.  
  145.  /*
  146.   * NFS41_DRIVER_DEBUG_FS_NAME - define which filesystem name should
  147. --
  148. 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