pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patch for UNC path issue, debugging and bintarball README, 2023-12-14
Posted by Anonymous on Thu 14th Dec 2023 15:26
raw | new post

  1. From 5a2d50a1e86e8ffa119d02c35a9ba6526b65aeef Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Thu, 14 Dec 2023 15:10:05 +0100
  4. Subject: [PATCH 1/3] sys/nfs41_driver: |copy_nfs41_mount_config()| needs
  5.  SecFlavor buf init
  6.  
  7. |copy_nfs41_mount_config()| did not init the SecFlavor buffer
  8. correctly to it's own copy, leaving to spodaric UNC path failures.
  9.  
  10. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  11. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  12. ---
  13. sys/nfs41_driver.c | 7 ++++---
  14.  1 file changed, 4 insertions(+), 3 deletions(-)
  15.  
  16. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  17. index 9f35859..b9e0f86 100644
  18. --- a/sys/nfs41_driver.c
  19. +++ b/sys/nfs41_driver.c
  20. @@ -289,7 +289,7 @@ typedef struct _NFS41_MOUNT_CONFIG {
  21.      UNICODE_STRING SrvName; /* hostname, or hostname@port */
  22.      WCHAR mntpt_buffer[NFS41_SYS_MAX_PATH_LEN];
  23.      UNICODE_STRING MntPt;
  24. -    WCHAR sec_flavor[MAX_SEC_FLAVOR_LEN];
  25. +    WCHAR sec_flavor_buffer[MAX_SEC_FLAVOR_LEN];
  26.      UNICODE_STRING SecFlavor;
  27.      DWORD timeout;
  28.  } NFS41_MOUNT_CONFIG, *PNFS41_MOUNT_CONFIG;
  29. @@ -485,6 +485,7 @@ void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src)
  30.      RtlCopyMemory(dest, src, sizeof(NFS41_MOUNT_CONFIG));
  31.      dest->SrvName.Buffer = dest->srv_buffer;
  32.      dest->MntPt.Buffer = dest->mntpt_buffer;
  33. +    dest->SecFlavor.Buffer = dest->sec_flavor_buffer;
  34.  }
  35.  
  36.  void print_debug_header(
  37. @@ -2692,7 +2693,7 @@ void nfs41_MountConfig_InitDefaults(
  38.      Config->MntPt.Buffer = Config->mntpt_buffer;
  39.      Config->SecFlavor.Length = 0;
  40.      Config->SecFlavor.MaximumLength = MAX_SEC_FLAVOR_LEN;
  41. -    Config->SecFlavor.Buffer = Config->sec_flavor;
  42. +    Config->SecFlavor.Buffer = Config->sec_flavor_buffer;
  43.      RtlCopyUnicodeString(&Config->SecFlavor, &AUTH_SYS_NAME);
  44.      Config->timeout = UPCALL_TIMEOUT_DEFAULT;
  45.  }
  46. @@ -3106,7 +3107,7 @@ NTSTATUS nfs41_CreateVNetRoot(
  47.  
  48.      status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
  49.      if (status != STATUS_SUCCESS) {
  50. -        DbgP("Invalid rpcsec security flavor %wZ\n", &Config->SecFlavor);
  51. +        DbgP("Invalid rpcsec security flavor '%wZ'\n", &Config->SecFlavor);
  52.          goto out_free;
  53.      }
  54.  
  55. --
  56. 2.42.1
  57.  
  58. From 2cd67a7d200af6354bd487c0f4b9d0aaf932392b Mon Sep 17 00:00:00 2001
  59. From: Roland Mainz <roland.mainz@nrubsig.org>
  60. Date: Thu, 14 Dec 2023 15:27:15 +0100
  61. Subject: [PATCH 2/3] Cygwin binary tarball should have a README
  62.  
  63. The Cygwin binary tarball should come with a README
  64.  
  65. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  66. ---
  67. cygwin/Makefile              |   8 +-
  68.  cygwin/README.bintarball.txt | 163 +++++++++++++++++++++++++++++++++++
  69.  2 files changed, 169 insertions(+), 2 deletions(-)
  70.  create mode 100644 cygwin/README.bintarball.txt
  71.  
  72. diff --git a/cygwin/Makefile b/cygwin/Makefile
  73. index 9b4ff11..8eb25fa 100644
  74. --- a/cygwin/Makefile
  75. +++ b/cygwin/Makefile
  76. @@ -101,12 +101,16 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  77.                 "$(DESTDIR)/cygdrive/c/cygwin64/sbin/"
  78.  
  79.  bintarball: installdest
  80. -       (cd destdir && \
  81. +       ( \
  82. +       base_filename="msnfs41client_cygwin_binaries_git$$(git rev-parse --short HEAD)_$$(date +%Y%m%d_%Hh%Mm)" ; \
  83. +       cd destdir && \
  84. +       cp "../cygwin/README.bintarball.txt" "$${base_filename}.readme" && \
  85.         tar -cvf - \
  86.                 --owner=SYSTEM:18 \
  87.                 --group=SYSTEM:18 \
  88.                 cygdrive/c/cygwin64 | \
  89. -                       bzip2 -9 >"msnfs41client_cygwin_binaries_git$$(git rev-parse --short HEAD)_$$(date +%Y%m%d_%Hh%Mm).tar.bz2")
  90. +                       bzip2 -9 >"$${base_filename}.tar.bz2" \
  91. +       )
  92.  
  93.  #
  94.  # clean destdir/, but only if nfsd*.exe does not use it right now
  95. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  96. new file mode 100644
  97. index 0000000..493deb4
  98. --- /dev/null
  99. +++ b/cygwin/README.bintarball.txt
  100. @@ -0,0 +1,163 @@
  101. +###
  102. +### msnfs41client Cygwin binary tarball README
  103. +###
  104. +
  105. +##
  106. +## WARNING: ALPHA VERSION, ONLY SUITEABLE FOR BUG HUNTING!!
  107. +##
  108. +
  109. +##
  110. +## Installation/Deinstallation
  111. +##
  112. +
  113. +# 1. Requirements:
  114. +- Windows 10
  115. +- Cygwin 3.5.0
  116. +    - Packages:
  117. +        cygwin
  118. +        cygwin-devel
  119. +        cygrunsrv
  120. +        cygutils
  121. +        cygutils-extra
  122. +        bash
  123. +        bzip2
  124. +        coreutils
  125. +        getent
  126. +        gdb
  127. +        grep
  128. +        hostname
  129. +        less
  130. +        pax
  131. +        pbzip2
  132. +        procps-ng
  133. +        sed
  134. +        tar
  135. +        time
  136. +        util-linux
  137. +        wget
  138. +
  139. +
  140. +# 2. Installation (as "Administrator"):
  141. +$ mkdir -p ~/download
  142. +$ cd ~/download
  143. +$ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/alpha/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2'
  144. +$ (cd / && tar -xf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 )
  145. +$ /sbin/msnfs41client install
  146. +
  147. +
  148. +# 3. Deinstallation:
  149. +$ (set -x ; cd / && tar -tf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
  150. +
  151. +
  152. +##
  153. +## Usage
  154. +##
  155. +
  156. +# Run the NFSv4 client daemon:
  157. +# - run this preferably as "Adminstrator", but this is not a requirement
  158. +# - requires seperate terminal
  159. +$ /sbin/msnfs41client run_daemon
  160. +
  161. +# Mount a filesystem and use it
  162. +$ /sbin/nfs_mount -o rw N 10.49.20.110:/net_tmpfs2
  163. +Successfully mounted '10.49.20.110@2049' to drive 'N:'
  164. +$ cd /cygdrive/n/
  165. +$ ls -la
  166. +total 4
  167. +drwxrwxrwt 5 Unix_User+0      Unix_Group+0      100 Dec  7 14:17 .
  168. +dr-xr-xr-x 1 roland_mainz     Kein                0 Dec 14 13:48 ..
  169. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  80 Dec 12 16:24 10492030
  170. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec 13 17:58 directory_t
  171. +drwxr-xr-x 3 Unix_User+197608 Unix_Group+197121  60 Dec  7 11:01 test2
  172. +
  173. +# Unmount filesystem:
  174. +$ cd ~
  175. +$ net use N: /delete
  176. +
  177. +#
  178. +# Notes:
  179. +#
  180. +- Idmapping (including uid/gid mapping) between NFSv4 client and NFSv4
  181. +  server works via /lib/msnfs41client/cygwin_idmapper.ksh, which
  182. +  either uses builtin static data, or /usr/bin/getent passwd and
  183. +  /usr/bin/getent group.
  184. +  As getent uses the configured name services it should work with LDAP
  185. +  too.
  186. +  This is still work-in-progress, with the goal that both NFSv4 client
  187. +  and server can use different uid/gid numeric values for client and
  188. +  server side.
  189. +
  190. +- UNC paths are supported, after successful mounting /sbin/nfs_mount
  191. +  will list the paths in Cygwin UNC format.
  192. +
  193. +- SIDs work, users with valid Windows accounts (see Cygwin idmapping
  194. +  above get their SIDs, unknown users with valid uid/gid values get
  195. +  Unix_User+id/Unix_Group+id SIDs, and all others are mapped
  196. +  to nobody/nogroup SIDs.
  197. +
  198. +- Cygwin symlinks are supported, but might require
  199. +  $ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #.
  200. +  This includes symlinks to UNC paths, e.g. as Admin
  201. +  $ cmd /c 'mklink /d c:\home\rmainz \\derfwpc5131_ipv6@2049\nfs4\export\home2\rmainz' #
  202. +  and then $ cd /cygdrive/c/home/rmainz/ # should work
  203. +
  204. +- performace: All binaries are build without any optimisation, so
  205. +  the filesystem is much slower than it could be.
  206. +
  207. +- bad performance due to Windows Defender AntiVirus:
  208. +  Option 1:
  209. +  # disable Windows defender realtime monitoring
  210. +  # (requires Admin shell)
  211. +  powershell -Command 'Set-MpPreference -DisableRealtimeMonitoring 1'
  212. +  Option 2:
  213. +  Add "nfsd.exe", "nfsd_debug.exe", ksh93.exe, bash.exe, git.exe and
  214. +  other offending commands to process name whitelist.
  215. +
  216. +- performance: Use vmxnet3 in VMware to improve performance
  217. +
  218. +- ACLs are supported via the normal Windows ACL tools, but on
  219. +  Linux require the nfs4_getfacl/nfs4_setfacl utilties to see the
  220. +  data.
  221. +  Example (assuming that Windows, Linux NFSv4 client and NFSv4
  222. +  server have a user "siegfried_wulsch"):
  223. +  - On Windows on a NFSv4 filesystem, :
  224. +  $ icacls myhorribledata.txt /grant "siegfried_wulsch:WD" #
  225. +  - On Linux NFSv4 clients you will then see this:
  226. +  ---- snip ----
  227. +  $ nfs4_getfacl myhorribledata.txt
  228. +  A::OWNER@:rwatTcCy
  229. +  A::siegfried_wulsch@global.loc:rwatcy
  230. +  A::GROUP@:rtcy
  231. +  A::EVERYONE@:rtcy
  232. +  ---- snip ----
  233. +
  234. +
  235. +#
  236. +# Known issues:
  237. +#
  238. +- The kernel driver ("nfs41_driver.sys") does not have a cryptographic
  239. +  signature for SecureBoot - which means it will only work if SecureBoot
  240. +  is turned off (otherwise $ /sbin/msnfs41client install # will FAIL!)
  241. +- If nfsd_debug.exe crashes or gets killed, the only safe way
  242. +  to run it again requires a reboot
  243. +- LDAP support does not work yet
  244. +- Attribute caching is to agressiv, making $ tail -f ... # not seeing
  245. +  new data.
  246. +  Workaround: Use GNU tail'S $ tail --follow=name ... #
  247. +- krb5p security with AES keys do not work against the linux server,
  248. +  as it does not support gss krb5 v2 tokens with rotated data.
  249. +- When recovering opens and locks outside of the server's grace period,
  250. +  client does not check whether the file has been modified by another
  251. +  client.
  252. +- If nfsd.exe is restarted while a drive is mapped, that drive needs
  253. +  to be remounted before further use.
  254. +- Does not allow renaming a file on top of an existing open file.
  255. +  Connectathon's special test op_ren has been commented out.
  256. +- Extended attributes are supported with some limitations:
  257. +  a) the server must support NFS Named Attributes,
  258. +  b) the order of listings cannot be guaranteed by NFS, and
  259. +  c) the EaSize field cannot be reported for directory queries of
  260. +  FileBothDirInformation, FileFullDirInfo, or FileIdFullDirInfo.
  261. +
  262. +# EOF.
  263. +
  264. --
  265. 2.42.1
  266.  
  267. From 15c98413e99fd71086e3e91f53e167c9d5226ac8 Mon Sep 17 00:00:00 2001
  268. From: Roland Mainz <roland.mainz@nrubsig.org>
  269. Date: Thu, 14 Dec 2023 15:40:44 +0100
  270. Subject: [PATCH 3/3] sys/nfs41_driver: Put %wZ/%s in quotes to see space in
  271.  debug output
  272.  
  273. Put %wZ/%s in single quotes (e.g. %wZ ---> '%wZ', %s ---> '%s') to
  274. make it easier to see space characters in debug output.
  275.  
  276. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  277. ---
  278. sys/nfs41_driver.c | 82 +++++++++++++++++++++++-----------------------
  279.  1 file changed, 41 insertions(+), 41 deletions(-)
  280.  
  281. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  282. index b9e0f86..3b467d1 100644
  283. --- a/sys/nfs41_driver.c
  284. +++ b/sys/nfs41_driver.c
  285. @@ -495,7 +495,7 @@ void print_debug_header(
  286.      PIO_STACK_LOCATION IrpSp = RxContext->CurrentIrpSp;
  287.  
  288.      if (IrpSp) {
  289. -        DbgP("FileOject %p name %wZ access r=%d,w=%d,d=%d share r=%d,w=%d,d=%d\n",
  290. +        DbgP("FileOject %p name '%wZ' access r=%d,w=%d,d=%d share r=%d,w=%d,d=%d\n",
  291.              IrpSp->FileObject, &IrpSp->FileObject->FileName,
  292.              IrpSp->FileObject->ReadAccess, IrpSp->FileObject->WriteAccess,
  293.              IrpSp->FileObject->DeleteAccess, IrpSp->FileObject->SharedRead,
  294. @@ -539,7 +539,7 @@ NTSTATUS marshall_unicode_as_utf8(
  295.      status = RtlUnicodeToUTF8N(NULL, 0xffff,
  296.          &ActualCount, str->Buffer, str->Length);
  297.      if (status) {
  298. -        print_error("RtlUnicodeToUTF8N('%wZ') failed with 0x%08X\n",
  299. +        print_error("RtlUnicodeToUTF8N('%wZ') failed with 0x%08X\n",
  300.              str, status);
  301.          goto out;
  302.      }
  303. @@ -550,7 +550,7 @@ NTSTATUS marshall_unicode_as_utf8(
  304.      status = RtlUnicodeToUTF8N(ansi.Buffer, ansi.MaximumLength,
  305.          &ActualCount, str->Buffer, str->Length);
  306.      if (status) {
  307. -        print_error("RtlUnicodeToUTF8N(%hu, '%wZ', %hu) failed with 0x%08X\n",
  308. +        print_error("RtlUnicodeToUTF8N(%hu, '%wZ', %hu) failed with 0x%08X\n",
  309.              ansi.MaximumLength, str, str->Length, status);
  310.          goto out;
  311.      }
  312. @@ -595,7 +595,7 @@ NTSTATUS marshal_nfs41_header(
  313.  
  314.  #ifdef DEBUG_MARSHAL_HEADER
  315.      if (MmIsAddressValid(entry->filename))
  316. -        DbgP("[upcall header] xid=%lld opcode=%s filename=%wZ version=%d "
  317. +        DbgP("[upcall header] xid=%lld opcode='%s' filename='%wZ' version=%d "
  318.              "session=0x%x open_state=0x%x\n", entry->xid,
  319.              ENTRY_OPCODE2STRING(entry), entry->filename,
  320.              entry->version, entry->session, entry->open_state);
  321. @@ -657,8 +657,8 @@ NTSTATUS marshal_nfs41_mount(
  322.      *len = header_len;
  323.  
  324.  #ifdef DEBUG_MARSHAL_DETAIL
  325. -    DbgP("marshal_nfs41_mount: server name=%wZ mount point=%wZ "
  326. -         "sec_flavor=%s rsize=%d wsize=%d\n",
  327. +    DbgP("marshal_nfs41_mount: server name='%wZ' mount point='%wZ' "
  328. +         "sec_flavor='%s' rsize=%d wsize=%d\n",
  329.          entry->u.Mount.srv_name, entry->u.Mount.root,
  330.           secflavorop2name(entry->u.Mount.sec_flavor), entry->u.Mount.rsize,
  331.           entry->u.Mount.wsize);
  332. @@ -751,7 +751,7 @@ NTSTATUS marshal_nfs41_open(
  333.      *len = header_len;
  334.  
  335.  #ifdef DEBUG_MARSHAL_DETAIL
  336. -    DbgP("marshal_nfs41_open: name=%wZ mask=0x%x access=0x%x attrs=0x%x "
  337. +    DbgP("marshal_nfs41_open: name='%wZ' mask=0x%x access=0x%x attrs=0x%x "
  338.           "opts=0x%x dispo=0x%x open_owner_id=0x%x mode=%o "
  339.  #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
  340.           "owner_local_uid=%lu owner_group_local_gid=%lu "
  341. @@ -937,7 +937,7 @@ NTSTATUS marshal_nfs41_close(
  342.      *len = header_len;
  343.  
  344.  #ifdef DEBUG_MARSHAL_DETAIL
  345. -    DbgP("marshal_nfs41_close: name=%wZ remove=%d srv_open=%p renamed=%d\n",
  346. +    DbgP("marshal_nfs41_close: name='%wZ' remove=%d srv_open=%p renamed=%d\n",
  347.          entry->filename->Length?entry->filename:&SLASH,
  348.          entry->u.Close.remove, entry->u.Close.srv_open, entry->u.Close.renamed);
  349.  #endif
  350. @@ -998,7 +998,7 @@ NTSTATUS marshal_nfs41_dirquery(
  351.      *len = header_len;
  352.  
  353.  #ifdef DEBUG_MARSHAL_DETAIL
  354. -    DbgP("marshal_nfs41_dirquery: filter='%wZ'class=%d len=%d "
  355. +    DbgP("marshal_nfs41_dirquery: filter='%wZ'class=%d len=%d "
  356.           "1st\\restart\\single=%d\\%d\\%d\n", entry->u.QueryFile.filter,
  357.           entry->u.QueryFile.InfoClass, entry->buf_len,
  358.           entry->u.QueryFile.initial_query, entry->u.QueryFile.restart_scan,
  359. @@ -1073,7 +1073,7 @@ NTSTATUS marshal_nfs41_fileset(
  360.      *len = header_len;
  361.  
  362.  #ifdef DEBUG_MARSHAL_DETAIL
  363. -    DbgP("marshal_nfs41_fileset: filename='%wZ' class=%d\n",
  364. +    DbgP("marshal_nfs41_fileset: filename='%wZ' class=%d\n",
  365.          entry->filename, entry->u.SetFile.InfoClass);
  366.  #endif
  367.  out:
  368. @@ -1111,7 +1111,7 @@ NTSTATUS marshal_nfs41_easet(
  369.      *len = header_len;
  370.  
  371.  #ifdef DEBUG_MARSHAL_DETAIL
  372. -    DbgP("marshal_nfs41_easet: filename=%wZ, buflen=%d mode=0x%x\n",
  373. +    DbgP("marshal_nfs41_easet: filename='%wZ', buflen=%d mode=0x%x\n",
  374.          entry->filename, entry->buf_len, entry->u.SetEa.mode);
  375.  #endif
  376.  out:
  377. @@ -1158,7 +1158,7 @@ NTSTATUS marshal_nfs41_eaget(
  378.      *len = header_len;
  379.  
  380.  #ifdef DEBUG_MARSHAL_DETAIL
  381. -    DbgP("marshal_nfs41_eaget: filename=%wZ, index=%d list_len=%d "
  382. +    DbgP("marshal_nfs41_eaget: filename='%wZ', index=%d list_len=%d "
  383.          "rescan=%d single=%d\n", entry->filename,
  384.          entry->u.QueryEa.EaIndex, entry->u.QueryEa.EaListLength,
  385.          entry->u.QueryEa.RestartScan, entry->u.QueryEa.ReturnSingleEntry);
  386. @@ -1200,7 +1200,7 @@ NTSTATUS marshal_nfs41_symlink(
  387.      *len = header_len;
  388.  
  389.  #ifdef DEBUG_MARSHAL_DETAIL
  390. -    DbgP("marshal_nfs41_symlink: name %wZ symlink target %wZ\n",
  391. +    DbgP("marshal_nfs41_symlink: name '%wZ' symlink target '%wZ'\n",
  392.           entry->filename,
  393.           entry->u.Symlink.set?entry->u.Symlink.target : NULL);
  394.  #endif
  395. @@ -1323,7 +1323,7 @@ void nfs41_invalidate_cache (
  396.  
  397.      RtlCopyMemory(&srv_open, buf, sizeof(HANDLE));
  398.  #ifdef DEBUG_INVALIDATE_CACHE
  399. -    DbgP("nfs41_invalidate_cache: received srv_open=%p %wZ\n",
  400. +    DbgP("nfs41_invalidate_cache: received srv_open=%p '%wZ'\n",
  401.          srv_open, srv_open->pAlreadyPrefixedName);
  402.  #endif
  403.      if (MmIsAddressValid(srv_open))
  404. @@ -1619,7 +1619,7 @@ void unmarshal_nfs41_header(
  405.      RtlCopyMemory(&tmp->errno, *buf, sizeof(tmp->errno));
  406.      *buf += sizeof(tmp->errno);
  407.  #ifdef DEBUG_MARSHAL_HEADER
  408. -    DbgP("[downcall header] xid=%lld opcode=%s status=%d errno=%d\n", tmp->xid,
  409. +    DbgP("[downcall header] xid=%lld opcode='%s' status=%d errno=%d\n", tmp->xid,
  410.          ENTRY_OPCODE2STRING(tmp), tmp->status, tmp->errno);
  411.  #endif
  412.  }
  413. @@ -1735,7 +1735,7 @@ NTSTATUS unmarshal_nfs41_open(
  414.          RtlCopyMemory(cur->u.Open.symlink.Buffer, *buf,
  415.              cur->u.Open.symlink.MaximumLength);
  416.  #ifdef DEBUG_MARSHAL_DETAIL
  417. -        DbgP("unmarshal_nfs41_open: ERROR_REPARSE -> '%wZ'\n", &cur->u.Open.symlink);
  418. +        DbgP("unmarshal_nfs41_open: ERROR_REPARSE -> '%wZ'\n", &cur->u.Open.symlink);
  419.  #endif
  420.      }
  421.  #ifdef DEBUG_MARSHAL_DETAIL
  422. @@ -2523,12 +2523,12 @@ NTSTATUS _nfs41_CreateSrvCall(
  423.  
  424.      // validate the server name with the test name of 'pnfs'
  425.  #ifdef DEBUG_MOUNT
  426. -    DbgP("SrvCall: Connection Name Length: %d %wZ\n",
  427. +    DbgP("SrvCall: Connection Name Length: %d '%wZ'\n",
  428.          pSrvCall->pSrvCallName->Length, pSrvCall->pSrvCallName);
  429.  #endif
  430.  
  431.      if (pSrvCall->pSrvCallName->Length > SERVER_NAME_BUFFER_SIZE) {
  432. -        print_error("Server name '%wZ' too long for server entry (max %u)\n",
  433. +        print_error("Server name '%wZ' too long for server entry (max %u)\n",
  434.              pSrvCall->pSrvCallName, SERVER_NAME_BUFFER_SIZE);
  435.          status = STATUS_NAME_TOO_LONG;
  436.          goto out;
  437. @@ -2640,7 +2640,7 @@ NTSTATUS nfs41_mount(
  438.  
  439.  #ifdef DEBUG_MOUNT
  440.      DbgEn();
  441. -    DbgP("Server Name %wZ Mount Point %wZ SecFlavor %d\n",
  442. +    DbgP("Server Name '%wZ' Mount Point '%wZ' SecFlavor %d\n",
  443.          &config->SrvName, &config->MntPt, sec_flavor);
  444.  #endif
  445.      status = nfs41_UpcallCreate(NFS41_MOUNT, NULL, *session,
  446. @@ -2736,11 +2736,11 @@ NTSTATUS nfs41_MountConfig_ParseDword(
  447.                  *Value = Minimum;
  448.              if (*Value > Maximum)
  449.                  *Value = Maximum;
  450. -            DbgP("    '%ls' -> '%wZ' -> %lu\n", Name, usValue, *Value);
  451. +            DbgP("    '%ls' -> '%wZ' -> %lu\n", Name, usValue, *Value);
  452.  #endif
  453.          }
  454.          else
  455. -            print_error("Failed to convert %s='%wZ' to unsigned long.\n",
  456. +            print_error("Failed to convert '%s'='%wZ' to unsigned long.\n",
  457.                  Name, usValue);
  458.      }
  459.  
  460. @@ -2846,7 +2846,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
  461.          }
  462.          else {
  463.              status = STATUS_INVALID_PARAMETER;
  464. -            print_error("Unrecognized option '%ls' -> '%wZ'\n",
  465. +            print_error("Unrecognized option '%ls' -> '%wZ'\n",
  466.                  Name, usValue);
  467.          }
  468.  
  469. @@ -2983,7 +2983,7 @@ NTSTATUS nfs41_CreateVNetRoot(
  470.      print_v_net_root(0, pVNetRoot);
  471.  
  472.      DbgP("pVNetRoot=%p pNetRoot=%p pSrvCall=%p\n", pVNetRoot, pNetRoot, pSrvCall);
  473. -    DbgP("pNetRoot=%wZ Type=%d pSrvCallName=%wZ VirtualNetRootStatus=0x%x "
  474. +    DbgP("pNetRoot='%wZ' Type=%d pSrvCallName='%wZ' VirtualNetRootStatus=0x%x "
  475.          "NetRootStatus=0x%x\n", pNetRoot->pNetRootName,
  476.          pNetRoot->Type, pSrvCall->pSrvCallName,
  477.          pCreateNetRootContext->VirtualNetRootStatus,
  478. @@ -3003,7 +3003,7 @@ NTSTATUS nfs41_CreateVNetRoot(
  479.       * only claim paths of the form '\\server\nfs4\path' */
  480.      status = has_nfs_prefix(pSrvCall->pSrvCallName, pNetRoot->pNetRootName);
  481.      if (status) {
  482. -        print_error("nfs41_CreateVNetRoot: NetRootName %wZ doesn't match "
  483. +        print_error("nfs41_CreateVNetRoot: NetRootName '%wZ' doesn't match "
  484.              "'\\nfs4'!\n", pNetRoot->pNetRootName);
  485.          goto out;
  486.      }
  487. @@ -3291,7 +3291,7 @@ VOID nfs41_ExtractNetRootName(
  488.      NetRootName->Length = NetRootName->MaximumLength
  489.                  = (USHORT)((PCHAR)w - (PCHAR)wlow);
  490.  #ifdef DEBUG_MOUNT
  491. -    DbgP("In: pSrvCall %p PathName=%wZ SrvCallName=%wZ Out: NetRootName=%wZ\n",
  492. +    DbgP("In: pSrvCall %p PathName='%wZ' SrvCallName='%wZ' Out: NetRootName='%wZ'\n",
  493.          SrvCall, FilePathName, SrvCall->pSrvCallName, NetRootName);
  494.  #endif
  495.      return;
  496. @@ -3857,8 +3857,8 @@ retry_on_link:
  497.          status = RxPrepareToReparseSymbolicLink(RxContext,
  498.              entry->u.Open.symlink_embedded, &AbsPath, TRUE, &ReparseRequired);
  499.  #ifdef DEBUG_OPEN
  500. -        DbgP("RxPrepareToReparseSymbolicLink(%u, '%wZ') returned %08lX, "
  501. -            "FileName is '%wZ'\n", entry->u.Open.symlink_embedded,
  502. +        DbgP("RxPrepareToReparseSymbolicLink(%u, '%wZ') returned %08lX, "
  503. +            "FileName is '%wZ'\n", entry->u.Open.symlink_embedded,
  504.              &AbsPath, status, &RxContext->CurrentIrpSp->FileObject->FileName);
  505.  #endif
  506.          if (status == STATUS_SUCCESS) {
  507. @@ -3966,7 +3966,7 @@ retry_on_link:
  508.                  !nfs41_fcb->StandardInfo.Directory) {
  509.          ULONG flag = DISABLE_CACHING;
  510.  #ifdef DEBUG_OPEN
  511. -        DbgP("nfs41_Create: reopening (changed) file %wZ\n",
  512. +        DbgP("nfs41_Create: reopening (changed) file '%wZ'\n",
  513.              SrvOpen->pAlreadyPrefixedName);
  514.  #endif
  515.          RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  516. @@ -4256,7 +4256,7 @@ void print_debug_filedirquery_header(
  517.      PRX_CONTEXT RxContext)
  518.  {
  519.      print_debug_header(RxContext);
  520. -    DbgP("FileName='%wZ', InfoClass = %s\n",
  521. +    DbgP("FileName='%wZ', InfoClass = '%s'\n",
  522.          GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(RxContext),
  523.          print_file_information_class(RxContext->Info.FileInformationClass));
  524.  }
  525. @@ -4265,7 +4265,7 @@ void print_querydir_args(
  526.      PRX_CONTEXT RxContext)
  527.  {
  528.      print_debug_filedirquery_header(RxContext);
  529. -    DbgP("Filter='%wZ', Index=%d, Restart/Single/Specified/Init=%d/%d/%d/%d\n",
  530. +    DbgP("Filter='%wZ', Index=%d, Restart/Single/Specified/Init=%d/%d/%d/%d\n",
  531.          &RxContext->pFobx->UnicodeQueryTemplate,
  532.          RxContext->QueryDirectory.FileIndex,
  533.          RxContext->QueryDirectory.RestartScan,
  534. @@ -4407,7 +4407,7 @@ void print_queryvolume_args(
  535.      PRX_CONTEXT RxContext)
  536.  {
  537.      print_debug_header(RxContext);
  538. -    DbgP("FileName='%wZ', InfoClass = %s BufferLen = %d\n",
  539. +    DbgP("FileName='%wZ', InfoClass = '%s' BufferLen = %d\n",
  540.          GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(RxContext),
  541.          print_fs_information_class(RxContext->Info.FileInformationClass),
  542.          RxContext->Info.LengthRemaining);
  543. @@ -5611,7 +5611,7 @@ NTSTATUS check_nfs41_setattr_args(
  544.          UNICODE_STRING dst = { (USHORT)rinfo->FileNameLength,
  545.              (USHORT)rinfo->FileNameLength, rinfo->FileName };
  546.  #ifdef DEBUG_FILE_SET
  547. -        DbgP("Attempting to rename to '%wZ'\n", &dst);
  548. +        DbgP("Attempting to rename to '%wZ'\n", &dst);
  549.  #endif
  550.          if (isFilenameTooLong(&dst, pVNetRootContext)) {
  551.              status = STATUS_OBJECT_NAME_INVALID;
  552. @@ -5630,7 +5630,7 @@ NTSTATUS check_nfs41_setattr_args(
  553.          UNICODE_STRING dst = { (USHORT)linfo->FileNameLength,
  554.              (USHORT)linfo->FileNameLength, linfo->FileName };
  555.  #ifdef DEBUG_FILE_SET
  556. -        DbgP("Attempting to add link as '%wZ'\n", &dst);
  557. +        DbgP("Attempting to add link as '%wZ'\n", &dst);
  558.  #endif
  559.          if (isFilenameTooLong(&dst, pVNetRootContext)) {
  560.              status = STATUS_OBJECT_NAME_INVALID;
  561. @@ -5851,7 +5851,7 @@ NTSTATUS nfs41_ComputeNewBufferingState(
  562.              FCB_STATE_WRITECACHING_ENABLED | FCB_STATE_WRITEBUFFERING_ENABLED);
  563.      }
  564.  #ifdef DEBUG_TIME_BASED_COHERENCY
  565. -    DbgP("nfs41_ComputeNewBufferingState: %wZ pSrvOpen %p Old %08x New %08x\n",
  566. +    DbgP("nfs41_ComputeNewBufferingState: '%wZ' pSrvOpen %p Old %08x New %08x\n",
  567.           pSrvOpen->pAlreadyPrefixedName, pSrvOpen, oldFlags,
  568.           pSrvOpen->BufferingFlags);
  569.      *pNewBufferingState = pSrvOpen->BufferingFlags;
  570. @@ -5909,7 +5909,7 @@ void enable_caching(
  571.                  nfs41_fcb_list_entry, next);
  572.          if (cur->fcb == SrvOpen->pFcb) {
  573.  #ifdef DEBUG_TIME_BASED_COHERENCY
  574. -            DbgP("enable_caching: Looked&Found match for fcb=%p %wZ\n",
  575. +            DbgP("enable_caching: Looked&Found match for fcb=%p '%wZ'\n",
  576.                  SrvOpen->pFcb, SrvOpen->pAlreadyPrefixedName);
  577.  #endif
  578.              cur->skip = FALSE;
  579. @@ -5918,7 +5918,7 @@ void enable_caching(
  580.          }
  581.          if (pEntry->Flink == &openlist.head) {
  582.  #ifdef DEBUG_TIME_BASED_COHERENCY
  583. -            DbgP("enable_caching: reached EOL looking for fcb=%p %wZ\n",
  584. +            DbgP("enable_caching: reached EOL looking for fcb=%p '%wZ'\n",
  585.                  SrvOpen->pFcb, SrvOpen->pAlreadyPrefixedName);
  586.  #endif
  587.              break;
  588. @@ -6483,13 +6483,13 @@ void print_reparse_buffer(
  589.          Reparse->SymbolicLinkReparseBuffer.SubstituteNameOffset/sizeof(WCHAR)];
  590.      name.MaximumLength = name.Length =
  591.          Reparse->SymbolicLinkReparseBuffer.SubstituteNameLength;
  592. -    DbgP("SubstituteName:       %wZ\n", &name);
  593. +    DbgP("SubstituteName:       '%wZ'\n", &name);
  594.  
  595.      name.Buffer = &Reparse->SymbolicLinkReparseBuffer.PathBuffer[
  596.          Reparse->SymbolicLinkReparseBuffer.PrintNameOffset/sizeof(WCHAR)];
  597.      name.MaximumLength = name.Length =
  598.          Reparse->SymbolicLinkReparseBuffer.PrintNameLength;
  599. -    DbgP("PrintName:            %wZ\n", &name);
  600. +    DbgP("PrintName:            '%wZ'\n", &name);
  601.  }
  602.  
  603.  NTSTATUS check_nfs41_setreparse_args(
  604. @@ -6757,7 +6757,7 @@ NTSTATUS nfs41_FsdDispatch (
  605.      DbgEn();
  606.      DbgP("CURRENT IRP = %d.%d\n", IrpSp->MajorFunction, IrpSp->MinorFunction);
  607.      if(IrpSp->FileObject)
  608. -        DbgP("FileOject %p Filename %wZ\n", IrpSp->FileObject,
  609. +        DbgP("FileOject %p Filename '%wZ'\n", IrpSp->FileObject,
  610.                  &IrpSp->FileObject->FileName);
  611.  #endif
  612.  
  613. @@ -6993,7 +6993,7 @@ VOID fcbopen_main(PVOID ctx)
  614.                      if (srv_open->DesiredAccess &
  615.                              (FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA)) {
  616.  #ifdef DEBUG_TIME_BASED_COHERENCY
  617. -                        DbgP("fcbopen_main: ************ Invalidate the cache %wZ"
  618. +                        DbgP("fcbopen_main: ************ Invalidate the cache '%wZ'"
  619.                               "************\n", srv_open->pAlreadyPrefixedName);
  620.  #endif
  621.                          RxIndicateChangeOfBufferingStateForSrvOpen(
  622. @@ -7075,7 +7075,7 @@ NTSTATUS DriverEntry(
  623.          &dev_exts->VolAttrsLen);
  624.  
  625.      RtlInitUnicodeString(&user_dev_name, NFS41_SHADOW_DEVICE_NAME);
  626. -    DbgP("calling IoCreateSymbolicLink %wZ %wZ\n", &user_dev_name, &dev_name);
  627. +    DbgP("calling IoCreateSymbolicLink '%wZ' '%wZ'\n", &user_dev_name, &dev_name);
  628.      status = IoCreateSymbolicLink(&user_dev_name, &dev_name);
  629.      if (status != STATUS_SUCCESS) {
  630.          print_error("Device name IoCreateSymbolicLink failed: %08lx\n", status);
  631. --
  632. 2.42.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