- From b3ffa9c6ec6cad361d767f3abd67262f5d94882c Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Tue, 25 Mar 2025 15:31:00 +0100
- Subject: [PATCH 1/6] sys: Fix DbgP() format typos in symlink code
- Fix DbgP() format typos in nfs41_SetSymlinkReparsePoint() and
- nfs41_GetSymlinkReparsePoint(), s/0xlx/0x%lx/.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_symlink.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/sys/nfs41sys_symlink.c b/sys/nfs41sys_symlink.c
- index fdfd4fc..51c6720 100644
- --- a/sys/nfs41sys_symlink.c
- +++ b/sys/nfs41sys_symlink.c
- @@ -266,7 +266,7 @@ NTSTATUS nfs41_SetSymlinkReparsePoint(
- if (status) {
- DbgP("nfs41_SetSymlinkReparsePoint: "
- "check_nfs41_setsymlinkreparse_args() failed, "
- - "status=0xlx\n",
- + "status=0x%lx\n",
- (long)status);
- goto out;
- }
- @@ -572,7 +572,7 @@ NTSTATUS nfs41_GetSymlinkReparsePoint(
- if (status) {
- DbgP("nfs41_GetSymlinkReparsePoint: "
- "check_nfs41_getsymlinkreparse_args() failed, "
- - "status=0xlx\n",
- + "status=0x%lx\n",
- (long)status);
- goto out;
- }
- --
- 2.45.1
- From 8960a33b69db135d0d1f63e06af326f0d72c0038 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Tue, 25 Mar 2025 15:38:32 +0100
- Subject: [PATCH 2/6] daemon "%o" numbers in printf()-like format should always
- be prefixed with "0"
- Octal "%o" numbers in printf()-like format should always be prefixed
- with "0".
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/ea.c | 2 +-
- daemon/open.c | 8 ++++----
- 2 files changed, 5 insertions(+), 5 deletions(-)
- diff --git a/daemon/ea.c b/daemon/ea.c
- index dcc8465..b9e68b7 100644
- --- a/daemon/ea.c
- +++ b/daemon/ea.c
- @@ -192,7 +192,7 @@ static int parse_setexattr(unsigned char *buffer, uint32_t length, nfs41_upcall
- if (status) goto out;
- args->buf = buffer;
- - DPRINTF(1, ("parsing NFS41_SYSOP_EA_SET: mode=%o\n", args->mode));
- + DPRINTF(1, ("parsing NFS41_SYSOP_EA_SET: mode=0%o\n", args->mode));
- out:
- return status;
- }
- diff --git a/daemon/open.c b/daemon/open.c
- index f63b6ae..00bdac9 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -417,7 +417,7 @@ static int parse_open(unsigned char *buffer, uint32_t length, nfs41_upcall *upca
- #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- DPRINTF(1, ("parsing NFS41_SYSOP_OPEN: filename='%s' access mask=%d "
- "access mode=%d\n\tfile attrs=0x%x create attrs=0x%x "
- - "(kernel) disposition=%d\n\topen_owner_id=%d mode=%o "
- + "(kernel) disposition=%d\n\topen_owner_id=%d mode=0%o "
- "owner_local_uid=%u owner_group_local_gid=%u "
- "srv_open=0x%p symlink=%s ea=0x%p\n", args->path, args->access_mask,
- args->access_mode, args->file_attrs, args->create_opts,
- @@ -428,7 +428,7 @@ static int parse_open(unsigned char *buffer, uint32_t length, nfs41_upcall *upca
- #else
- DPRINTF(1, ("parsing NFS41_SYSOP_OPEN: filename='%s' access mask=%d "
- "access mode=%d\n\tfile attrs=0x%x create attrs=0x%x "
- - "(kernel) disposition=%d\n\topen_owner_id=%d mode=%o "
- + "(kernel) disposition=%d\n\topen_owner_id=%d mode=0%o "
- "srv_open=0x%p symlink=%s ea=0x%p\n", args->path, args->access_mask,
- args->access_mode, args->file_attrs, args->create_opts,
- args->disposition, args->open_owner_id, args->mode,
- @@ -1077,7 +1077,7 @@ supersede_retry:
- } else {
- createattrs.attrmask.arr[0] |= FATTR4_WORD0_SIZE;
- createattrs.size = 0;
- - DPRINTF(1, ("creating with mod %o\n", args->mode));
- + DPRINTF(1, ("creating with mode 0%o\n", args->mode));
- status = open_or_delegate(state, create, createhowmode, &createattrs,
- TRUE, &info);
- if (status == NFS4_OK && state->delegation.state)
- @@ -1234,7 +1234,7 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
- DPRINTF(2, ("NFS41_SYSOP_OPEN: downcall "
- "open_state=0x%p "
- "fileid=0x%llx fsid=(0x%llx.0x%llx) "
- - "mode=0o%o changeattr=0x%llu\n",
- + "mode=0%o changeattr=0x%llu\n",
- upcall->state_ref,
- (unsigned long long)args->fileid,
- (unsigned long long)args->fsid_major,
- --
- 2.45.1
- From 6681e33fce92dfd248c53bda4253942b5f9ac52e Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Tue, 25 Mar 2025 15:49:07 +0100
- Subject: [PATCH 3/6] daemon "%x" numbers in printf()-like format should always
- be prefixed with "0x"
- Hexadecimal "%x" numbers in printf()-like format should always be prefixed
- with "0x".
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 2 +-
- daemon/delegation.c | 9 ++++---
- daemon/nfs41_ops.c | 4 +--
- daemon/nfs41_superblock.c | 2 +-
- daemon/open.c | 10 ++++---
- daemon/readdir.c | 2 +-
- daemon/sid.c | 55 +++++++++++++++++++++++++--------------
- 7 files changed, 53 insertions(+), 31 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 2021d78..0d90bc2 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -1229,7 +1229,7 @@ static int map_dacl_2_nfs4acl(PACL acl, PSID sid, PSID gsid, nfsacl41 *nfs4_acl,
- print_hexbuf_no_asci("ACE\n",
- (const unsigned char *)ace, ace->AceSize);
- }
- - DPRINTF(ACLLVL3, ("ACE TYPE: %x\n", ace->AceType));
- + DPRINTF(ACLLVL3, ("ACE TYPE: 0x%x\n", ace->AceType));
- if (ace->AceType == ACCESS_ALLOWED_ACE_TYPE)
- curr_nfsace->acetype = ACE4_ACCESS_ALLOWED_ACE_TYPE;
- else if (ace->AceType == ACCESS_DENIED_ACE_TYPE)
- diff --git a/daemon/delegation.c b/daemon/delegation.c
- index 49090ce..57e1342 100644
- --- a/daemon/delegation.c
- +++ b/daemon/delegation.c
- @@ -278,7 +278,8 @@ static int delegation_return(
- unsigned char inbuf[sizeof(HANDLE)], *buffer = inbuf;
- DWORD inbuf_len = sizeof(HANDLE), outbuf_len, dstatus;
- uint32_t length;
- - DPRINTF(1, ("delegation_return: making a downcall for srv_open=%x\n",
- + DPRINTF(1,
- + ("delegation_return: making a downcall for srv_open=0x%x\n",
- deleg->srv_open));
- pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A, GENERIC_READ|GENERIC_WRITE,
- FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- @@ -502,7 +503,9 @@ int nfs41_delegate_open(
- stateid4_cpy(&stateid.stateid, &deleg->state.stateid);
- }
- if (!status) {
- - DPRINTF(1, ("nfs41_delegate_open: updating srv_open from %x to %x\n",
- + DPRINTF(1,
- + ("nfs41_delegate_open: "
- + "updating srv_open from 0x%x to 0x%x\n",
- deleg->srv_open, state->srv_open));
- deleg->srv_open = state->srv_open;
- }
- @@ -618,7 +621,7 @@ void nfs41_delegation_remove_srvopen(
- if (delegation_find(session->client, &file->fh, deleg_file_cmp, &deleg))
- return;
- DPRINTF(1, ("nfs41_delegation_remove_srvopen: removing reference to "
- - "srv_open=%x\n", deleg->srv_open));
- + "srv_open=0x%x\n", deleg->srv_open));
- AcquireSRWLockExclusive(&deleg->lock);
- deleg->srv_open = NULL;
- ReleaseSRWLockExclusive(&deleg->lock);
- diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
- index 2ffaaeb..23e1be9 100644
- --- a/daemon/nfs41_ops.c
- +++ b/daemon/nfs41_ops.c
- @@ -211,7 +211,7 @@ int nfs41_create_session(nfs41_client *clnt, nfs41_session *session, bool_t try_
- } else clnt->seq_id++;
- if (reply.csr_flags != req.csa_flags) {
- - eprintf("WARNING: requested session flags %x received %x\n",
- + eprintf("WARNING: requested session flags 0x%x received 0x%x\n",
- req.csa_flags, reply.csr_flags);
- if ((session->flags & CREATE_SESSION4_FLAG_CONN_BACK_CHAN) &&
- !(reply.csr_flags & CREATE_SESSION4_FLAG_CONN_BACK_CHAN))
- @@ -224,7 +224,7 @@ int nfs41_create_session(nfs41_client *clnt, nfs41_session *session, bool_t try_
- session->flags = reply.csr_flags;
- }
- else {
- - DPRINTF(1, ("session flags %x\n", reply.csr_flags));
- + DPRINTF(1, ("session flags 0x%x\n", reply.csr_flags));
- }
- DPRINTF(1, ("session fore_chan_attrs:\n"
- diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
- index af94a8b..b73cf45 100644
- --- a/daemon/nfs41_superblock.c
- +++ b/daemon/nfs41_superblock.c
- @@ -203,7 +203,7 @@ void nfs41_superblock_fs_attributes(
- "case_insensitive=%u, "
- "aclsupport=%u, "
- "MaximumComponentNameLength=%u, "
- - "FileSystemAttributes=%lx\n",
- + "FileSystemAttributes=0x%lx\n",
- superblock->link_support,
- superblock->symlink_support,
- superblock->ea_support,
- diff --git a/daemon/open.c b/daemon/open.c
- index 00bdac9..95d724a 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -321,7 +321,8 @@ static int do_open(
- &state->file, &delegation, TRUE, &deleg_state);
- if (deleg_state) {
- deleg_state->srv_open = state->srv_open;
- - DPRINTF(1, ("do_open: received delegation: saving srv_open = %x\n",
- + DPRINTF(1, ("do_open: "
- + "received delegation: saving srv_open = 0x%x\n",
- state->srv_open));
- }
- @@ -1306,8 +1307,11 @@ static int parse_close(unsigned char *buffer, uint32_t length, nfs41_upcall *upc
- if (status) goto out;
- }
- - DPRINTF(1, ("parsing NFS41_SYSOP_CLOSE: remove=%d srv_open=%x renamed=%d "
- - "filename='%s'\n", args->remove, args->srv_open, args->renamed,
- + DPRINTF(1,
- + ("parsing NFS41_SYSOP_CLOSE: "
- + "remove=%d srv_open=0x%x renamed=%d "
- + "filename='%s'\n",
- + args->remove, args->srv_open, args->renamed,
- args->remove ? args->path : ""));
- out:
- return status;
- diff --git a/daemon/readdir.c b/daemon/readdir.c
- index 75a6cf3..9711dba 100644
- --- a/daemon/readdir.c
- +++ b/daemon/readdir.c
- @@ -113,7 +113,7 @@ readdir_filter(const char *filter, const char *name)
- {
- eprintf("readdir_filter(filter='%s',name='%s'): "
- "bt buffer too small: "
- - "bt_pos=%d, MAX_NUM_BACKTRACKING=%x\n",
- + "bt_pos=%d, MAX_NUM_BACKTRACKING=0x%x\n",
- filter,
- name,
- (int)bt_pos,
- diff --git a/daemon/sid.c b/daemon/sid.c
- index b7d0736..0ea20ee 100644
- --- a/daemon/sid.c
- +++ b/daemon/sid.c
- @@ -432,7 +432,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- signed long group_gid = -1;
- #endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
- - DPRINTF(ACLLVL, ("--> map_nfs4servername_2_sid(query=%x,nfsname='%s')\n",
- + DPRINTF(ACLLVL,
- + ("--> map_nfs4servername_2_sid(query=0x%x,nfsname='%s')\n",
- query, nfsname));
- #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
- @@ -511,7 +512,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- if (status) {
- /* |LookupAccountNameA()| success */
- - DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(ACLLVL,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "LookupAccountNameA() returned status=%d "
- "GetLastError=%d *sid_len=%d domain_buff='%s' domain_len=%d\n",
- query, nfsname, status, GetLastError(), *sid_len, domain_buff,
- @@ -523,7 +525,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- }
- /* |LookupAccountNameA()| failed... */
- - DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(ACLLVL,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "LookupAccountNameA() returned status=%d "
- "GetLastError=%d\n",
- query, nfsname, status, GetLastError()));
- @@ -535,7 +538,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- * This should never happen, as |SECURITY_MAX_SID_SIZE| is
- * the largest possible SID buffer size for Windows
- */
- - eprintf("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + eprintf("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "LookupAccountName failed with "
- "ERROR_INSUFFICIENT_BUFFER\n", query, nfsname);
- @@ -544,7 +547,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- break;
- case ERROR_NONE_MAPPED:
- #ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "none mapped, "
- "trying Unix_User+/Unix_Group+ mapping\n",
- query, nfsname));
- @@ -558,7 +562,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- }
- else {
- DPRINTF(0,
- - ("map_nfs4servername_2_sid(query=%x,name='%s'): "
- + ("map_nfs4servername_2_sid(query=0x%x,name='%s'): "
- "nfs41_idmap_name_to_uid() failed\n",
- query, nfsname));
- /* fixme: try harder here, "1234" should to to |atol()| */
- @@ -575,7 +579,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- group_gid = map_gid;
- }
- else {
- - DPRINTF(0, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): nfs41_idmap_group_to_gid() failed\n",
- + DPRINTF(0,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): nfs41_idmap_group_to_gid() failed\n",
- query, nfsname));
- /* fixme: try harder here, "1234" should to to |atol()| */
- }
- @@ -583,7 +588,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- if (user_uid != -1) {
- if (allocate_unixuser_sid(user_uid, sid)) {
- - DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(ACLLVL,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "allocate_unixuser_sid(uid=%ld) success\n",
- query, nfsname, user_uid));
- status = ERROR_SUCCESS;
- @@ -592,7 +598,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- }
- status = GetLastError();
- - DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(ACLLVL,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "allocate_unixuser_sid(uid=%ld) failed, error=%d\n",
- query, nfsname, user_uid, status));
- goto out;
- @@ -600,7 +607,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- if (group_gid != -1) {
- if (allocate_unixgroup_sid(group_gid, sid)) {
- - DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(ACLLVL,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "allocate_unixgroup_sid(gid=%ld) success\n",
- query, nfsname, group_gid));
- status = ERROR_SUCCESS;
- @@ -609,14 +617,16 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- }
- status = GetLastError();
- - DPRINTF(ACLLVL, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(ACLLVL,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "allocate_unixgroup_sid(gid=%ld) failed, error=%d\n",
- query, nfsname, group_gid, status));
- goto out;
- }
- #endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): none mapped, "
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): none mapped, "
- "using WinNullSid mapping\n",
- query, nfsname));
- @@ -625,7 +635,8 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- goto out_free_sid;
- break;
- default:
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): error %d not handled\n",
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): error %d not handled\n",
- query, nfsname, GetLastError()));
- break;
- }
- @@ -644,7 +655,8 @@ out_cache:
- * References:
- * - https://stackoverflow.com/questions/39373188/lookupaccountnamew-returns-sidtypealias-but-expected-sidtypegroup
- */
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "SID_TYPE='SidTypeAlias' mapped to 'SidTypeGroup'\n",
- query, orig_nfsname));
- sid_type = SidTypeGroup;
- @@ -654,7 +666,8 @@ out_cache:
- if ((query & OWNER_SECURITY_INFORMATION) &&
- (sid_type == SidTypeWellKnownGroup)) {
- if (!strcmp(orig_nfsname, "SYSTEM")) {
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "SID_TYPE='SidTypeWellKnownGroup' mapped to 'SidTypeUser' for user\n",
- query, orig_nfsname));
- sid_type = SidTypeUser;
- @@ -665,7 +678,8 @@ out_cache:
- switch (sid_type) {
- case SidTypeUser:
- if (isdigit(orig_nfsname[0])) {
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "adding usercache nfsname='%s' orig_nfsname='%s'\n",
- query, orig_nfsname, nfsname, orig_nfsname));
- sidcache_addwithalias(&user_sidcache, nfsname, orig_nfsname, *sid);
- @@ -676,7 +690,8 @@ out_cache:
- break;
- case SidTypeGroup:
- if (isdigit(orig_nfsname[0])) {
- - DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "adding groupcache nfsname='%s' orig_nfsname='%s'\n",
- query, orig_nfsname, nfsname, orig_nfsname));
- sidcache_addwithalias(&group_sidcache, nfsname, orig_nfsname, *sid);
- @@ -686,7 +701,7 @@ out_cache:
- }
- break;
- default:
- - eprintf("map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + eprintf("map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "Unknown SID_TYPE=%d\n",
- query, orig_nfsname, sid_type);
- break;
- @@ -697,7 +712,7 @@ out_cache:
- out:
- if (DPRINTF_LEVEL_ENABLED(ACLLVL)) {
- if (status) {
- - dprintf_out("<-- map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + dprintf_out("<-- map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "status=%d\n", query, nfsname, status);
- }
- else {
- @@ -711,7 +726,7 @@ out:
- sidstr = errsidstrbuf;
- }
- - dprintf_out("<-- map_nfs4servername_2_sid(query=%x,nfsname='%s'): "
- + dprintf_out("<-- map_nfs4servername_2_sid(query=0x%x,nfsname='%s'): "
- "status=%d sidstr='%s' *sid_len=%d\n",
- query, nfsname, status, sidstr, *sid_len);
- --
- 2.45.1
- From f5b377c9e0c2f12410e0b950d5acb8c2b2ed6d92 Mon Sep 17 00:00:00 2001
- From: Cedric Blancher <cedric.blancher@gmail.com>
- Date: Tue, 25 Mar 2025 18:54:23 +0100
- Subject: [PATCH 4/6] tests: Solaris+Illumos NFS server setup instructions
- should not use the ZFS root pool for NFS exports
- Solaris+Illumos NFS server setup instructions should not use the ZFS
- root pool for NFS exports, because the ZFS ROOT pool in OpenIndiana is
- mounted without the "xattr" mount option, preventing non-"root" users
- from creating NFSv4.1/NFSv4.2 XATTR (extended attributes).
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/nfs_server_setup.txt | 20 ++++++++++++++------
- 1 file changed, 14 insertions(+), 6 deletions(-)
- diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
- index 6d0ffcc..6262fd0 100644
- --- a/tests/nfs_server_setup.txt
- +++ b/tests/nfs_server_setup.txt
- @@ -57,9 +57,13 @@ sharectl set -p nfsmapid_domain=global.loc nfs
- sharectl set -p server_delegation=on nfs
- # prepare test share
- -mkdir /nfsdata
- -chmod a+rwx /nfsdata
- -share -p -F nfs -o rw /nfsdata
- +# (ZFS ROOT pool (e.g. "/nfsdata") cannot be used because '/'
- +# in the OpenIndiana distribution is mounted without the "xattr"
- +# mount option, see https://www.illumos.org/issues/17323
- +# ("NFSv4.1 server refuses creation of XATTR")
- +mkdir -p /export/nfsdata
- +chmod a+rwxt /export/nfsdata
- +share -p -F nfs -o rw /export/nfsdata
- # verify whether mapid and nfs/server are running
- svcs network/nfs/mapid
- @@ -100,9 +104,13 @@ sharectl set -p server_delegation=on nfs
- sharectl set -p server_versmax=4.2 nfs
- # prepare test share
- -mkdir /nfsdata
- -chmod a+rwx /nfsdata
- -share -p -F nfs -o rw /nfsdata
- +# (ZFS ROOT pool (e.g. "/nfsdata") cannot be used because '/'
- +# in the OpenIndiana distribution is mounted without the "xattr"
- +# mount option, see https://www.illumos.org/issues/17323
- +# ("NFSv4.1 server refuses creation of XATTR")
- +mkdir -p /export/nfsdata
- +chmod a+rwxt /export/nfsdata
- +share -p -F nfs -o rw /export/nfsdata
- # verify whether mapid and nfs/server are running
- svcs network/nfs/mapid
- --
- 2.45.1
- From 025d344b7a76d1aaa5b720a48d3bf43d2f3bf6ca Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 25 Mar 2025 19:37:45 +0100
- Subject: [PATCH 5/6] daemon: Disable |OP_READ_PLUS| usage only for
- |NFS4ERR_IO|
- Disable |OP_READ_PLUS| usage only for |NFS4ERR_IO|, and update
- the warning that we disable |OP_READ_PLUS| in this case.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/readwrite.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
- diff --git a/daemon/readwrite.c b/daemon/readwrite.c
- index a474904..fcf1749 100644
- --- a/daemon/readwrite.c
- +++ b/daemon/readwrite.c
- @@ -82,8 +82,12 @@ static int read_from_mds(
- status = nfs42_read_plus(session, file, stateid,
- args->offset + reloffset, chunk,
- p, &bytes_read, &eof);
- - if (status) {
- - DPRINTF(0, ("nfs42_read_plus() failed, status=%d\n", status));
- + if (status == NFS4ERR_IO) {
- + DPRINTF(0,
- + ("read_from_mds: "
- + "nfs42_read_plus() failed, status=%d, "
- + "disabling OP_READ_PLUS\n",
- + status));
- session->client->root->supports_nfs42_read_plus = false;
- }
- }
- --
- 2.45.1
- From 9dc09914ee5583d5e71f70b9a28d291d77391d43 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 25 Mar 2025 19:44:05 +0100
- Subject: [PATCH 6/6] tests: Add XATTR test case for $ cp --preserve=xattr ...
- #
- Add XATTR test case for $ cp --preserve=xattr ... #
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 12fba86..57c4861 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -385,7 +385,7 @@ icacls mytestfile1.txt | grep --colour -E 'cygwingrp2.+GR'
- 1. One-liner:
- ---- snip ----
- -$ 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"'
- +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"'
- ---- snip ----
- 2. Detailed test:
- @@ -416,6 +416,12 @@ $ attr -g chicken3 myattrfile
- Attribute "chicken3" had a 11 byte value for myattrfile:
- hello world
- +# copy file with xattr, get value of "chicken3" from copied file (should be "hello world")
- +$ cp --preserve=xattr myattrfile myattrfile_copy1
- +$ attr -g chicken3 myattrfile_copy1
- +Attribute "chicken3" had a 11 byte value for myattrfile_copy1:
- +hello world
- +
- # remove attribute "chicken3", try to get it (should fail)
- $ attr -r chicken3 myattrfile
- $ attr -g chicken3 myattrfile
- --
- 2.45.1
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
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.