pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


msnfs41client streams support
Posted by Anonymous on Thu 25th Sep 2025 17:32
raw | new post

  1. # testcase: powershell -Command 'Get-Content -Path "S:\roland_mainz_dir\eatest\x" -Stream "DATAX"'
  2. diff --git a/daemon/lookup.c b/daemon/lookup.c
  3. index 3257eee..f3dfa81 100644
  4. --- a/daemon/lookup.c
  5. +++ b/daemon/lookup.c
  6. @@ -493,6 +493,17 @@ int nfs41_lookup(
  7.      abs_path_copy(&path, path_inout);
  8.      ReleaseSRWLockShared(&path_inout->lock);
  9.  
  10. +
  11. +    char *streammarker = memchr(path.path, ':', path.len);
  12. +    if (streammarker) {
  13. +        DPRINTF(0, ("nfs41_lookup: found stream '%s', len=%d stream='%s'\n",
  14. +            path.path, path.len, streammarker+1));
  15. +        *streammarker = '\0';
  16. +        path.len = (unsigned short)(streammarker - path.path);
  17. +        DPRINTF(0, ("nfs41_lookup: new base filename '%s', len=%d\n",
  18. +            path.path, path.len));
  19. +    }
  20. +
  21.      path_pos = path.path;
  22.      path_end = path.path + path.len;
  23.  
  24. @@ -548,6 +559,19 @@ int nfs41_lookup(
  25.              casesensitive, path_inout,
  26.              parent_out, target_out, info_out, session_out);
  27.      }
  28. +
  29. +    if ((status == 0) && streammarker) {
  30. +        nfs41_fh namedattrdir_fh = { 0 };
  31. +        enum nfsstat4 nfsstatus;
  32. +
  33. +        nfsstatus = nfs41_rpc_openattr(*session_out, target_out, FALSE, &namedattrdir_fh);
  34. +
  35. +        /*
  36. +         * TODO:
  37. +         * - Issue OP_LOOKUP relative to |namedattrdir_fh|, do a getattr, done
  38. +         * - target_out should be a local variable, and the real target_out should contain the attr data
  39. +         */
  40. +    }
  41.  out:
  42.      DPRINTF(LULVL, ("<-- nfs41_lookup() returning %d\n", status));
  43.      return status;
  44. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  45. index 8777feb..1c7d1c9 100644
  46. --- a/daemon/nfs41_superblock.c
  47. +++ b/daemon/nfs41_superblock.c
  48. @@ -291,8 +291,12 @@ void nfs41_superblock_fs_attributes(
  49.          FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_HARD_LINKS;
  50.      if (superblock->symlink_support)
  51.          FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_REPARSE_POINTS;
  52. -    if (superblock->ea_support)
  53. -        FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_EXTENDED_ATTRIBUTES;
  54. +    if (superblock->ea_support) {
  55. +        FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_EXTENDED_ATTRIBUTES;
  56. +#if 1
  57. +        FsAttrs->FileSystemAttributes |= FILE_NAMED_STREAMS;
  58. +#endif
  59. +    }
  60.      if (superblock->case_preserving)
  61.          FsAttrs->FileSystemAttributes |= FILE_CASE_PRESERVED_NAMES;
  62.      if (!superblock->case_insensitive)
  63. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  64. index ca3b76f..4d52762 100644
  65. --- a/sys/nfs41sys_openclose.c
  66. +++ b/sys/nfs41sys_openclose.c
  67. @@ -510,10 +510,12 @@ NTSTATUS check_nfs41_create_args(
  68.          goto out;
  69.      }
  70.  
  71. +#if 0 /* FIXME: Should depend on fsattr |FILE_NAMED_STREAMS| */
  72.      if (isStream(SrvOpen->pAlreadyPrefixedName)) {
  73.          status = STATUS_NOT_SUPPORTED;
  74.          goto out;
  75.      }
  76. +#endif
  77.  
  78.      if (pVNetRootContext->read_only &&
  79.              (params->DesiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA))) {

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