pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for libtirpc gcc15 build, release build fixes, VS2022 build+misc, 2024-12-12
Posted by Anonymous on Thu 12th Dec 2024 14:20
raw | new post

  1. From 66f649489aecc6eb594030c88c2d64d6de397afc Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Thu, 12 Dec 2024 11:38:56 +0100
  4. Subject: [PATCH 1/4] libtirpc: Backport "Update declarations to allow compile
  5.  with gcc-15"
  6.  
  7. Backport of libtirpc commit "Update declarations to allow compile
  8. with gcc-15".
  9.     ---- snip ----
  10.     From d473f1e1f6ba80bfaee4daa058da159305167323 Mon Sep 17 00:00:00 2001
  11.     From: Rudi Heitbaum <rudi@heitbaum.com>
  12.     Date: Thu, 12 Dec 2024 04:16:02 -0500
  13.     Subject: [PATCH] Update declarations to allow compile with gcc-15
  14.  
  15.     This patch fixes some of the compile errors with gcc 15-20241117.
  16.  
  17.     In addition the follow declarations need to be fixed:
  18.       sed -n 75,77p libtirpc-1.3.6/src/key_call.c
  19.       cryptkeyres *(*__key_encryptsession_pk_LOCAL)() = 0;
  20.       cryptkeyres *(*__key_decryptsession_pk_LOCAL)() = 0;
  21.       des_block *(*__key_gendes_LOCAL)() = 0;
  22.  
  23.     Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
  24.     Signed-off-by: Steve Dickson <steved@redhat.com>
  25.     ---- snip ----
  26.  
  27. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  28. ---
  29. libtirpc/src/auth_none.c     | 2 +-
  30.  libtirpc/src/getpublickey.c  | 2 +-
  31.  libtirpc/src/svc_auth_none.c | 4 ++--
  32.  3 files changed, 4 insertions(+), 4 deletions(-)
  33.  
  34. diff --git a/libtirpc/src/auth_none.c b/libtirpc/src/auth_none.c
  35. index b528b55..4c2e9b3 100644
  36. --- a/libtirpc/src/auth_none.c
  37. +++ b/libtirpc/src/auth_none.c
  38. @@ -86,7 +86,7 @@ static bool_t authnone_validate (AUTH *, struct opaque_auth *, u_int);
  39.  static bool_t authnone_refresh (AUTH *, void *);
  40.  static void authnone_destroy (AUTH *);
  41.  
  42. -extern bool_t xdr_opaque_auth();
  43. +extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
  44.  
  45.  static struct auth_ops *authnone_ops();
  46.  
  47. diff --git a/libtirpc/src/getpublickey.c b/libtirpc/src/getpublickey.c
  48. index 0dee063..018eee7 100644
  49. --- a/libtirpc/src/getpublickey.c
  50. +++ b/libtirpc/src/getpublickey.c
  51. @@ -53,7 +53,7 @@
  52.  /*
  53.   * Hack to let ypserv/rpc.nisd use AUTH_DES.
  54.   */
  55. -int (*__getpublickey_LOCAL)() = 0;
  56. +int (*__getpublickey_LOCAL)(const char *, char *) = 0;
  57.  
  58.  /*
  59.   * Get somebody's public key
  60. diff --git a/libtirpc/src/svc_auth_none.c b/libtirpc/src/svc_auth_none.c
  61. index 18f4e16..60bd9aa 100644
  62. --- a/libtirpc/src/svc_auth_none.c
  63. +++ b/libtirpc/src/svc_auth_none.c
  64. @@ -38,8 +38,8 @@
  65.  #include <wintirpc.h>
  66.  #include <rpc/rpc.h>
  67.  
  68. -//static bool_t        svcauth_none_destroy();
  69. -//static bool_t   svcauth_none_wrap();
  70. +//static bool_t        svcauth_none_destroy(SVCAUTH *);
  71. +//static bool_t   svcauth_none_wrap(SVCAUTH *, XDR *, bool_t (*)(XDR *, ...), char *);
  72.  
  73.  static bool_t
  74.  svcauth_none_destroy(SVCAUTH *auth)
  75. --
  76. 2.45.1
  77.  
  78. From b73aff7f55b3efdfb36c277cd21651ffa551e12b Mon Sep 17 00:00:00 2001
  79. From: Roland Mainz <roland.mainz@nrubsig.org>
  80. Date: Thu, 12 Dec 2024 11:47:34 +0100
  81. Subject: [PATCH 2/4] cygwin: README.txt VS2022 build instructions for v143
  82.  platform toolset
  83.  
  84. Build instructions in cygwin/README.txt for Visual Studio 2022 should
  85. include instructions how to "retarget" the solution to use the
  86. correct platform toolset ("v143" for VS2022, "v142" for VS2019).
  87.  
  88. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  89. ---
  90. cygwin/README.txt | 3 +++
  91.  1 file changed, 3 insertions(+)
  92.  
  93. diff --git a/cygwin/README.txt b/cygwin/README.txt
  94. index ffce8ad..531b97e 100644
  95. --- a/cygwin/README.txt
  96. +++ b/cygwin/README.txt
  97. @@ -49,6 +49,9 @@ make bintarball
  98.  export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/:$PATH"
  99.  git clone https://github.com/kofemann/ms-nfs41-client.git
  100.  cd ms-nfs41-client
  101. +# "retarget" VS platform toolset to "v143"
  102. +# ("v142" should remain the default when comitting)
  103. +sed -i -E 's/<PlatformToolset>v142<\/PlatformToolset>/<PlatformToolset>v143<\/PlatformToolset>/g' $(find 'build.vc19' -name \*.vcxproj)
  104.  cd cygwin
  105.  make build64
  106.  make installdest64
  107. --
  108. 2.45.1
  109.  
  110. From b4e2965b442b9622c90097379e2b0fa91e981809 Mon Sep 17 00:00:00 2001
  111. From: Roland Mainz <roland.mainz@nrubsig.org>
  112. Date: Thu, 12 Dec 2024 13:25:29 +0100
  113. Subject: [PATCH 3/4] cygwin,daemon: releasebuild msnfs41client
  114.  sys_run_daemon cannot write log files and fails quietly
  115.  
  116. Release build of nfsd.exe started via $ msnfs41client sys_run_daemon #
  117. cannot write log files and fails, without returning any error
  118. messages to stderr.
  119.  
  120. Fix is to give user "SYSTEM" write rights in the cwd where nfsd.exe is
  121. started, and |open_log_files()| will print an error message if it cannot
  122. open a log gile.
  123.  
  124. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  125. ---
  126. cygwin/devel/msnfs41client.bash |  7 +++++++
  127.  daemon/daemon_debug.c           | 19 +++++++++++++++++--
  128.  2 files changed, 24 insertions(+), 2 deletions(-)
  129.  
  130. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  131. index 4337a02..6c9a401 100755
  132. --- a/cygwin/devel/msnfs41client.bash
  133. +++ b/cygwin/devel/msnfs41client.bash
  134. @@ -516,6 +516,13 @@ function nfsclient_system_rundeamon
  135.         # gets printed correctly on a terminal
  136.         chcp.com 65001
  137.  
  138. +       # make sure nfsd running as user "SYSTEM" can write
  139. +       # its log files to CWD
  140. +       # We explicitly use the SID ("S-1-5-18") for user "SYSTEM",
  141. +       # because the username can be localised, e.g.
  142. +       # $'Syst\xc3\xa8me' for French Windows
  143. +       icacls "$(cygpath -w "$PWD")" /grant '*S-1-5-18:(F)'
  144. +
  145.         typeset -a nfsd_args=(
  146.                 'nfsd.exe'
  147.                 '-debug'
  148. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  149. index 22007ac..3b92728 100644
  150. --- a/daemon/daemon_debug.c
  151. +++ b/daemon/daemon_debug.c
  152. @@ -24,6 +24,7 @@
  153.  #include <stdio.h>
  154.  #include <sddl.h>
  155.  #include <lmcons.h>
  156. +#include <direct.h> /* for |_getcwd()| */
  157.  
  158.  #include "daemon_debug.h"
  159.  #include "from_kernel.h"
  160. @@ -54,16 +55,30 @@ void open_log_files()
  161.  
  162.      elog_file = fopen(efile, mode);
  163.      if (elog_file == NULL) {
  164. +        char *cwd;
  165.          lasterr = GetLastError();
  166. +        cwd = _getcwd(NULL, 1);
  167. +        (void)fprintf(stderr,
  168. +            "open_log_files: "
  169. +            "Cannot open log file '%s\\%s', lasterr=%d\n",
  170. +            cwd, efile, (int)lasterr);
  171.          ReportStatusToSCMgr(SERVICE_STOPPED, lasterr, 0);
  172. -        exit(lasterr);
  173. +        free(cwd);
  174. +        exit(1);
  175.      }
  176.  
  177.      dlog_file = fopen(dfile, mode);
  178.      if (dlog_file == NULL) {
  179. +        char *cwd;
  180.          lasterr = GetLastError();
  181. +        cwd = _getcwd(NULL, 1);
  182. +        (void)fprintf(stderr,
  183. +            "open_log_files: "
  184. +            "Cannot open log file '%s\\%s', lasterr=%d\n",
  185. +            cwd, dfile, (int)lasterr);
  186.          ReportStatusToSCMgr(SERVICE_STOPPED, lasterr, 0);
  187. -        exit(lasterr);
  188. +        free(cwd);
  189. +        exit(1);
  190.      }
  191.  }
  192.  
  193. --
  194. 2.45.1
  195.  
  196. From c467f87fb9d4f3984d94bec3f23329d44f9fb9da Mon Sep 17 00:00:00 2001
  197. From: Roland Mainz <roland.mainz@nrubsig.org>
  198. Date: Thu, 12 Dec 2024 13:29:05 +0100
  199. Subject: [PATCH 4/4] sys: nfs41_driver.sys build with |NDEBUG| should print
  200.  less debug messages
  201.  
  202. nfs41_driver.sys build with |NDEBUG| should print less debug messages
  203.  
  204. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  205. ---
  206. sys/nfs41sys_debug.h | 7 ++++++-
  207.  1 file changed, 6 insertions(+), 1 deletion(-)
  208.  
  209. diff --git a/sys/nfs41sys_debug.h b/sys/nfs41sys_debug.h
  210. index d199ddf..29bb339 100644
  211. --- a/sys/nfs41sys_debug.h
  212. +++ b/sys/nfs41sys_debug.h
  213. @@ -64,7 +64,11 @@ void print_debug_header(PRX_CONTEXT RxContext);
  214.  #define PTR2PTRDIFF_T(p) (((char *)(p))-((char *)0))
  215.  #define PsGetCurrentProcessShortDebugId() ((int)PTR2PTRDIFF_T(PsGetCurrentProcessId()))
  216.  
  217. -
  218. +#ifdef NDEBUG
  219. +#define DbgEn()
  220. +#define DbgEx()
  221. +#define DbgR()
  222. +#else
  223.  #define DbgEn() DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, \
  224.          "--> [%s] [%04x] %s\n", _DRIVER_NAME_, PsGetCurrentProcessShortDebugId(), \
  225.          __func__); __try {
  226. @@ -83,6 +87,7 @@ void print_debug_header(PRX_CONTEXT RxContext);
  227.              exc_status = GetExceptionCode() ; \
  228.              DbgP("Exception encountered with value = 0x%lx\n", (long)exc_status); \
  229.          }
  230. +#endif /* NDEBUG */
  231.  
  232.  /* These are for ToasterDebugPrint */
  233.  
  234. --
  235. 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