pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for Solaris/Illumos nfsd setup, XATTR tests, cleanup+misc, 2025-03-25
Posted by Anonymous on Tue 25th Mar 2025 18:52
raw | new post

  1. From b3ffa9c6ec6cad361d767f3abd67262f5d94882c Mon Sep 17 00:00:00 2001
  2. From: Dan Shelton <dan.f.shelton@gmail.com>
  3. Date: Tue, 25 Mar 2025 15:31:00 +0100
  4. Subject: [PATCH 1/6] sys: Fix DbgP() format typos in symlink code
  5.  
  6. Fix DbgP() format typos in nfs41_SetSymlinkReparsePoint() and
  7. nfs41_GetSymlinkReparsePoint(), s/0xlx/0x%lx/.
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. sys/nfs41sys_symlink.c | 4 ++--
  12.  1 file changed, 2 insertions(+), 2 deletions(-)
  13.  
  14. diff --git a/sys/nfs41sys_symlink.c b/sys/nfs41sys_symlink.c
  15. index fdfd4fc..51c6720 100644
  16. --- a/sys/nfs41sys_symlink.c
  17. +++ b/sys/nfs41sys_symlink.c
  18. @@ -266,7 +266,7 @@ NTSTATUS nfs41_SetSymlinkReparsePoint(
  19.      if (status) {
  20.          DbgP("nfs41_SetSymlinkReparsePoint: "
  21.              "check_nfs41_setsymlinkreparse_args() failed, "
  22. -            "status=0xlx\n",
  23. +            "status=0x%lx\n",
  24.                  (long)status);
  25.          goto out;
  26.      }
  27. @@ -572,7 +572,7 @@ NTSTATUS nfs41_GetSymlinkReparsePoint(
  28.      if (status) {
  29.          DbgP("nfs41_GetSymlinkReparsePoint: "
  30.              "check_nfs41_getsymlinkreparse_args() failed, "
  31. -            "status=0xlx\n",
  32. +            "status=0x%lx\n",
  33.                  (long)status);
  34.          goto out;
  35.      }
  36. --
  37. 2.45.1
  38.  
  39. From 8960a33b69db135d0d1f63e06af326f0d72c0038 Mon Sep 17 00:00:00 2001
  40. From: Dan Shelton <dan.f.shelton@gmail.com>
  41. Date: Tue, 25 Mar 2025 15:38:32 +0100
  42. Subject: [PATCH 2/6] daemon "%o" numbers in printf()-like format should always
  43.  be prefixed with "0"
  44.  
  45. Octal "%o" numbers in printf()-like format should always be prefixed
  46. with "0".
  47.  
  48. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  49. ---
  50. daemon/ea.c   | 2 +-
  51.  daemon/open.c | 8 ++++----
  52.  2 files changed, 5 insertions(+), 5 deletions(-)
  53.  
  54. diff --git a/daemon/ea.c b/daemon/ea.c
  55. index dcc8465..b9e68b7 100644
  56. --- a/daemon/ea.c
  57. +++ b/daemon/ea.c
  58. @@ -192,7 +192,7 @@ static int parse_setexattr(unsigned char *buffer, uint32_t length, nfs41_upcall
  59.      if (status) goto out;
  60.      args->buf = buffer;
  61.  
  62. -    DPRINTF(1, ("parsing NFS41_SYSOP_EA_SET: mode=%o\n", args->mode));
  63. +    DPRINTF(1, ("parsing NFS41_SYSOP_EA_SET: mode=0%o\n", args->mode));
  64.  out:
  65.      return status;
  66.  }
  67. diff --git a/daemon/open.c b/daemon/open.c
  68. index f63b6ae..00bdac9 100644
  69. --- a/daemon/open.c
  70. +++ b/daemon/open.c
  71. @@ -417,7 +417,7 @@ static int parse_open(unsigned char *buffer, uint32_t length, nfs41_upcall *upca
  72.  #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
  73.      DPRINTF(1, ("parsing NFS41_SYSOP_OPEN: filename='%s' access mask=%d "
  74.          "access mode=%d\n\tfile attrs=0x%x create attrs=0x%x "
  75. -        "(kernel) disposition=%d\n\topen_owner_id=%d mode=%o "
  76. +        "(kernel) disposition=%d\n\topen_owner_id=%d mode=0%o "
  77.          "owner_local_uid=%u owner_group_local_gid=%u "
  78.          "srv_open=0x%p symlink=%s ea=0x%p\n", args->path, args->access_mask,
  79.          args->access_mode, args->file_attrs, args->create_opts,
  80. @@ -428,7 +428,7 @@ static int parse_open(unsigned char *buffer, uint32_t length, nfs41_upcall *upca
  81.  #else
  82.      DPRINTF(1, ("parsing NFS41_SYSOP_OPEN: filename='%s' access mask=%d "
  83.          "access mode=%d\n\tfile attrs=0x%x create attrs=0x%x "
  84. -        "(kernel) disposition=%d\n\topen_owner_id=%d mode=%o "
  85. +        "(kernel) disposition=%d\n\topen_owner_id=%d mode=0%o "
  86.          "srv_open=0x%p symlink=%s ea=0x%p\n", args->path, args->access_mask,
  87.          args->access_mode, args->file_attrs, args->create_opts,
  88.          args->disposition, args->open_owner_id, args->mode,
  89. @@ -1077,7 +1077,7 @@ supersede_retry:
  90.          } else {
  91.              createattrs.attrmask.arr[0] |= FATTR4_WORD0_SIZE;
  92.              createattrs.size = 0;
  93. -            DPRINTF(1, ("creating with mod %o\n", args->mode));
  94. +            DPRINTF(1, ("creating with mode 0%o\n", args->mode));
  95.              status = open_or_delegate(state, create, createhowmode, &createattrs,
  96.                  TRUE, &info);
  97.              if (status == NFS4_OK && state->delegation.state)
  98. @@ -1234,7 +1234,7 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
  99.      DPRINTF(2, ("NFS41_SYSOP_OPEN: downcall "
  100.          "open_state=0x%p "
  101.          "fileid=0x%llx fsid=(0x%llx.0x%llx) "
  102. -        "mode=0o%o changeattr=0x%llu\n",
  103. +        "mode=0%o changeattr=0x%llu\n",
  104.          upcall->state_ref,
  105.          (unsigned long long)args->fileid,
  106.          (unsigned long long)args->fsid_major,
  107. --
  108. 2.45.1
  109.  
  110. From 6681e33fce92dfd248c53bda4253942b5f9ac52e Mon Sep 17 00:00:00 2001
  111. From: Dan Shelton <dan.f.shelton@gmail.com>
  112. Date: Tue, 25 Mar 2025 15:49:07 +0100
  113. Subject: [PATCH 3/6] daemon "%x" numbers in printf()-like format should always
  114.  be prefixed with "0x"
  115.  
  116. Hexadecimal "%x" numbers in printf()-like format should always be prefixed
  117. with "0x".
  118.  
  119. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  120. ---
  121. daemon/acl.c              |  2 +-
  122.  daemon/delegation.c       |  9 ++++---
  123.  daemon/nfs41_ops.c        |  4 +--
  124.  daemon/nfs41_superblock.c |  2 +-
  125.  daemon/open.c             | 10 ++++---
  126.  daemon/readdir.c          |  2 +-
  127.  daemon/sid.c              | 55 +++++++++++++++++++++++++--------------
  128.  7 files changed, 53 insertions(+), 31 deletions(-)
  129.  
  130. diff --git a/daemon/acl.c b/daemon/acl.c
  131. index 2021d78..0d90bc2 100644
  132. --- a/daemon/acl.c
  133. +++ b/daemon/acl.c
  134. @@ -1229,7 +1229,7 @@ static int map_dacl_2_nfs4acl(PACL acl, PSID sid, PSID gsid, nfsacl41 *nfs4_acl,
  135.                  print_hexbuf_no_asci("ACE\n",
  136.                      (const unsigned char *)ace, ace->AceSize);
  137.              }
  138. -            DPRINTF(ACLLVL3, ("ACE TYPE: %x\n", ace->AceType));
  139. +            DPRINTF(ACLLVL3, ("ACE TYPE: 0x%x\n", ace->AceType));
  140.              if (ace->AceType == ACCESS_ALLOWED_ACE_TYPE)
  141.                  curr_nfsace->acetype = ACE4_ACCESS_ALLOWED_ACE_TYPE;
  142.              else if (ace->AceType == ACCESS_DENIED_ACE_TYPE)
  143. diff --git a/daemon/delegation.c b/daemon/delegation.c
  144. index 49090ce..57e1342 100644
  145. --- a/daemon/delegation.c
  146. +++ b/daemon/delegation.c
  147. @@ -278,7 +278,8 @@ static int delegation_return(
  148.          unsigned char inbuf[sizeof(HANDLE)], *buffer = inbuf;
  149.          DWORD inbuf_len = sizeof(HANDLE), outbuf_len, dstatus;
  150.          uint32_t length;
  151. -        DPRINTF(1, ("delegation_return: making a downcall for srv_open=%x\n",
  152. +        DPRINTF(1,
  153. +            ("delegation_return: making a downcall for srv_open=0x%x\n",
  154.              deleg->srv_open));
  155.          pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A, GENERIC_READ|GENERIC_WRITE,
  156.                  FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
  157. @@ -502,7 +503,9 @@ int nfs41_delegate_open(
  158.          stateid4_cpy(&stateid.stateid, &deleg->state.stateid);
  159.      }
  160.      if (!status) {
  161. -        DPRINTF(1, ("nfs41_delegate_open: updating srv_open from %x to %x\n",
  162. +        DPRINTF(1,
  163. +            ("nfs41_delegate_open: "
  164. +            "updating srv_open from 0x%x to 0x%x\n",
  165.              deleg->srv_open, state->srv_open));
  166.          deleg->srv_open = state->srv_open;
  167.      }
  168. @@ -618,7 +621,7 @@ void nfs41_delegation_remove_srvopen(
  169.      if (delegation_find(session->client, &file->fh, deleg_file_cmp, &deleg))
  170.          return;
  171.      DPRINTF(1, ("nfs41_delegation_remove_srvopen: removing reference to "
  172. -        "srv_open=%x\n", deleg->srv_open));
  173. +        "srv_open=0x%x\n", deleg->srv_open));
  174.      AcquireSRWLockExclusive(&deleg->lock);
  175.      deleg->srv_open = NULL;
  176.      ReleaseSRWLockExclusive(&deleg->lock);
  177. diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
  178. index 2ffaaeb..23e1be9 100644
  179. --- a/daemon/nfs41_ops.c
  180. +++ b/daemon/nfs41_ops.c
  181. @@ -211,7 +211,7 @@ int nfs41_create_session(nfs41_client *clnt, nfs41_session *session, bool_t try_
  182.      } else clnt->seq_id++;
  183.  
  184.      if (reply.csr_flags != req.csa_flags) {
  185. -        eprintf("WARNING: requested session flags %x received %x\n",
  186. +        eprintf("WARNING: requested session flags 0x%x received 0x%x\n",
  187.              req.csa_flags, reply.csr_flags);
  188.          if ((session->flags & CREATE_SESSION4_FLAG_CONN_BACK_CHAN) &&
  189.                  !(reply.csr_flags & CREATE_SESSION4_FLAG_CONN_BACK_CHAN))
  190. @@ -224,7 +224,7 @@ int nfs41_create_session(nfs41_client *clnt, nfs41_session *session, bool_t try_
  191.          session->flags = reply.csr_flags;
  192.      }
  193.      else {
  194. -        DPRINTF(1, ("session flags %x\n", reply.csr_flags));
  195. +        DPRINTF(1, ("session flags 0x%x\n", reply.csr_flags));
  196.      }
  197.  
  198.      DPRINTF(1, ("session fore_chan_attrs:\n"
  199. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  200. index af94a8b..b73cf45 100644
  201. --- a/daemon/nfs41_superblock.c
  202. +++ b/daemon/nfs41_superblock.c
  203. @@ -203,7 +203,7 @@ void nfs41_superblock_fs_attributes(
  204.          "case_insensitive=%u, "
  205.          "aclsupport=%u, "
  206.          "MaximumComponentNameLength=%u, "
  207. -        "FileSystemAttributes=%lx\n",
  208. +        "FileSystemAttributes=0x%lx\n",
  209.          superblock->link_support,
  210.          superblock->symlink_support,
  211.          superblock->ea_support,
  212. diff --git a/daemon/open.c b/daemon/open.c
  213. index 00bdac9..95d724a 100644
  214. --- a/daemon/open.c
  215. +++ b/daemon/open.c
  216. @@ -321,7 +321,8 @@ static int do_open(
  217.          &state->file, &delegation, TRUE, &deleg_state);
  218.      if (deleg_state) {
  219.          deleg_state->srv_open = state->srv_open;
  220. -        DPRINTF(1, ("do_open: received delegation: saving srv_open = %x\n",
  221. +        DPRINTF(1, ("do_open: "
  222. +            "received delegation: saving srv_open = 0x%x\n",
  223.              state->srv_open));
  224.      }
  225.  
  226. @@ -1306,8 +1307,11 @@ static int parse_close(unsigned char *buffer, uint32_t length, nfs41_upcall *upc
  227.          if (status) goto out;
  228.      }
  229.  
  230. -    DPRINTF(1, ("parsing NFS41_SYSOP_CLOSE: remove=%d srv_open=%x renamed=%d "
  231. -        "filename='%s'\n", args->remove, args->srv_open, args->renamed,
  232. +    DPRINTF(1,
  233. +        ("parsing NFS41_SYSOP_CLOSE: "
  234. +        "remove=%d srv_open=0x%x renamed=%d "
  235. +        "filename='%s'\n",
  236. +        args->remove, args->srv_open, args->renamed,
  237.          args->remove ? args->path : ""));
  238.  out:
  239.      return status;
  240. diff --git a/daemon/readdir.c b/daemon/readdir.c
  241. index 75a6cf3..9711dba 100644
  242. --- a/daemon/readdir.c
  243. +++ b/daemon/readdir.c
  244. @@ -113,7 +113,7 @@ readdir_filter(const char *filter, const char *name)
  245.                  {
  246.                      eprintf("readdir_filter(filter='%s',name='%s'): "
  247.                          "bt buffer too small: "
  248. -                        "bt_pos=%d, MAX_NUM_BACKTRACKING=%x\n",
  249. +                        "bt_pos=%d, MAX_NUM_BACKTRACKING=0x%x\n",
  250.                          filter,
  251.                          name,
  252.                          (int)bt_pos,
  253. diff --git a/daemon/sid.c b/daemon/sid.c
  254. index b7d0736..0ea20ee 100644
  255. --- a/daemon/sid.c
  256. +++ b/daemon/sid.c
  257. @@ -432,7 +432,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  258.      signed long group_gid = -1;
  259.  #endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
  260.  
  261. -    DPRINTF(ACLLVL, ("--> map_nfs4servername_2_sid(query=%x,nfsname='%s')\n",
  262. +    DPRINTF(ACLLVL,
  263. +        ("--> map_nfs4servername_2_sid(query=0x%x,nfsname='%s')\n",
  264.          query, nfsname));
  265.  
  266.  #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
  267. @@ -511,7 +512,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  268.      if (status) {
  269.          /* |LookupAccountNameA()| success */
  270.  
  271. -        DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  272. +        DPRINTF(ACLLVL,
  273. +            ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  274.              "LookupAccountNameA() returned status=%d "
  275.              "GetLastError=%d *sid_len=%d domain_buff='%s' domain_len=%d\n",
  276.              query, nfsname, status, GetLastError(), *sid_len, domain_buff,
  277. @@ -523,7 +525,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  278.      }
  279.  
  280.      /* |LookupAccountNameA()| failed... */
  281. -    DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  282. +    DPRINTF(ACLLVL,
  283. +        ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  284.          "LookupAccountNameA() returned status=%d "
  285.          "GetLastError=%d\n",
  286.          query, nfsname, status, GetLastError()));
  287. @@ -535,7 +538,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  288.           * This should never happen, as |SECURITY_MAX_SID_SIZE| is
  289.           * the largest possible SID buffer size for Windows
  290.           */
  291. -        eprintf("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  292. +        eprintf("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  293.                  "LookupAccountName failed with "
  294.                  "ERROR_INSUFFICIENT_BUFFER\n", query, nfsname);
  295.  
  296. @@ -544,7 +547,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  297.          break;
  298.      case ERROR_NONE_MAPPED:
  299.  #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
  300. -        DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  301. +        DPRINTF(1,
  302. +            ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  303.              "none mapped, "
  304.              "trying Unix_User+/Unix_Group+ mapping\n",
  305.              query, nfsname));
  306. @@ -558,7 +562,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  307.              }
  308.              else {
  309.                  DPRINTF(0,
  310. -                    ("map_nfs4servername_2_sid(query=%x,name='%s'): "
  311. +                    ("map_nfs4servername_2_sid(query=0x%x,name='%s'): "
  312.                      "nfs41_idmap_name_to_uid() failed\n",
  313.                      query, nfsname));
  314.                  /* fixme: try harder here, "1234" should to to |atol()| */
  315. @@ -575,7 +579,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  316.                  group_gid = map_gid;
  317.              }
  318.              else {
  319. -                DPRINTF(0, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): nfs41_idmap_group_to_gid() failed\n",
  320. +                DPRINTF(0,
  321. +                    ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): nfs41_idmap_group_to_gid() failed\n",
  322.                      query, nfsname));
  323.                  /* fixme: try harder here, "1234" should to to |atol()| */
  324.              }
  325. @@ -583,7 +588,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  326.  
  327.          if (user_uid != -1) {
  328.              if (allocate_unixuser_sid(user_uid, sid)) {
  329. -                DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  330. +                DPRINTF(ACLLVL,
  331. +                    ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  332.                      "allocate_unixuser_sid(uid=%ld) success\n",
  333.                      query, nfsname, user_uid));
  334.                  status = ERROR_SUCCESS;
  335. @@ -592,7 +598,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  336.              }
  337.  
  338.              status = GetLastError();
  339. -            DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  340. +            DPRINTF(ACLLVL,
  341. +                ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  342.                  "allocate_unixuser_sid(uid=%ld) failed, error=%d\n",
  343.                  query, nfsname, user_uid, status));
  344.              goto out;
  345. @@ -600,7 +607,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  346.  
  347.          if (group_gid != -1) {
  348.              if (allocate_unixgroup_sid(group_gid, sid)) {
  349. -                DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  350. +                DPRINTF(ACLLVL,
  351. +                    ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  352.                      "allocate_unixgroup_sid(gid=%ld) success\n",
  353.                      query, nfsname, group_gid));
  354.                  status = ERROR_SUCCESS;
  355. @@ -609,14 +617,16 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  356.              }
  357.  
  358.              status = GetLastError();
  359. -            DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  360. +            DPRINTF(ACLLVL,
  361. +                ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  362.                  "allocate_unixgroup_sid(gid=%ld) failed, error=%d\n",
  363.                  query, nfsname, group_gid, status));
  364.              goto out;
  365.          }
  366.  #endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
  367.  
  368. -        DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): none mapped, "
  369. +        DPRINTF(1,
  370. +            ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): none mapped, "
  371.              "using WinNullSid mapping\n",
  372.              query, nfsname));
  373.  
  374. @@ -625,7 +635,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  375.              goto out_free_sid;
  376.          break;
  377.      default:
  378. -        DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): error %d not handled\n",
  379. +        DPRINTF(1,
  380. +            ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): error %d not handled\n",
  381.              query, nfsname, GetLastError()));
  382.          break;
  383.      }
  384. @@ -644,7 +655,8 @@ out_cache:
  385.               * References:
  386.               * - https://stackoverflow.com/questions/39373188/lookupaccountnamew-returns-sidtypealias-but-expected-sidtypegroup
  387.               */
  388. -            DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  389. +            DPRINTF(1,
  390. +                ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  391.                  "SID_TYPE='SidTypeAlias' mapped to 'SidTypeGroup'\n",
  392.                  query, orig_nfsname));
  393.              sid_type = SidTypeGroup;
  394. @@ -654,7 +666,8 @@ out_cache:
  395.          if ((query & OWNER_SECURITY_INFORMATION) &&
  396.              (sid_type == SidTypeWellKnownGroup)) {
  397.              if (!strcmp(orig_nfsname, "SYSTEM")) {
  398. -                DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  399. +                DPRINTF(1,
  400. +                    ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  401.                      "SID_TYPE='SidTypeWellKnownGroup' mapped to 'SidTypeUser' for user\n",
  402.                      query, orig_nfsname));
  403.                  sid_type = SidTypeUser;
  404. @@ -665,7 +678,8 @@ out_cache:
  405.          switch (sid_type) {
  406.              case SidTypeUser:
  407.                  if (isdigit(orig_nfsname[0])) {
  408. -                    DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  409. +                    DPRINTF(1,
  410. +                        ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  411.                          "adding usercache nfsname='%s' orig_nfsname='%s'\n",
  412.                          query, orig_nfsname, nfsname, orig_nfsname));
  413.                      sidcache_addwithalias(&user_sidcache, nfsname, orig_nfsname, *sid);
  414. @@ -676,7 +690,8 @@ out_cache:
  415.                  break;
  416.              case SidTypeGroup:
  417.                  if (isdigit(orig_nfsname[0])) {
  418. -                    DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  419. +                    DPRINTF(1,
  420. +                        ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  421.                          "adding groupcache nfsname='%s' orig_nfsname='%s'\n",
  422.                          query, orig_nfsname, nfsname, orig_nfsname));
  423.                      sidcache_addwithalias(&group_sidcache, nfsname, orig_nfsname, *sid);
  424. @@ -686,7 +701,7 @@ out_cache:
  425.                  }
  426.                  break;
  427.              default:
  428. -                eprintf("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  429. +                eprintf("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  430.                      "Unknown SID_TYPE=%d\n",
  431.                      query, orig_nfsname, sid_type);
  432.                  break;
  433. @@ -697,7 +712,7 @@ out_cache:
  434.  out:
  435.      if (DPRINTF_LEVEL_ENABLED(ACLLVL)) {
  436.          if (status) {
  437. -            dprintf_out("<-- map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  438. +            dprintf_out("<-- map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  439.                  "status=%d\n", query, nfsname, status);
  440.          }
  441.          else {
  442. @@ -711,7 +726,7 @@ out:
  443.                  sidstr = errsidstrbuf;
  444.              }
  445.  
  446. -            dprintf_out("<-- map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
  447. +            dprintf_out("<-- map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
  448.                  "status=%d sidstr='%s' *sid_len=%d\n",
  449.                  query, nfsname, status, sidstr, *sid_len);
  450.  
  451. --
  452. 2.45.1
  453.  
  454. From f5b377c9e0c2f12410e0b950d5acb8c2b2ed6d92 Mon Sep 17 00:00:00 2001
  455. From: Cedric Blancher <cedric.blancher@gmail.com>
  456. Date: Tue, 25 Mar 2025 18:54:23 +0100
  457. Subject: [PATCH 4/6] tests: Solaris+Illumos NFS server setup instructions
  458.  should not use the ZFS root pool for NFS exports
  459.  
  460. Solaris+Illumos NFS server setup instructions should not use the ZFS
  461. root pool for NFS exports, because the ZFS ROOT pool in OpenIndiana is
  462. mounted without the "xattr" mount option, preventing non-"root" users
  463. from creating NFSv4.1/NFSv4.2 XATTR (extended attributes).
  464.  
  465. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  466. ---
  467. tests/nfs_server_setup.txt | 20 ++++++++++++++------
  468.  1 file changed, 14 insertions(+), 6 deletions(-)
  469.  
  470. diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
  471. index 6d0ffcc..6262fd0 100644
  472. --- a/tests/nfs_server_setup.txt
  473. +++ b/tests/nfs_server_setup.txt
  474. @@ -57,9 +57,13 @@ sharectl set -p nfsmapid_domain=global.loc nfs
  475.  sharectl set -p server_delegation=on nfs
  476.  
  477.  # prepare test share
  478. -mkdir /nfsdata
  479. -chmod a+rwx /nfsdata
  480. -share -p -F nfs -o rw /nfsdata
  481. +# (ZFS ROOT pool (e.g. "/nfsdata") cannot be used because '/'
  482. +# in the OpenIndiana distribution is mounted without the "xattr"
  483. +# mount option, see https://www.illumos.org/issues/17323
  484. +# ("NFSv4.1 server refuses creation of XATTR")
  485. +mkdir -p /export/nfsdata
  486. +chmod a+rwxt /export/nfsdata
  487. +share -p -F nfs -o rw /export/nfsdata
  488.  
  489.  # verify whether mapid and nfs/server are running
  490.  svcs network/nfs/mapid
  491. @@ -100,9 +104,13 @@ sharectl set -p server_delegation=on nfs
  492.  sharectl set -p server_versmax=4.2 nfs
  493.  
  494.  # prepare test share
  495. -mkdir /nfsdata
  496. -chmod a+rwx /nfsdata
  497. -share -p -F nfs -o rw /nfsdata
  498. +# (ZFS ROOT pool (e.g. "/nfsdata") cannot be used because '/'
  499. +# in the OpenIndiana distribution is mounted without the "xattr"
  500. +# mount option, see https://www.illumos.org/issues/17323
  501. +# ("NFSv4.1 server refuses creation of XATTR")
  502. +mkdir -p /export/nfsdata
  503. +chmod a+rwxt /export/nfsdata
  504. +share -p -F nfs -o rw /export/nfsdata
  505.  
  506.  # verify whether mapid and nfs/server are running
  507.  svcs network/nfs/mapid
  508. --
  509. 2.45.1
  510.  
  511. From 025d344b7a76d1aaa5b720a48d3bf43d2f3bf6ca Mon Sep 17 00:00:00 2001
  512. From: Roland Mainz <roland.mainz@nrubsig.org>
  513. Date: Tue, 25 Mar 2025 19:37:45 +0100
  514. Subject: [PATCH 5/6] daemon: Disable |OP_READ_PLUS| usage only for
  515.  |NFS4ERR_IO|
  516.  
  517. Disable |OP_READ_PLUS| usage only for |NFS4ERR_IO|, and update
  518. the warning that we disable |OP_READ_PLUS| in this case.
  519.  
  520. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  521. ---
  522. daemon/readwrite.c | 8 ++++++--
  523.  1 file changed, 6 insertions(+), 2 deletions(-)
  524.  
  525. diff --git a/daemon/readwrite.c b/daemon/readwrite.c
  526. index a474904..fcf1749 100644
  527. --- a/daemon/readwrite.c
  528. +++ b/daemon/readwrite.c
  529. @@ -82,8 +82,12 @@ static int read_from_mds(
  530.              status = nfs42_read_plus(session, file, stateid,
  531.                  args->offset + reloffset, chunk,
  532.                  p, &bytes_read, &eof);
  533. -            if (status) {
  534. -                DPRINTF(0, ("nfs42_read_plus() failed, status=%d\n", status));
  535. +            if (status == NFS4ERR_IO) {
  536. +                DPRINTF(0,
  537. +                    ("read_from_mds: "
  538. +                    "nfs42_read_plus() failed, status=%d, "
  539. +                    "disabling OP_READ_PLUS\n",
  540. +                    status));
  541.                  session->client->root->supports_nfs42_read_plus = false;
  542.              }
  543.          }
  544. --
  545. 2.45.1
  546.  
  547. From 9dc09914ee5583d5e71f70b9a28d291d77391d43 Mon Sep 17 00:00:00 2001
  548. From: Roland Mainz <roland.mainz@nrubsig.org>
  549. Date: Tue, 25 Mar 2025 19:44:05 +0100
  550. Subject: [PATCH 6/6] tests: Add XATTR test case for $ cp --preserve=xattr ...
  551.  #
  552.  
  553. Add XATTR test case for $ cp --preserve=xattr ... #
  554.  
  555. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  556. ---
  557. tests/manual_testing.txt | 8 +++++++-
  558.  1 file changed, 7 insertions(+), 1 deletion(-)
  559.  
  560. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  561. index 12fba86..57c4861 100644
  562. --- a/tests/manual_testing.txt
  563. +++ b/tests/manual_testing.txt
  564. @@ -385,7 +385,7 @@ icacls mytestfile1.txt | grep --colour -E 'cygwingrp2.+GR'
  565.  
  566.  1. One-liner:
  567.  ---- snip ----
  568. -$ ksh93 -c 'set -o xtrace -o errexit ; rm -f x1 ; touch x1 ; attr -q -s "fish5" -V "hello lake world" x1 ; [[ "$(attr -q -l x1)" == *fish5* ]] || echo FAIL ; [[ "$(attr -q -g "fish5" x1)" == "hello lake world" ]] || echo "FAIL" ; attr -q -r "fish5" x1 ; echo "# Test OK"'
  569. +ksh93 -c 'set -o xtrace -o errexit ; rm -f x1 x1_copy1 ; touch x1 ; attr -q -s "fish5" -V "hello lake world" x1 ; [[ "$(attr -q -l x1)" == *fish5* ]] || echo FAIL ; cp --preserve=xattr x1 x1_copy1 ; [[ "$(attr -q -g "fish5" x1_copy1)" == "hello lake world" ]] || echo "FAIL" ; attr -q -r "fish5" x1 ; echo "# Test OK"'
  570.  ---- snip ----
  571.  
  572.  2. Detailed test:
  573. @@ -416,6 +416,12 @@ $ attr -g chicken3 myattrfile
  574.  Attribute "chicken3" had a 11 byte value for myattrfile:
  575.  hello world
  576.  
  577. +# copy file with xattr, get value of "chicken3" from copied file (should be "hello world")
  578. +$ cp --preserve=xattr myattrfile myattrfile_copy1
  579. +$ attr -g chicken3 myattrfile_copy1
  580. +Attribute "chicken3" had a 11 byte value for myattrfile_copy1:
  581. +hello world
  582. +
  583.  # remove attribute "chicken3", try to get it (should fail)
  584.  $ attr -r chicken3 myattrfile
  585.  $ attr -g chicken3 myattrfile
  586. --
  587. 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