pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Misc patches for 2023-09-30
Posted by Anonymous on Sat 30th Sep 2023 14:48
raw | new post

  1. From 3f5105fb38c206282060ccf0ff50ca41b8e0935c Mon Sep 17 00:00:00 2001
  2. From: Cedric Blancher <cedric.blancher@gmail.com>
  3. Date: Sat, 30 Sep 2023 14:46:58 +0200
  4. Subject: [PATCH 1/5] nfsd: Fix typo with pointer deref
  5.  
  6. nfsd: Fix typo in pointer derefencing in daemon/readdir.c
  7.  
  8. Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  9. ---
  10. daemon/readdir.c | 2 +-
  11.  1 file changed, 1 insertion(+), 1 deletion(-)
  12.  
  13. diff --git a/daemon/readdir.c b/daemon/readdir.c
  14. index 85af2c9..61e6fd7 100644
  15. --- a/daemon/readdir.c
  16. +++ b/daemon/readdir.c
  17. @@ -165,7 +165,7 @@ static void readdir_copy_shortname(
  18.      /* GetShortPathName returns number of characters, not including \0 */
  19.      *name_size_out = (CCHAR)GetShortPathNameW(name, name_out, 12);
  20.      if (*name_size_out) {
  21. -        *name_size_out++;
  22. +        (*name_size_out)++;
  23.          *name_size_out *= sizeof(WCHAR);
  24.      }
  25.  }
  26. --
  27. 2.39.0
  28.  
  29. From a0db5bfd14a89b897fdc5ff7daea59844385e729 Mon Sep 17 00:00:00 2001
  30. From: Roland Mainz <roland.mainz@nrubsig.org>
  31. Date: Sat, 30 Sep 2023 14:50:48 +0200
  32. Subject: [PATCH 2/5] libtirpc: Fix warning about SOL_IPV6 redefine
  33.  
  34. libtirpc: Fix warning about SOL_IPV6 redefine. The question is
  35. whether the original |#define SOL_IPV6 IPPROTO_IPV6| was ever correct.
  36. |IPPROTO_IPV6| is defined as |IPPROTO_IPV6 = 41|,
  37. but |SOL_IPV6| in WinDDK is defined as |SOL_IPV6 = (SOL_SOCKET-5)|,
  38. where |SOL_SOCKET = 0xffff|, |SOL_IPV6 == so 0xffff-5|, which is
  39. clearly not |41|.
  40.  
  41. But this works:
  42. $ nfs_mount.exe -o sec=sys,port=2049 Z '[fe80::219:99ff:feae:73ce]:/export/home/rmainz'
  43.  
  44. But... why ?
  45. But in any case the upcoming libtirpc update will just stomp over
  46. the problem, and in the meantime the patch switches the definition
  47. of |SOL_IPV6| to the official DDK value.
  48.  
  49. Reviewed-by: Cedric Blancher <cedric.blancher@gmail.com>
  50. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  51. ---
  52. libtirpc/tirpc/wintirpc.h | 2 ++
  53.  1 file changed, 2 insertions(+)
  54.  
  55. diff --git a/libtirpc/tirpc/wintirpc.h b/libtirpc/tirpc/wintirpc.h
  56. index 2789e0a..cb5ec4b 100644
  57. --- a/libtirpc/tirpc/wintirpc.h
  58. +++ b/libtirpc/tirpc/wintirpc.h
  59. @@ -81,7 +81,9 @@ struct timezone
  60.  extern int gettimeofday(struct timeval *tv, struct timezone *tz);
  61.  extern int asprintf(char **str, const char *fmt, ...);
  62.  
  63. +#if(_WIN32_WINNT < 0x0501)
  64.  #define SOL_IPV6 IPPROTO_IPV6
  65. +#endif
  66.  
  67.  #define MAXHOSTNAMELEN 256
  68.  
  69. --
  70. 2.39.0
  71.  
  72. From 2e99d9f68015b8baf7a8cf65a4d0fd7d36f0e47c Mon Sep 17 00:00:00 2001
  73. From: Roland Mainz <roland.mainz@nrubsig.org>
  74. Date: Sat, 30 Sep 2023 15:01:16 +0200
  75. Subject: [PATCH 3/5] nfs41_driver: Fix number of arguments for mount call
  76.  
  77. Fix number of arguments in mount call after we reworked
  78. custom NFS port number handling and moved them from being a seperate
  79. field to being part of the "hostname", now called being a "hostport"
  80.  
  81. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  82. ---
  83. sys/nfs41_driver.c | 2 +-
  84.  1 file changed, 1 insertion(+), 1 deletion(-)
  85.  
  86. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  87. index 07e5b27..618eee9 100644
  88. --- a/sys/nfs41_driver.c
  89. +++ b/sys/nfs41_driver.c
  90. @@ -615,7 +615,7 @@ NTSTATUS marshal_nfs41_mount(
  91.          goto out;
  92.      }
  93.      header_len = *len + length_as_utf8(entry->u.Mount.srv_name) +
  94. -        length_as_utf8(entry->u.Mount.root) + 4 * sizeof(DWORD);
  95. +        length_as_utf8(entry->u.Mount.root) + 3 * sizeof(DWORD);
  96.      if (header_len > buf_len) {
  97.          status = STATUS_INSUFFICIENT_RESOURCES;
  98.          goto out;
  99. --
  100. 2.39.0
  101.  
  102. From 5ac6ef2da45ac99ac52f306c4749fbb87bb117fa Mon Sep 17 00:00:00 2001
  103. From: Cedric Blancher <cedric.blancher@gmail.com>
  104. Date: Sat, 30 Sep 2023 15:15:17 +0200
  105. Subject: [PATCH 4/5] sys/nfs41_driver.c: Fix missing brackets in
  106.  check_nfs41_create_args()
  107.  
  108. sys/nfs41_driver.c: Fix missing brackets in check_nfs41_create_args()
  109.  
  110. Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  111. ---
  112. sys/nfs41_driver.c | 4 ++--
  113.  1 file changed, 2 insertions(+), 2 deletions(-)
  114.  
  115. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  116. index 618eee9..7a8fe7a 100644
  117. --- a/sys/nfs41_driver.c
  118. +++ b/sys/nfs41_driver.c
  119. @@ -3503,9 +3503,9 @@ NTSTATUS check_nfs41_create_args(
  120.      if (Fcb->OpenCount && params->Disposition == FILE_SUPERSEDE) {
  121.          if ((!RxContext->CurrentIrpSp->FileObject->SharedRead &&
  122.                  (params->DesiredAccess & FILE_READ_DATA)) ||
  123. -            (!RxContext->CurrentIrpSp->FileObject->SharedWrite &&
  124. +            ((!RxContext->CurrentIrpSp->FileObject->SharedWrite &&
  125.                  (params->DesiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA |
  126. -                    FILE_WRITE_ATTRIBUTES)) ||
  127. +                    FILE_WRITE_ATTRIBUTES))) ||
  128.              (!RxContext->CurrentIrpSp->FileObject->SharedDelete &&
  129.                  (params->DesiredAccess & DELETE)))) {
  130.              status = STATUS_SHARING_VIOLATION;
  131. --
  132. 2.39.0
  133.  
  134. From b8d588ba9ced0791bd84753ff1a1e3bbbf518d62 Mon Sep 17 00:00:00 2001
  135. From: Cedric Blancher <cedric.blancher@gmail.com>
  136. Date: Sat, 30 Sep 2023 15:19:39 +0200
  137. Subject: [PATCH 5/5] sys/nfs41_driver.c: Zero out some fields
  138.  
  139. sys/nfs41_driver.c: Zero out some fields in
  140. nfs41_QueryVolumeInformation() and nfs41_Lock()
  141.  
  142. Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  143. ---
  144. sys/nfs41_driver.c | 4 ++++
  145.  1 file changed, 4 insertions(+)
  146.  
  147. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  148. index 7a8fe7a..cb473f0 100644
  149. --- a/sys/nfs41_driver.c
  150. +++ b/sys/nfs41_driver.c
  151. @@ -4314,6 +4314,8 @@ NTSTATUS nfs41_QueryVolumeInformation(
  152.      status = check_nfs41_dirquery_args(RxContext);
  153.      if (status) goto out;
  154.  
  155. +    RtlZeroMemory(RxContext->Info.Buffer, RxContext->Info.LengthRemaining);
  156. +
  157.      switch (InfoClass) {
  158.      case FileFsVolumeInformation:
  159.          if ((ULONG)RxContext->Info.LengthRemaining >= DevExt->VolAttrsLen) {
  160. @@ -6086,6 +6088,8 @@ NTSTATUS nfs41_Lock(
  161.      t1 = KeQueryPerformanceCounter(NULL);
  162.  #endif
  163.  
  164. +    poll_delay.QuadPart = 0;
  165. +
  166.  #ifdef DEBUG_LOCK
  167.      DbgEn();
  168.      print_lock_args(RxContext);
  169. --
  170. 2.39.0

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