- From 8ac4e215bffb2b9d6ca7e6ef8298cfe4a2ba1826 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 13 Feb 2024 17:16:27 +0100
- Subject: [PATCH 1/4] tests: Remove cp -p "Function not implemented"
- workarounds in manual_testing
- Remove workarounds for $ cp -p ... # failing with "Function not implemented",
- this issues have been fixed.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 4 ----
- 1 file changed, 4 deletions(-)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 83407a9..3bdb59c 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -67,8 +67,6 @@ cd bash/
- # (this is an automake/autoconf issue, they should trust Cygwin and not use
- # ancient workarounds for issues which no longer exists)
- (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name configure) )
- -# workaround for $ cp -p # failing with "Function not implemented"
- -(set -o xtrace ; sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\2--no-preserve=ownership /g' $(find . -name Makefile -o -name Makefile.in) )
- # run configure
- ./configure --with-curses
- # repeat:
- @@ -112,8 +110,6 @@ cd gcc/
- (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name configure) )
- # run configure
- ./configure
- -# workaround for $ cp -p # failing with "Function not implemented"
- -(set -o xtrace ; sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\2--no-preserve=ownership /g' $(find . -name Makefile -o -name Makefile.in) )
- # repeat:
- make -j4 clean
- (yes | make -j32 all)
- --
- 2.43.0
- From d190ed31bbf8438936d658a361ae48ab14d03316 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 13 Feb 2024 17:19:49 +0100
- Subject: [PATCH 2/4] daemon: Add groupname2sid cache
- Add cache for group name to sid translation.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/sid.c | 56 +++++++++++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 49 insertions(+), 7 deletions(-)
- diff --git a/daemon/sid.c b/daemon/sid.c
- index f0091af..a145607 100644
- --- a/daemon/sid.c
- +++ b/daemon/sid.c
- @@ -197,12 +197,14 @@ typedef struct _sidcache
- /* fixme: need function to deallocate this */
- sidcache user_sidcache = { 0 };
- +sidcache group_sidcache = { 0 };
- void sidcache_init(void)
- {
- DPRINTF(1, ("SID cache init\n"));
- InitializeCriticalSection(&user_sidcache.lock);
- + InitializeCriticalSection(&group_sidcache.lock);
- }
- /* copy SID |value| into cache */
- @@ -309,7 +311,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- const char *orig_name = name;
- int status = ERROR_INTERNAL_ERROR;
- - SID_NAME_USE sid_type;
- + SID_NAME_USE sid_type = 0;
- char name_buff[256+2];
- LPSTR tmp_buf = NULL;
- DWORD tmp = 0;
- @@ -327,7 +329,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- #ifdef NFS41_DRIVER_SID_CACHE
- if (*sid = sidcache_getcached(&user_sidcache, name)) {
- *sid_len = GetLengthSid(*sid);
- - DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for '%s'\n", name));
- + DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for user '%s'\n", name));
- return 0;
- }
- #endif /* NFS41_DRIVER_SID_CACHE */
- @@ -338,7 +340,36 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- if (!cygwin_getent_passwd(name, name_buff, &udummy, &gdummy)) {
- if (strcmp(name, name_buff)) {
- DPRINTF(1,
- - ("map_nfs4servername_2_sid: remap '%s' --> '%s'\n",
- + ("map_nfs4servername_2_sid: remap user '%s' --> '%s'\n",
- + name,
- + name_buff));
- + name = name_buff;
- + }
- + }
- + }
- +#endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
- +
- +
- +#ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
- + /* use our own idmapper script to map nfsv4 owner string to local Windows account */
- + if (query & GROUP_SECURITY_INFORMATION) {
- + gid_t gdummy = -1;
- +
- +#ifdef NFS41_DRIVER_SID_CACHE
- + if (*sid = sidcache_getcached(&group_sidcache, name)) {
- + *sid_len = GetLengthSid(*sid);
- + DPRINTF(1, ("map_nfs4servername_2_sid: returning cached sid for group '%s'\n", name));
- + return 0;
- + }
- +#endif /* NFS41_DRIVER_SID_CACHE */
- +
- +#ifndef NFS41_DRIVER_SID_CACHE
- + /* gisburn: fixme: We must cache this, or the performance impact will be devastating!! */
- +#endif /* !NFS41_DRIVER_SID_CACHE */
- + if (!cygwin_getent_group(name, name_buff, &gdummy)) {
- + if (strcmp(name, name_buff)) {
- + DPRINTF(1,
- + ("map_nfs4servername_2_sid: remap group '%s' --> '%s'\n",
- name,
- name_buff));
- name = name_buff;
- @@ -441,6 +472,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- "allocate_unixuser_sid(uid=%ld) success\n",
- query, name, user_uid));
- status = ERROR_SUCCESS;
- + sid_type = SidTypeUser;
- goto out;
- }
- @@ -457,6 +489,7 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- "allocate_unixgroup_sid(gid=%ld) success\n",
- query, name, group_gid));
- status = ERROR_SUCCESS;
- + sid_type = SidTypeGroup;
- goto out;
- }
- @@ -483,10 +516,19 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
- }
- out:
- #ifdef NFS41_DRIVER_SID_CACHE
- - if (*sid) {
- - /* fixme: No other flags in |query| must be set!! */
- - if (query & OWNER_SECURITY_INFORMATION) {
- - sidcache_add(&user_sidcache, orig_name, *sid);
- + if ((status == 0) && *sid) {
- + switch (sid_type) {
- + case SidTypeUser:
- + sidcache_add(&user_sidcache, orig_name, *sid);
- + break;
- + case SidTypeGroup:
- + sidcache_add(&group_sidcache, orig_name, *sid);
- + break;
- + default:
- + eprintf("map_nfs4servername_2_sid(query=%x,name='%s'): "
- + "Unknown SID_TYPE=%d\n",
- + query, orig_name, sid_type);
- + break;
- }
- }
- #endif /* NFS41_DRIVER_SID_CACHE */
- --
- 2.43.0
- From b265a119a2de39f5f2fa5843d51d33482c3faa0e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 13 Feb 2024 17:33:51 +0100
- Subject: [PATCH 3/4] Update binary tarball readme for nfs:// workflow and
- install/deinstall
- Update binary tarball readme about nfs://-URL workflow, nfsurlconv
- script, reboots for install and deinstall etc.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 9 +++++++++
- 1 file changed, 9 insertions(+)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index b66c34b..54808d3 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -25,6 +25,8 @@ NFSv4.1 client and filesystem driver for Windows 10/11
- client can use different ports per mount)
- - Support for nfs://-URL
- + * Why ? nfs://-URLs are crossplatform, portable and Character-Encoding
- + independent descriptions of NFSv4 server resources (exports).
- - including custom ports and raw IPv6 addresses
- - nfs://-URL conversion utility (/usr/bin/nfsurlconv) to convert
- URLs, including non-ASCII/Unicode characters in mount path
- @@ -99,12 +101,14 @@ $ wget 'http://www.nrubsig.org/people/gisburn/work/msnfs41client/releases/testin
- #
- $ (cd / && tar -xf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 )
- $ /sbin/msnfs41client install
- +<REBOOT>
- #
- # 6. Deinstallation:
- #
- $ (set -x ; cd / && tar -tf ~/download/msnfs41client_cygwin_binaries_git148e927_20231214_12h31m.tar.bz2 | while read i ; do [[ -f "$i" ]] && rm "$i" ; done)
- +<REBOOT>
- #
- @@ -163,6 +167,11 @@ $ /sbin/nfs_mount
- Unix_User+id/Unix_Group+id SIDs, and all others are mapped
- to nobody/nogroup SIDs.
- +- Workflow for nfs://-URLs:
- + - Create nfs://-URLs with nfsurlconv, read $ nfsurlconv --man # for usage
- + - pass URL to nfs_mount.exe like this:
- + $ nfs_mount -o sec=sys,rw 'L' nfs://derfwnb4966_ipv4//bigdisk #
- +
- - Cygwin symlinks are supported, but might require
- $ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 #.
- This includes symlinks to UNC paths, e.g. as Admin
- --
- 2.43.0
- From 9e3f0b13d0f36740a36421c16eef8d50dec83d4a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 13 Feb 2024 17:43:15 +0100
- Subject: [PATCH 4/4] cygwin: nfsurlconf should be in /bin, not /sbin
- nfsurlconf should be installed in /bin, not /sbin
- Reported-by: Martin Wege <martin.l.wege@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index bffadaf..e2953c7 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -90,8 +90,8 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
- /usr/bin/ksh93 $(CYGWIN_MAKEFILE_DIR)/utils/mount_sshnfs/mount_sshnfs.ksh --nroff 2>"$(DESTDIR)/cygdrive/c/cygwin64/sbin/usr/share/man/man1/mount_sshnfs.1" || true
- cp $(CYGWIN_MAKEFILE_DIR)/utils/sshnfs/sshnfs.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs
- chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs
- - cp $(CYGWIN_MAKEFILE_DIR)/utils/nfsurlconv/nfsurlconv.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/nfsurlconv
- - chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/nfsurlconv
- + cp $(CYGWIN_MAKEFILE_DIR)/utils/nfsurlconv/nfsurlconv.ksh $(DESTDIR)/cygdrive/c/cygwin64/bin/nfsurlconv
- + chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/bin/nfsurlconv
- /usr/bin/ksh93 $(CYGWIN_MAKEFILE_DIR)/utils/nfsurlconv/nfsurlconv.ksh --nroff 2>"$(DESTDIR)/cygdrive/c/cygwin64/sbin/usr/share/man/man1/nfsurlconv.1" || true
- @ printf "# Package tests\n"
- cp "$(PROJECT_BASEDIR_DIR)/tests/winfsinfo1/winfsinfo.exe" $(DESTDIR)/cygdrive/c/cygwin64/bin/winfsinfo.exe
- --
- 2.43.0
msnfs41client: Patches for groupname2sid cache+nfsurlconf path+misc, 2024-02-13
Posted by Anonymous on Tue 13th Feb 2024 17:17
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.