pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: QueryFileInformation fixes+improvements, cleanup+misc, 2024-08-26
Posted by Anonymous on Mon 26th Aug 2024 17:03
raw | new post

  1. From 1770bd7ecf2b44c84b2bd60af11212ec4b049591 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Mon, 26 Aug 2024 14:59:55 +0200
  4. Subject: [PATCH 1/6] tests: nfsbuildtest should call GNU make with
  5.  --load-average 32
  6.  
  7. nfsbuildtest should call GNU make with --load-average 32, because
  8. the Cygwin load average does not work in Cygwin 3.6-devel
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. tests/nfsbuildtest/nfsbuildtest.ksh93 | 2 +-
  13.  1 file changed, 1 insertion(+), 1 deletion(-)
  14.  
  15. diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
  16. index e7b7003..4ea102b 100644
  17. --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
  18. +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
  19. @@ -155,7 +155,7 @@ function gcc_build
  20.         #
  21.         # build gcc
  22.         #
  23. -       time ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make -j8 all)'
  24. +       time ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make --load-average 32 -j8 all)'
  25.         echo $?
  26.  
  27.         echo "#Done."
  28. --
  29. 2.45.1
  30.  
  31. From a7dea1983cf8f600c30829bcd4d520dae14b0c4d Mon Sep 17 00:00:00 2001
  32. From: Roland Mainz <roland.mainz@nrubsig.org>
  33. Date: Mon, 26 Aug 2024 15:16:58 +0200
  34. Subject: [PATCH 2/6] sys: Fix "Unhandled/unsupported InfoClass(6)",
  35.  FileInternalInformation is implemented
  36.  
  37. Fix bogus "Unhandled/unsupported InfoClass(6)" debug message,
  38. |FileInternalInformation| is implemented.
  39.  
  40. Reported-by: Josh Hurst <joshhurst@gmail.com>
  41. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  42. ---
  43. sys/nfs41_driver.c | 1 +
  44.  1 file changed, 1 insertion(+)
  45.  
  46. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  47. index 2550321..d01c181 100644
  48. --- a/sys/nfs41_driver.c
  49. +++ b/sys/nfs41_driver.c
  50. @@ -6084,6 +6084,7 @@ static NTSTATUS nfs41_QueryFileInformation(
  51.  #endif
  52.              break;
  53.          case FileNetworkOpenInformation:
  54. +        case FileInternalInformation:
  55.              break;
  56.          default:
  57.              print_error("Unhandled/unsupported InfoClass(%d)\n", (int)InfoClass);
  58. --
  59. 2.45.1
  60.  
  61. From 56c582f3c2bad6909234185bde552b0ac361b276 Mon Sep 17 00:00:00 2001
  62. From: Roland Mainz <roland.mainz@nrubsig.org>
  63. Date: Mon, 26 Aug 2024 15:25:26 +0200
  64. Subject: [PATCH 3/6] sys: Fix "Unhandled/unsupported InfoClass(35)",
  65.  FileAttributeTagInformation is implemented
  66.  
  67. Fix bogus "Unhandled/unsupported InfoClass(35)" debug message,
  68. |FileAttributeTagInformation| is implemented.
  69.  
  70. Reported-by: Josh Hurst <joshhurst@gmail.com>
  71. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  72. ---
  73. sys/nfs41_driver.c | 1 +
  74.  1 file changed, 1 insertion(+)
  75.  
  76. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  77. index d01c181..7e0cd56 100644
  78. --- a/sys/nfs41_driver.c
  79. +++ b/sys/nfs41_driver.c
  80. @@ -6085,6 +6085,7 @@ static NTSTATUS nfs41_QueryFileInformation(
  81.              break;
  82.          case FileNetworkOpenInformation:
  83.          case FileInternalInformation:
  84. +        case FileAttributeTagInformation:
  85.              break;
  86.          default:
  87.              print_error("Unhandled/unsupported InfoClass(%d)\n", (int)InfoClass);
  88. --
  89. 2.45.1
  90.  
  91. From 578aec22bb14d4f2f4768152b0ffcacb578613fd Mon Sep 17 00:00:00 2001
  92. From: Roland Mainz <roland.mainz@nrubsig.org>
  93. Date: Mon, 26 Aug 2024 15:42:03 +0200
  94. Subject: [PATCH 4/6] build.vc19,daemon,include: Move "from_kernel.h" to
  95.  include/
  96.  
  97. Move "daemon/from_kernel.h" to "include/from_kernel.h", as it
  98. is a shared include file.
  99.  
  100. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  101. ---
  102. build.vc19/nfsd/nfsd.vcxproj         | 2 +-
  103.  build.vc19/nfsd/nfsd.vcxproj.filters | 2 +-
  104.  {daemon => include}/from_kernel.h    | 0
  105.  3 files changed, 2 insertions(+), 2 deletions(-)
  106.  rename {daemon => include}/from_kernel.h (100%)
  107.  
  108. diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
  109. index 1823a19..9ff8e20 100644
  110. --- a/build.vc19/nfsd/nfsd.vcxproj
  111. +++ b/build.vc19/nfsd/nfsd.vcxproj
  112. @@ -218,7 +218,6 @@
  113.      <ClInclude Include="..\..\daemon\cpvparser1.h" />
  114.      <ClInclude Include="..\..\daemon\daemon_debug.h" />
  115.      <ClInclude Include="..\..\daemon\delegation.h" />
  116. -    <ClInclude Include="..\..\daemon\from_kernel.h" />
  117.      <ClInclude Include="..\..\daemon\idmap.h" />
  118.      <ClInclude Include="..\..\daemon\list.h" />
  119.      <ClInclude Include="..\..\daemon\name_cache.h" />
  120. @@ -236,6 +235,7 @@
  121.      <ClInclude Include="..\..\daemon\tree.h" />
  122.      <ClInclude Include="..\..\daemon\upcall.h" />
  123.      <ClInclude Include="..\..\daemon\util.h" />
  124. +    <ClInclude Include="..\..\include\from_kernel.h" />
  125.      <ClInclude Include="..\..\include\nfs_ea.h" />
  126.    </ItemGroup>
  127.    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  128. diff --git a/build.vc19/nfsd/nfsd.vcxproj.filters b/build.vc19/nfsd/nfsd.vcxproj.filters
  129. index f4d1980..8d3c85a 100644
  130. --- a/build.vc19/nfsd/nfsd.vcxproj.filters
  131. +++ b/build.vc19/nfsd/nfsd.vcxproj.filters
  132. @@ -143,7 +143,7 @@
  133.      <ClInclude Include="..\..\daemon\delegation.h">
  134.        <Filter>Header Files</Filter>
  135.      </ClInclude>
  136. -    <ClInclude Include="..\..\daemon\from_kernel.h">
  137. +    <ClInclude Include="..\..\include\from_kernel.h">
  138.        <Filter>Header Files</Filter>
  139.      </ClInclude>
  140.      <ClInclude Include="..\..\daemon\idmap.h">
  141. diff --git a/daemon/from_kernel.h b/include/from_kernel.h
  142. similarity index 100%
  143. rename from daemon/from_kernel.h
  144. rename to include/from_kernel.h
  145. --
  146. 2.45.1
  147.  
  148. From a6ef9d1a3539ecd6af4fbfed4bdfd8386dc58ced Mon Sep 17 00:00:00 2001
  149. From: Roland Mainz <roland.mainz@nrubsig.org>
  150. Date: Mon, 26 Aug 2024 16:43:24 +0200
  151. Subject: [PATCH 5/6] sys: Implement QueryFileInformation
  152.  |FileRemoteProtocolInformation|
  153.  
  154. Implement QueryFileInformation |FileRemoteProtocolInformation|.
  155.  
  156. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  157. ---
  158. sys/nfs41_driver.c | 23 +++++++++++++++++++++++
  159.  1 file changed, 23 insertions(+)
  160.  
  161. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  162. index 7e0cd56..a091f36 100644
  163. --- a/sys/nfs41_driver.c
  164. +++ b/sys/nfs41_driver.c
  165. @@ -5990,6 +5990,29 @@ static NTSTATUS nfs41_QueryFileInformation(
  166.          status = STATUS_SUCCESS;
  167.          goto out;
  168.      }
  169. +    case FileRemoteProtocolInformation:
  170. +    {
  171. +        PFILE_REMOTE_PROTOCOL_INFORMATION info =
  172. +            (PFILE_REMOTE_PROTOCOL_INFORMATION)RxContext->Info.Buffer;
  173. +
  174. +        (void)RtlZeroMemory(info,
  175. +            sizeof(FILE_REMOTE_PROTOCOL_INFORMATION));
  176. +        info->StructureVersion = 1;
  177. +        info->StructureSize = sizeof(FILE_REMOTE_PROTOCOL_INFORMATION);
  178. +        info->Protocol = WNNC_NET_RDR2SAMPLE; /* FIXME! */
  179. +        /*
  180. +         * ToDo: If we add NFSv4.1/NFSv4.2 protocol negotiation, then
  181. +         * we need to call the userland daemon to return the correct
  182. +         * protocol minor version
  183. +         */
  184. +        info->ProtocolMajorVersion = 4;
  185. +        info->ProtocolMinorVersion = 1;
  186. +        info->ProtocolRevision = 0;
  187. +        RxContext->Info.LengthRemaining -=
  188. +            sizeof(FILE_REMOTE_PROTOCOL_INFORMATION);
  189. +        status = STATUS_SUCCESS;
  190. +        goto out;
  191. +    }
  192.      case FileBasicInformation:
  193.      case FileStandardInformation:
  194.      case FileInternalInformation:
  195. --
  196. 2.45.1
  197.  
  198. From f37daa791d773fc55208385227f4df84784aa13b Mon Sep 17 00:00:00 2001
  199. From: Roland Mainz <roland.mainz@nrubsig.org>
  200. Date: Mon, 26 Aug 2024 17:02:50 +0200
  201. Subject: [PATCH 6/6] sys: buffer checks for QueryFileInformation
  202.  |FileEaInformation|,|FileRemoteProtocolInformation|
  203.  
  204. Add buffer size checks for QueryFileInformation |FileEaInformation|
  205. and |FileRemoteProtocolInformation|.
  206.  
  207. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  208. ---
  209. sys/nfs41_driver.c | 16 ++++++++++++++++
  210.  1 file changed, 16 insertions(+)
  211.  
  212. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  213. index a091f36..ee958d5 100644
  214. --- a/sys/nfs41_driver.c
  215. +++ b/sys/nfs41_driver.c
  216. @@ -5983,6 +5983,14 @@ static NTSTATUS nfs41_QueryFileInformation(
  217.      switch (InfoClass) {
  218.      case FileEaInformation:
  219.      {
  220. +        if (RxContext->Info.LengthRemaining <
  221. +            sizeof(FILE_EA_INFORMATION)) {
  222. +            print_error("nfs41_QueryFileInformation: "
  223. +                "FILE_EA_INFORMATION buffer too small\n");
  224. +            status = STATUS_BUFFER_TOO_SMALL;
  225. +            goto out;
  226. +        }
  227. +
  228.          PFILE_EA_INFORMATION info =
  229.              (PFILE_EA_INFORMATION)RxContext->Info.Buffer;
  230.          info->EaSize = 0;
  231. @@ -5992,6 +6000,14 @@ static NTSTATUS nfs41_QueryFileInformation(
  232.      }
  233.      case FileRemoteProtocolInformation:
  234.      {
  235. +        if (RxContext->Info.LengthRemaining <
  236. +            sizeof(FILE_REMOTE_PROTOCOL_INFORMATION)) {
  237. +            print_error("nfs41_QueryFileInformation: "
  238. +                "FILE_REMOTE_PROTOCOL_INFORMATION buffer too small\n");
  239. +            status = STATUS_BUFFER_TOO_SMALL;
  240. +            goto out;
  241. +        }
  242. +
  243.          PFILE_REMOTE_PROTOCOL_INFORMATION info =
  244.              (PFILE_REMOTE_PROTOCOL_INFORMATION)RxContext->Info.Buffer;
  245.  
  246. --
  247. 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