- From fdd1ee29166828696e26ffd45037b626188b2575 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 9 Apr 2025 17:25:04 +0200
- Subject: [PATCH 1/4] tests: nfs_ea: EA names are not $'\0'-terminated, we need
- to use |EaNameLength|
- nfs_ea: EA names are not $'\0'-terminated, we need to use |EaNameLength|
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/ea/main.c | 21 ++++++++++++++++-----
- 1 file changed, 16 insertions(+), 5 deletions(-)
- diff --git a/tests/ea/main.c b/tests/ea/main.c
- index d4e818f..fe6655d 100644
- --- a/tests/ea/main.c
- +++ b/tests/ea/main.c
- @@ -1,5 +1,6 @@
- /* NFSv4.1 client for Windows
- - * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- @@ -73,7 +74,10 @@ on_overflow:
- }
- while (EaBuffer) {
- - printf("%s = %.*s\n", EaBuffer->EaName, EaBuffer->EaValueLength,
- + (void)printf("'%.*s' = '%.*s'\n",
- + EaBuffer->EaNameLength,
- + EaBuffer->EaName,
- + EaBuffer->EaValueLength,
- EaBuffer->EaName + EaBuffer->EaNameLength + 1);
- if (EaBuffer->NextEntryOffset == 0)
- @@ -148,9 +152,13 @@ static NTSTATUS ea_get(
- }
- while (EaBuffer) {
- - printf("%s = %.*s\n", EaBuffer->EaName, EaBuffer->EaValueLength,
- + (void)printf("'%.*s' = '%.*s'\n",
- + EaBuffer->EaNameLength,
- + EaBuffer->EaName,
- + EaBuffer->EaValueLength,
- EaBuffer->EaName + EaBuffer->EaNameLength + 1);
- +
- if (EaBuffer->NextEntryOffset == 0)
- break;
- EaBuffer = (PFILE_FULL_EA_INFORMATION)
- @@ -197,7 +205,7 @@ static NTSTATUS ea_get_nfs3attr(
- goto out;
- }
- - (void)printf("%s:\n", EaBuffer->EaName);
- + (void)printf("%.*s:\n", EaBuffer->EaNameLength, EaBuffer->EaName);
- nfs3_attrs *n3a = (void *)(EaBuffer->EaName + EaBuffer->EaNameLength + 1);
- (void)printf("(\n"
- "\ttype=%d\n"
- @@ -289,7 +297,10 @@ static NTSTATUS ea_set(
- status = ZwSetEaFile(FileHandle, &IoStatusBlock, EaBuffer, EaLength);
- switch (status) {
- case STATUS_SUCCESS:
- - printf("%s = %.*s\n", EaBuffer->EaName, EaBuffer->EaValueLength,
- + (void)printf("'%.*s' = '%.*s'\n",
- + EaBuffer->EaNameLength,
- + EaBuffer->EaName,
- + EaBuffer->EaValueLength,
- EaBuffer->EaName + EaBuffer->EaNameLength + 1);
- break;
- default:
- --
- 2.45.1
- From 8fabb9e6b521a7ce4645c5c88ae59a7936f4842e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 9 Apr 2025 17:34:52 +0200
- Subject: [PATCH 2/4] tests: nfs_ea: Add Cygwin usage example
- nfs_ea: Add Cygwin usage example
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/ea/main.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
- diff --git a/tests/ea/main.c b/tests/ea/main.c
- index fe6655d..fb99e36 100644
- --- a/tests/ea/main.c
- +++ b/tests/ea/main.c
- @@ -330,8 +330,9 @@ int wmain(int argc, const wchar_t *argv[])
- if (argc < 3) {
- fwprintf(stderr, L"Usage: nfs_ea <ntobjectpath> <create|set|get|getnfs3attr|list> ...\n");
- - fwprintf(stderr, L"Example:\n");
- + fwprintf(stderr, L"Examples:\n");
- fwprintf(stderr, L"\tnfs_ea '\\??\\L:\\builds\\bash_build1' getnfs3attr\n");
- + fwprintf(stderr, L"\tnfs_ea \"\\\\??\\\\$(cygpath -w \"$PWD/bash_build1\")\" getnfs3attr\n");
- status = STATUS_INVALID_PARAMETER;
- goto out;
- }
- --
- 2.45.1
- From 776becd75360e6e02a994f0e4b59fc9aebcf5c43 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 9 Apr 2025 17:40:06 +0200
- Subject: [PATCH 3/4] tests: Fix typo in nfs_server_setup, /etc/groups should
- be /etc/group
- Fix typo in nfs_server_setup, /etc/groups should be /etc/group.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/nfs_server_setup.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
- index df90d3d..83c2ff6 100644
- --- a/tests/nfs_server_setup.txt
- +++ b/tests/nfs_server_setup.txt
- @@ -76,8 +76,8 @@ zfs set sync=disabled rpool
- ##### 2. Windows ms-nfs41-client setup:
- # Add entries for groups "sys" and "nobody" used by Solaris nfsd
- -printf "sys:S-1-0-3:3:\n" >>/etc/groups
- -printf "nobody:S-1-0-65534:65534:\n" >>/etc/group
- +printf "sys:S-1-0-3:3:\n" >>'/etc/group'
- +printf "nobody:S-1-0-65534:65534:\n" >>'/etc/group'
- ##### 3. Misc commands:
- ls -v filename # list ACLs
- --
- 2.45.1
- From 17c3383c1c7f562133b3b5658e1ba84037030771 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 9 Apr 2025 19:01:05 +0200
- Subject: [PATCH 4/4] cygwin: msnfs41client.bash should create "sys"+"nobody"
- /etc/group entries
- msnfs41client.bash should create "sys"+"nobody" /etc/group entries
- required by Solaris/Illumos nfsd if they do not exist yet.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/devel/msnfs41client.bash | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 4a391dd..004a11e 100755
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -281,6 +281,23 @@ function nfsclient_install
- # query new 'ms-nfs41-client-globalmountall-service'
- sc query 'ms-nfs41-client-globalmountall-service'
- + #
- + # Add entries for groups "sys" and "nobody" used by
- + # Solaris/Illumos nfsd
- + #
- + if { getent group 'sys' >'/dev/null' 2>&1 ; (( $? == 2 )) ; } ; then
- + {
- + printf '# "sys" entry added by ms-nfs41-client for Solaris/Illumos nfsd\n'
- + printf "sys:S-1-0-3:3:\n"
- + } >>'/etc/group'
- + fi
- + if { getent group 'nobody' >'/dev/null' 2>&1 ; (( $? == 2 )) ; } ; then
- + {
- + printf '# "nobody" entry added by ms-nfs41-client for Solaris/Illumos nfsd\n'
- + printf "nobody:S-1-0-65534:65534:\n"
- + } >>'/etc/group'
- + fi
- +
- #
- # check whether ksh93 works
- # (The ms-nfs41-client cygwin idmapper uses ksh93 scripts for
- --
- 2.45.1
msnfs41client: Patches for nfs_ea util, install Cygwin sys/nobody+misc, 2025-04-09
Posted by Anonymous on Wed 9th Apr 2025 18:20
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.