pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patch for README+buildwarnings+misc, 2024-01-30
Posted by Anonymous on Tue 30th Jan 2024 15:11
raw | new post

  1. From a14ef98b4e9fe38e4554368bad3515f81af98765 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Tue, 30 Jan 2024 14:53:27 +0100
  4. Subject: [PATCH 1/3] bintarball: Add "Download" section to README
  5.  
  6. Add "Download" section to README and fix URL (s/alpha/testing/)
  7.  
  8. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  9. ---
  10. cygwin/README.bintarball.txt | 20 ++++++++++++--------
  11.  1 file changed, 12 insertions(+), 8 deletions(-)
  12.  
  13. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  14. index 4e65279..7241d35 100644
  15. --- a/cygwin/README.bintarball.txt
  16. +++ b/cygwin/README.bintarball.txt
  17. @@ -82,25 +82,29 @@ NFSv4.1 client and filesystem driver for Windows 10/11
  18.          util-linux
  19.          wget
  20.  
  21. -
  22.  #
  23. -# 4. Installation (as "Administrator"):
  24. +# 4. Download:
  25.  #
  26.  $ mkdir -p ~/download
  27.  $ cd ~/download
  28. -$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/alpha/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2'
  29. +$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testing/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2'
  30. +
  31. +
  32. +#
  33. +# 5. Installation (as "Administrator"):
  34. +#
  35.  $ (cd / && tar -xf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 )
  36.  $ /sbin/msnfs41client install
  37.  
  38.  
  39.  #
  40. -# 5. Deinstallation:
  41. +# 6. Deinstallation:
  42.  #
  43.  $ (set -x ; cd / && tar -tf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
  44.  
  45.  
  46.  #
  47. -# 6. Usage:
  48. +# 7. Usage:
  49.  #
  50.  
  51.  # Run the NFSv4 client daemon:
  52. @@ -135,7 +139,7 @@ $ /sbin/nfs_mount
  53.  
  54.  
  55.  #
  56. -# 7. Notes:
  57. +# 8. Notes:
  58.  #
  59.  - Idmapping (including uid/gid mapping) between NFSv4 client and
  60.    NFSv4 server works via /lib/msnfs41client/cygwin_idmapper.ksh,
  61. @@ -204,7 +208,7 @@ $ /sbin/nfs_mount
  62.  
  63.  
  64.  #
  65. -# 8. Known issues:
  66. +# 9. Known issues:
  67.  #
  68.  - The kernel driver ("nfs41_driver.sys") does not yet have a
  69.    cryptographic signature for SecureBoot - which means it will only
  70. @@ -251,7 +255,7 @@ $ /sbin/nfs_mount
  71.  
  72.  
  73.  #
  74. -# 9. Notes for troubleshooting && finding bugs/debugging:
  75. +# 10. Notes for troubleshooting && finding bugs/debugging:
  76.  #
  77.  - nfsd_debug.exe has the -d option to set a level for debug
  78.    output.
  79. --
  80. 2.43.0
  81.  
  82. From 7a8dcccf973518dc012813b91921f7ec66857232 Mon Sep 17 00:00:00 2001
  83. From: Roland Mainz <roland.mainz@nrubsig.org>
  84. Date: Tue, 30 Jan 2024 14:56:19 +0100
  85. Subject: [PATCH 2/3] daemon: Always flush debug output
  86.  
  87. Always flush debug output, to make sure the ordering of debug, error
  88. and log messages are correct.
  89.  
  90. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  91. ---
  92. daemon/daemon_debug.c | 37 +++++++++++++++++--------------------
  93.  1 file changed, 17 insertions(+), 20 deletions(-)
  94.  
  95. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  96. index ba6fb10..3f0bc54 100644
  97. --- a/daemon/daemon_debug.c
  98. +++ b/daemon/daemon_debug.c
  99. @@ -35,7 +35,8 @@ static int g_debug_level = DEFAULT_DEBUG_LEVEL;
  100.  
  101.  void set_debug_level(int level) { g_debug_level = level; }
  102.  
  103. -FILE *dlog_file, *elog_file;
  104. +static FILE *dlog_file;
  105. +static FILE *elog_file;
  106.  
  107.  #ifndef STANDALONE_NFSD
  108.  void open_log_files()
  109. @@ -72,36 +73,34 @@ void open_log_files()
  110.  
  111.  void dprintf(int level, LPCSTR format, ...)
  112.  {
  113. -    if (level <= g_debug_level) {
  114. -        va_list args;
  115. -        va_start(args, format);
  116. -        fprintf(dlog_file, "%04x: ", GetCurrentThreadId());
  117. -        vfprintf(dlog_file, format, args);
  118. -#ifndef STANDALONE_NFSD
  119. -        fflush(dlog_file);
  120. -#endif
  121. -        va_end(args);
  122. -    }
  123. +    if (level > g_debug_level)
  124. +        return;
  125. +
  126. +    va_list args;
  127. +    va_start(args, format);
  128. +    (void)fprintf(dlog_file, "%04x: ", (int)GetCurrentThreadId());
  129. +    (void)vfprintf(dlog_file, format, args);
  130. +    (void)fflush(dlog_file);
  131. +    va_end(args);
  132.  }
  133.  
  134.  /* log events (mount, umount, auth, ...) */
  135.  void logprintf(LPCSTR format, ...)
  136.  {
  137.      SYSTEMTIME stime;
  138. -    GetLocalTime(&stime);
  139.  
  140. +    GetLocalTime(&stime);
  141.      va_list args;
  142.      va_start(args, format);
  143. -    (void)fprintf(dlog_file, "# LOG: ts=%04d-%02d-%02d_%02d:%02d:%02d:%04d"
  144. +    (void)fprintf(dlog_file,
  145. +        "# LOG: ts=%04d-%02d-%02d_%02d:%02d:%02d:%04d"
  146.          " thr=%04x msg=",
  147.          (int)stime.wYear, (int)stime.wMonth, (int)stime.wDay,
  148.          (int)stime.wHour, (int)stime.wMinute, (int)stime.wSecond,
  149.          (int)stime.wMilliseconds,
  150.          (int)GetCurrentThreadId());
  151.      (void)vfprintf(dlog_file, format, args);
  152. -#ifndef STANDALONE_NFSD
  153.      (void)fflush(dlog_file);
  154. -#endif
  155.      va_end(args);
  156.  }
  157.  
  158. @@ -109,11 +108,9 @@ void eprintf(LPCSTR format, ...)
  159.  {
  160.      va_list args;
  161.      va_start(args, format);
  162. -    fprintf(elog_file, "%04x: ", GetCurrentThreadId());
  163. -    vfprintf(elog_file, format, args);
  164. -#ifndef STANDALONE_NFSD
  165. -    fflush(elog_file);
  166. -#endif
  167. +    (void)fprintf(elog_file, "%04x: ", (int)GetCurrentThreadId());
  168. +    (void)vfprintf(elog_file, format, args);
  169. +    (void)fflush(elog_file);
  170.      va_end(args);
  171.  }
  172.  
  173. --
  174. 2.43.0
  175.  
  176. From 9ebdfe42aff5d1ceadfe138c6b1887fb054aeb3d Mon Sep 17 00:00:00 2001
  177. From: Roland Mainz <roland.mainz@nrubsig.org>
  178. Date: Tue, 30 Jan 2024 14:57:49 +0100
  179. Subject: [PATCH 3/3] sys: Fix 'C28145: "The opaque MDL structure should not be
  180.  modified by a driver"'-warnings
  181.  
  182. Fix 'C28145: "The opaque MDL structure should not be modified by a
  183. driver"'-warnings.
  184.  
  185. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  186. ---
  187. sys/nfs41_driver.c | 22 ++++++++++++++++++++++
  188.  1 file changed, 22 insertions(+)
  189.  
  190. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  191. index 75813dc..754b704 100644
  192. --- a/sys/nfs41_driver.c
  193. +++ b/sys/nfs41_driver.c
  194. @@ -804,7 +804,14 @@ NTSTATUS marshal_nfs41_rw(
  195.          sizeof(entry->u.ReadWrite.offset));
  196.      tmp += sizeof(entry->u.ReadWrite.offset);
  197.      __try {
  198. +#pragma warning( push )
  199. +/*
  200. + * C28145: "The opaque MDL structure should not be modified by a
  201. + * driver.", |MDL_MAPPING_CAN_FAIL| is the exception
  202. + */
  203. +#pragma warning (disable : 28145)
  204.          entry->u.ReadWrite.MdlAddress->MdlFlags |= MDL_MAPPING_CAN_FAIL;
  205. +#pragma warning( pop )
  206.          entry->buf =
  207.              MmMapLockedPagesSpecifyCache(entry->u.ReadWrite.MdlAddress,
  208.                  UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
  209. @@ -3838,7 +3845,14 @@ retry_on_link:
  210.              RxFreePool(entry);
  211.              goto out;
  212.          }
  213. +#pragma warning( push )
  214. +/*
  215. + * C28145: "The opaque MDL structure should not be modified by a
  216. + * driver.", |MDL_MAPPING_CAN_FAIL| is the exception
  217. + */
  218. +#pragma warning (disable : 28145)
  219.          entry->u.Open.EaMdl->MdlFlags |= MDL_MAPPING_CAN_FAIL;
  220. +#pragma warning( pop )
  221.          MmProbeAndLockPages(entry->u.Open.EaMdl, KernelMode, IoModifyAccess);
  222.      }
  223.  
  224. @@ -4395,7 +4409,15 @@ NTSTATUS nfs41_QueryDirectory(
  225.          RxFreePool(entry);
  226.          goto out;
  227.      }
  228. +#pragma warning( push )
  229. +/*
  230. + * C28145: "The opaque MDL structure should not be modified by a
  231. + * driver.", |MDL_MAPPING_CAN_FAIL| is the exception
  232. + */
  233. +#pragma warning (disable : 28145)
  234.      entry->u.QueryFile.mdl->MdlFlags |= MDL_MAPPING_CAN_FAIL;
  235. +#pragma warning( pop )
  236. +
  237.      MmProbeAndLockPages(entry->u.QueryFile.mdl, KernelMode, IoModifyAccess);
  238.  
  239.      entry->u.QueryFile.filter = Filter;
  240. --
  241. 2.43.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