pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: WindowsServer2019 support, more idmapper fixes, clang build fixes+misc, 2024-09-19
Posted by Anonymous on Thu 19th Sep 2024 16:16
raw | new post

  1. From a6aa6f0368eb7ce44cf22229bd8e638f010417c9 Mon Sep 17 00:00:00 2001
  2. From: Josh Hurst <joshhurst@gmail.com>
  3. Date: Thu, 19 Sep 2024 11:42:05 +0200
  4. Subject: [PATCH 1/6] daemon: Fix typo when quoting impersonated group name
  5.  
  6. Fix typo (missing "'") when quoting impersonated group name
  7.  
  8. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  9. ---
  10. daemon/daemon_debug.c | 2 +-
  11.  1 file changed, 1 insertion(+), 1 deletion(-)
  12.  
  13. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  14. index cda0df1..f7e935c 100644
  15. --- a/daemon/daemon_debug.c
  16. +++ b/daemon/daemon_debug.c
  17. @@ -125,7 +125,7 @@ void dprintf_out(LPCSTR format, ...)
  18.          in_dprintf_out = false;
  19.      }
  20.  
  21. -    (void)fprintf(dlog_file, "%04x/%s='%s'/%s' ",
  22. +    (void)fprintf(dlog_file, "%04x/%s='%s'/'%s' ",
  23.          (int)GetCurrentThreadId(),
  24.          tok_src, username, groupname);
  25.  
  26. --
  27. 2.45.1
  28.  
  29. From f3cebbd10c32257fffd6542a711aa53100442cb0 Mon Sep 17 00:00:00 2001
  30. From: Roland Mainz <roland.mainz@nrubsig.org>
  31. Date: Thu, 19 Sep 2024 12:35:17 +0200
  32. Subject: [PATCH 2/6] cygwin_idmapper.ksh,daemon: Fix typo in idmapper code
  33.  which causes confusion
  34.  
  35. Typo in idmapper code causes confusion, because manually added
  36. account with correctly spelled variable names are not found.
  37.  
  38. Fix: s/localaccoutname/localaccountname/
  39.  
  40. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  41. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  42. ---
  43. cygwin_idmapper.ksh   | 16 ++++++++--------
  44.  daemon/idmap_cygwin.c | 10 +++++-----
  45.  2 files changed, 13 insertions(+), 13 deletions(-)
  46.  
  47. diff --git a/cygwin_idmapper.ksh b/cygwin_idmapper.ksh
  48. index bcbc871..71a9a1a 100644
  49. --- a/cygwin_idmapper.ksh
  50. +++ b/cygwin_idmapper.ksh
  51. @@ -45,42 +45,42 @@ typeset -r -A localised_groupnames=(['None']="${stdout%%:*}")
  52.  
  53.  compound -A localusers=(
  54.         ["roland_mainz"]=(
  55. -               localaccoutname='roland_mainz'
  56. +               localaccountname='roland_mainz'
  57.                 localuid=197608
  58.                 localgid=197121
  59.         )
  60.         ["siegfried_wulsch"]=(
  61. -               localaccoutname='siegfried_wulsch'
  62. +               localaccountname='siegfried_wulsch'
  63.                 localuid=197609
  64.                 localgid=197121
  65.         )
  66.         ["${localised_usernames['SYSTEM']}"]=(
  67. -               localaccoutname="${localised_usernames['SYSTEM']}"
  68. +               localaccountname="${localised_usernames['SYSTEM']}"
  69.                 localuid=18
  70.                 localgid=18
  71.         )
  72.         ["SYSTEM"]=(
  73. -               localaccoutname="${localised_usernames['SYSTEM']}"
  74. +               localaccountname="${localised_usernames['SYSTEM']}"
  75.                 localuid=18
  76.                 localgid=18
  77.         )
  78.         ["rmainz"]=(
  79. -               localaccoutname='rmainz'
  80. +               localaccountname='rmainz'
  81.                 localuid=1616
  82.                 localgid=1616
  83.         )
  84.         ["swulsch"]=(
  85. -               localaccoutname='swulsch'
  86. +               localaccountname='swulsch'
  87.                 localuid=1818
  88.                 localgid=1818
  89.         )
  90.         ["root"]=(
  91. -               localaccoutname='root'
  92. +               localaccountname='root'
  93.                 localuid=0
  94.                 localgid=0
  95.         )
  96.         ["nobody"]=(
  97. -               localaccoutname='nobody'
  98. +               localaccountname='nobody'
  99.                 localuid=65534
  100.                 localgid=65534
  101.         )
  102. diff --git a/daemon/idmap_cygwin.c b/daemon/idmap_cygwin.c
  103. index ec60142..9f7af99 100644
  104. --- a/daemon/idmap_cygwin.c
  105. +++ b/daemon/idmap_cygwin.c
  106. @@ -63,7 +63,7 @@ int cygwin_getent_passwd(const char *name, char *res_loginname, uid_t *res_uid,
  107.      int i = 0;
  108.      cpv_name_val cnv[64] = { 0 };
  109.      cpv_name_val *cnv_cur = NULL;
  110. -    const char *localaccoutname = NULL;
  111. +    const char *localaccountname = NULL;
  112.  
  113.      DPRINTF(CYGWINIDLVL,
  114.          ("--> cygwin_getent_passwd(name='%s')\n",
  115. @@ -129,8 +129,8 @@ int cygwin_getent_passwd(const char *name, char *res_loginname, uid_t *res_uid,
  116.  
  117.      for (i=0 ; i < numcnv ; i++) {
  118.          cnv_cur = &cnv[i];
  119. -        if (!strcmp("localaccoutname", cnv_cur->cpv_name)) {
  120. -            localaccoutname = cnv_cur->cpv_value;
  121. +        if (!strcmp("localaccountname", cnv_cur->cpv_name)) {
  122. +            localaccountname = cnv_cur->cpv_value;
  123.          }
  124.          else if (!strcmp("localuid", cnv_cur->cpv_name)) {
  125.              errno = 0;
  126. @@ -146,11 +146,11 @@ int cygwin_getent_passwd(const char *name, char *res_loginname, uid_t *res_uid,
  127.          }
  128.      }
  129.  
  130. -    if (!localaccoutname)
  131. +    if (!localaccountname)
  132.          goto fail;
  133.  
  134.      if (res_loginname)
  135. -        (void)strcpy_s(res_loginname, VAL_LEN, localaccoutname);
  136. +        (void)strcpy_s(res_loginname, VAL_LEN, localaccountname);
  137.      *res_uid = uid;
  138.      *res_gid = gid;
  139.      res = 0;
  140. --
  141. 2.45.1
  142.  
  143. From c969b0f51404ab936a031fb368223d7103bd2289 Mon Sep 17 00:00:00 2001
  144. From: Roland Mainz <roland.mainz@nrubsig.org>
  145. Date: Thu, 19 Sep 2024 12:48:48 +0200
  146. Subject: [PATCH 3/6] cygwin_idmapper.ksh: Add manual entry for group "Kein" to
  147.  handle German Windows
  148.  
  149. Add manual "Kein" entry for German localised Windows group "None"
  150. to handle NFSv4 servers which have been configured to use that
  151. group name.
  152.  
  153. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  154. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  155. ---
  156. cygwin_idmapper.ksh | 5 +++++
  157.  1 file changed, 5 insertions(+)
  158.  
  159. diff --git a/cygwin_idmapper.ksh b/cygwin_idmapper.ksh
  160. index 71a9a1a..930a32e 100644
  161. --- a/cygwin_idmapper.ksh
  162. +++ b/cygwin_idmapper.ksh
  163. @@ -95,6 +95,11 @@ compound -A localgroups=(
  164.                 localgroupname="${localised_groupnames['None']}"
  165.                 localgid=197121
  166.         )
  167. +       # German Windows localised group name for "None"
  168. +       ["Kein"]=(
  169. +               localgroupname="${localised_groupnames['None']}"
  170. +               localgid=197121
  171. +       )
  172.         ["rmainz"]=(
  173.                 localgroupname='rmainz'
  174.                 localgid=1616
  175. --
  176. 2.45.1
  177.  
  178. From a092659209b2bd3b42da3a4229d076f34e8d2dd0 Mon Sep 17 00:00:00 2001
  179. From: Roland Mainz <roland.mainz@nrubsig.org>
  180. Date: Thu, 19 Sep 2024 12:52:03 +0200
  181. Subject: [PATCH 4/6] cygwin: Add "Windows Server 2019" to the list of
  182.  supported Windows versions
  183.  
  184. Add "Windows Server 2019" to the list of supported Windows versions in
  185. README.bintarball.txt.
  186.  
  187. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  188. ---
  189. cygwin/README.bintarball.txt | 4 ++--
  190.  1 file changed, 2 insertions(+), 2 deletions(-)
  191.  
  192. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  193. index e64fdc9..f5d4438 100644
  194. --- a/cygwin/README.bintarball.txt
  195. +++ b/cygwin/README.bintarball.txt
  196. @@ -10,7 +10,7 @@
  197.  #
  198.  # 1. What is this ?
  199.  #
  200. -NFSv4.1 client and filesystem driver for Windows 10/11
  201. +NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  202.  
  203.  
  204.  #
  205. @@ -85,7 +85,7 @@ NFSv4.1 client and filesystem driver for Windows 10/11
  206.  #
  207.  # 3. Requirements:
  208.  #
  209. -- Windows 10 (32bit or 64bit) or Windows 11
  210. +- Windows 10 (32bit or 64bit), Windows 11 or Windows Server 2019
  211.  - Cygwin:
  212.      - Cygwin versions:
  213.          - 64bit: >= 3.5.3 (or 3.6.x-devel)
  214. --
  215. 2.45.1
  216.  
  217. From bbecf39cb10028367407f8bcad410941bf8957ff Mon Sep 17 00:00:00 2001
  218. From: Roland Mainz <roland.mainz@nrubsig.org>
  219. Date: Thu, 19 Sep 2024 13:35:35 +0200
  220. Subject: [PATCH 5/6] dll: Remove invalid "SECTIONS" from nfs41_np.def
  221.  
  222. Remove invalid "SECTIONS" from nfs41_np.def, VS19 does not
  223. understand it
  224.  
  225. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  226. ---
  227. dll/nfs41_np.def | 1 -
  228.  1 file changed, 1 deletion(-)
  229.  
  230. diff --git a/dll/nfs41_np.def b/dll/nfs41_np.def
  231. index 31cd2d0..273f5f6 100644
  232. --- a/dll/nfs41_np.def
  233. +++ b/dll/nfs41_np.def
  234. @@ -1,4 +1,3 @@
  235. -SECTIONS       .NFS41_NP       READ WRITE SHARED
  236.  
  237.  EXPORTS
  238.         NPGetCaps                               @13
  239. --
  240. 2.45.1
  241.  
  242. From ea645bf200f0285fb29b326e8d2419a5b55fb55f Mon Sep 17 00:00:00 2001
  243. From: Dan Shelton <dan.f.shelton@gmail.com>
  244. Date: Thu, 19 Sep 2024 14:23:18 +0200
  245. Subject: [PATCH 6/6] daemon,dll,libtirpc: Fix Windows clang build errors for
  246.  ReactOS compatibility
  247.  
  248. Fix Windows clang build errors for ReactOS compatibility.
  249.  
  250. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  251. ---
  252. daemon/callback_server.c |  3 ++-
  253.  daemon/daemon_debug.h    |  2 +-
  254.  daemon/nfs41_callback.h  |  2 +-
  255.  dll/nfs41_np.c           |  4 ++--
  256.  dll/options.h            |  3 ++-
  257.  libtirpc/src/asprintf.c  |  6 +++++-
  258.  libtirpc/src/auth_sspi.c | 12 ++++++++----
  259.  libtirpc/src/clnt_vc.c   |  2 +-
  260.  libtirpc/src/svc_vc.c    |  2 +-
  261.  9 files changed, 23 insertions(+), 13 deletions(-)
  262.  
  263. diff --git a/daemon/callback_server.c b/daemon/callback_server.c
  264. index 8d898d4..2673add 100644
  265. --- a/daemon/callback_server.c
  266. +++ b/daemon/callback_server.c
  267. @@ -508,8 +508,9 @@ out:
  268.          res ? res->resarray_count : 0));
  269.  }
  270.  
  271. -int nfs41_handle_callback(void *rpc_clnt, void *cb, struct cb_compound_res **reply)
  272. +int nfs41_handle_callback(void *rpc_clnt, void *cb, void **arg_reply)
  273.  {
  274. +    struct cb_compound_res **reply = (struct cb_compound_res **)arg_reply;
  275.      nfs41_rpc_clnt *rpc = (nfs41_rpc_clnt *)rpc_clnt;
  276.      cb_req *request = (cb_req *)cb;
  277.      uint32_t status = 0;
  278. diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
  279. index c6f48a9..969bf80 100644
  280. --- a/daemon/daemon_debug.h
  281. +++ b/daemon/daemon_debug.h
  282. @@ -152,7 +152,7 @@ void print_sr_status_flags(int level, int flags);
  283.  void open_log_files();
  284.  void close_log_files();
  285.  const char* secflavorop2name(DWORD sec_flavor);
  286. -void print_nfs41_file_info(const char *label, void *vinfo);
  287. +void print_nfs41_file_info(const char *label, const void *vinfo);
  288.  
  289.  /* pnfs_debug.c */
  290.  enum pnfs_status;
  291. diff --git a/daemon/nfs41_callback.h b/daemon/nfs41_callback.h
  292. index 8e5190c..fddaa1a 100644
  293. --- a/daemon/nfs41_callback.h
  294. +++ b/daemon/nfs41_callback.h
  295. @@ -48,7 +48,7 @@ enum nfs41_callback_op {
  296.      OP_CB_ILLEGAL           = 10044
  297.  };
  298.  
  299. -int nfs41_handle_callback(void *, void *, void *);
  300. +int nfs41_handle_callback(void *rpc_clnt, void *cb, void **arg_reply);
  301.  
  302.  /* OP_CB_LAYOUTRECALL */
  303.  struct cb_recall_file {
  304. diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
  305. index 5d2c8eb..5a89134 100644
  306. --- a/dll/nfs41_np.c
  307. +++ b/dll/nfs41_np.c
  308. @@ -269,7 +269,7 @@ static DWORD StoreConnectionInfo(
  309.  #endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
  310.  
  311.      status = OpenSharedMemory(&hMutex, &hMemory,
  312. -        &(PVOID)pSharedMemory);
  313. +        (PVOID *)&pSharedMemory);
  314.      if (status)
  315.          goto out;
  316.  
  317. @@ -327,7 +327,7 @@ static DWORD StoreConnectionInfo(
  318.      // TODO: copy mount options -cbodley
  319.  
  320.  out_close:
  321. -    CloseSharedMemory(&hMutex, &hMemory, &(PVOID)pSharedMemory);
  322. +    CloseSharedMemory(&hMutex, &hMemory, (PVOID *)&pSharedMemory);
  323.  out:
  324.      DbgP((L"<-- StoreConnectionInfo returns %d\n", (int)status));
  325.  
  326. diff --git a/dll/options.h b/dll/options.h
  327. index b425458..44e300d 100644
  328. --- a/dll/options.h
  329. +++ b/dll/options.h
  330. @@ -24,7 +24,8 @@
  331.  
  332.  #include "nfs41_driver.h"
  333.  
  334. -#define MOUNT_OPTION_BUFFER_SECRET ('n4')
  335. +/* Secret is ASCII "n4" */
  336. +#define MOUNT_OPTION_BUFFER_SECRET (('n' << 8) | '4')
  337.  
  338.  /* MOUNT_OPTION_BUFFER
  339.   *   The mount options buffer received by NPAddConnection3
  340. diff --git a/libtirpc/src/asprintf.c b/libtirpc/src/asprintf.c
  341. index c5daed6..490a795 100644
  342. --- a/libtirpc/src/asprintf.c
  343. +++ b/libtirpc/src/asprintf.c
  344. @@ -17,9 +17,13 @@
  345.   */
  346.  
  347.  //extern int vsnprintf();
  348. +#ifdef _WIN32
  349.  #include <wintirpc.h>
  350. -#include <stdio.h>
  351. +#include <stdarg.h>
  352. +#else
  353.  #include <varargs.h>
  354. +#endif /* _WIN32 */
  355. +#include <stdio.h>
  356.  
  357.  /* Include vasprintf() if not on your OS. */
  358.  #ifndef HAVE_VASPRINTF
  359. diff --git a/libtirpc/src/auth_sspi.c b/libtirpc/src/auth_sspi.c
  360. index 8e84444..309fc32 100644
  361. --- a/libtirpc/src/auth_sspi.c
  362. +++ b/libtirpc/src/auth_sspi.c
  363. @@ -653,9 +653,10 @@ authsspi_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr, u_in
  364.                                  gd->sec->svc, seq));
  365.  }
  366.  
  367. -uint32_t sspi_get_mic(PCtxtHandle ctx, u_int qop, u_int seq,
  368. +uint32_t sspi_get_mic(void *arg_ctx, u_int qop, u_int seq,
  369.                          sspi_buffer_desc *bufin, sspi_buffer_desc *bufout)
  370.  {
  371. +    PCtxtHandle ctx = arg_ctx;
  372.      uint32_t maj_stat;
  373.      SecPkgContext_Sizes ContextSizes;
  374.      SecBufferDesc desc;
  375. @@ -691,9 +692,10 @@ uint32_t sspi_get_mic(PCtxtHandle ctx, u_int qop, u_int seq,
  376.      return maj_stat;
  377.  }
  378.  
  379. -uint32_t sspi_verify_mic(PCtxtHandle ctx, u_int seq, sspi_buffer_desc *bufin,
  380. +uint32_t sspi_verify_mic(void *arg_ctx, u_int seq, sspi_buffer_desc *bufin,
  381.                              sspi_buffer_desc *bufout, unsigned long *qop_state)
  382.  {
  383. +    PCtxtHandle ctx = arg_ctx;
  384.      SecBufferDesc desc;
  385.      SecBuffer sec_tkn[2];
  386.  
  387. @@ -735,9 +737,10 @@ uint32_t sspi_import_name(sspi_buffer_desc *name_in, sspi_name_t *name_out)
  388.      return SEC_E_OK;
  389.  }
  390.  
  391. -uint32_t sspi_wrap(PCtxtHandle ctx, u_int seq, sspi_buffer_desc *bufin,
  392. +uint32_t sspi_wrap(void *arg_ctx, u_int seq, sspi_buffer_desc *bufin,
  393.                     sspi_buffer_desc *bufout, u_int *conf_state)
  394.  {
  395. +    PCtxtHandle ctx = arg_ctx;
  396.      uint32_t maj_stat;
  397.      SecBufferDesc BuffDesc;
  398.      SecBuffer SecBuff[3];
  399. @@ -788,10 +791,11 @@ out:
  400.      return maj_stat;
  401.  }
  402.  
  403. -uint32_t sspi_unwrap(PCtxtHandle ctx, u_int seq, sspi_buffer_desc *bufin,
  404. +uint32_t sspi_unwrap(void *arg_ctx, u_int seq, sspi_buffer_desc *bufin,
  405.                       sspi_buffer_desc *bufout, u_int *conf_state,
  406.                       unsigned long *qop_state)
  407.  {
  408. +    PCtxtHandle ctx = arg_ctx;
  409.      uint32_t maj_stat;
  410.      SecBufferDesc BuffDesc;
  411.      SecBuffer SecBuff[2];
  412. diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c
  413. index 19165d9..8d86a5c 100644
  414. --- a/libtirpc/src/clnt_vc.c
  415. +++ b/libtirpc/src/clnt_vc.c
  416. @@ -132,7 +132,7 @@ static void clnt_vc_destroy(CLIENT *);
  417.  static struct clnt_ops *clnt_vc_ops(void);
  418.  static bool_t time_not_ok(struct timeval *);
  419.  static int read_vc(void *, void *, int);
  420. -static int write_vc(void *, void *, int);
  421. +static int write_vc(void *, char *, int);
  422.  
  423.  struct ct_data {
  424.         int             ct_fd;          /* connection's fd */
  425. diff --git a/libtirpc/src/svc_vc.c b/libtirpc/src/svc_vc.c
  426. index 2d2b429..229844f 100644
  427. --- a/libtirpc/src/svc_vc.c
  428. +++ b/libtirpc/src/svc_vc.c
  429. @@ -75,7 +75,7 @@ static enum xprt_stat rendezvous_stat(SVCXPRT *);
  430.  static void svc_vc_destroy(SVCXPRT *);
  431.  static void __svc_vc_dodestroy (SVCXPRT *);
  432.  static int read_vc(void *, void *, int);
  433. -static int write_vc(void *, void *, int);
  434. +static int write_vc(void *, char *, int);
  435.  static enum xprt_stat svc_vc_stat(SVCXPRT *);
  436.  static bool_t svc_vc_recv(SVCXPRT *, struct rpc_msg *);
  437.  static bool_t svc_vc_getargs(SVCXPRT *, xdrproc_t, void *);
  438. --
  439. 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