- From 3ae3e2c16631af693444764a894a4a6c73cdd036 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 5 Aug 2024 13:53:04 +0200
- Subject: [PATCH 1/6] sys: Fix invalid |cur->nfs41_fobx| pointer crash in
- |fcbopen_main()|
- Fix invalid |cur->nfs41_fobx| pointer kernel crash in |fcbopen_main()|.
- Stack trace looks like this:
- ---- snip ----
- nt!KeBugCheckEx
- nt!MiSystemFault+0x1ccd81
- nt!MmAccessFault+0x400
- nt!KiPageFault+0x36d
- nfs41_driver!fcbopen_main+0x105 [ms-nfs41-client\sys\nfs41_driver.c @ 7516]
- nt!PspSystemThreadStartup+0x55
- nt!KiStartSystemThread+0x28
- ---- snip ----
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 46 ++++++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 44 insertions(+), 2 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 434ee90..b24bc4e 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -4592,7 +4592,7 @@ static VOID nfs41_remove_fcb_entry(
- nfs41_fcb_list_entry, next);
- if (cur->fcb == fcb) {
- #ifdef DEBUG_CLOSE
- - DbgP("nfs41_remove_srvopen_entry: Found match for fcb=0x%p\n", fcb);
- + DbgP("nfs41_remove_fcb_entry: Found match for fcb=0x%p\n", fcb);
- #endif
- RemoveEntryList(pEntry);
- RxFreePool(cur);
- @@ -4600,7 +4600,7 @@ static VOID nfs41_remove_fcb_entry(
- }
- if (pEntry->Flink == &openlist.head) {
- #ifdef DEBUG_CLOSE
- - DbgP("nfs41_remove_srvopen_entry: reached EOL looking "
- + DbgP("nfs41_remove_fcb_entry: reached EOL looking "
- "for fcb 0x%p\n", fcb);
- #endif
- break;
- @@ -4610,6 +4610,38 @@ static VOID nfs41_remove_fcb_entry(
- ExReleaseFastMutex(&fcblistLock);
- }
- +static VOID nfs41_invalidate_fobx_entry(
- + IN OUT PMRX_FOBX pFobx)
- +{
- + PLIST_ENTRY pEntry;
- + nfs41_fcb_list_entry *cur;
- + __notnull PNFS41_FOBX nfs41_fobx = NFS41GetFobxExtension(pFobx);
- +
- + ExAcquireFastMutex(&fcblistLock);
- +
- + pEntry = openlist.head.Flink;
- + while (!IsListEmpty(&openlist.head)) {
- + cur = (nfs41_fcb_list_entry *)CONTAINING_RECORD(pEntry,
- + nfs41_fcb_list_entry, next);
- + if (cur->nfs41_fobx == nfs41_fobx) {
- +#ifdef DEBUG_CLOSE
- + DbgP("nfs41_invalidate_fobx_entry: Found match for fobx=0x%p\n", fobx);
- +#endif
- + cur->nfs41_fobx = NULL;
- + break;
- + }
- + if (pEntry->Flink == &openlist.head) {
- +#ifdef DEBUG_CLOSE
- + DbgP("nfs41_invalidate_fobx_entry: reached EOL looking "
- + "for fobx 0x%p\n", fobx);
- +#endif
- + break;
- + }
- + pEntry = pEntry->Flink;
- + }
- + ExReleaseFastMutex(&fcblistLock);
- +}
- +
- static NTSTATUS map_close_errors(
- DWORD status)
- {
- @@ -4713,6 +4745,9 @@ static NTSTATUS nfs41_DeallocateForFobx(
- IN OUT PMRX_FOBX pFobx)
- {
- __notnull PNFS41_FOBX nfs41_fobx = NFS41GetFobxExtension(pFobx);
- +
- + nfs41_invalidate_fobx_entry(pFobx);
- +
- if (nfs41_fobx->acl) {
- RxFreePool(nfs41_fobx->acl);
- nfs41_fobx->acl = NULL;
- @@ -7509,6 +7544,13 @@ VOID fcbopen_main(PVOID ctx)
- #endif
- if (cur->skip) goto out;
- + /*
- + * This can only happen if |nfs41_DeallocateForFobx()|
- + * was called
- + */
- + if ((!cur->nfs41_fobx) || (!cur->nfs41_fobx->sec_ctx.ClientToken))
- + goto out;
- +
- pNetRootContext =
- NFS41GetNetRootExtension(cur->fcb->pNetRoot);
- /* place an upcall for this srv_open */
- --
- 2.45.1
- From ac94273d98ffe1333181b43042b30b0bff24be26 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 5 Aug 2024 15:53:54 +0200
- Subject: [PATCH 2/6] mount,sys: Add mount option to enable/disable time-based
- coherency
- Add mount option to enable/disable time-based coherency.
- "off" by default, because the time-based coherency causes
- crashes under Win32 "verifer" utilty.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 2 ++
- sys/nfs41_driver.c | 25 +++++++++++++++++++++++++
- 2 files changed, 27 insertions(+)
- diff --git a/mount/mount.c b/mount/mount.c
- index 442c0d6..63efa11 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -107,6 +107,8 @@ void PrintMountUsage(LPWSTR pProcess)
- "\tnowritethru\tturns on rdbss caching for writes (default)\n"
- "\tcache\tturns on rdbss caching (default)\n"
- "\tnocache\tturns off rdbss caching\n"
- + "\ttimebasedcoherency\tturns on time-based coherency\n"
- + "\tnotimebasedcoherency\tturns off time-based coherency (default, due to bugs)\n"
- "\twsize=#\twrite buffer size in bytes\n"
- "\tcreatemode=\tspecify default POSIX permission mode\n"
- "\t\tfor new files created on the NFS share.\n"
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index b24bc4e..c4b3af5 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -308,6 +308,7 @@ typedef struct _NFS41_MOUNT_CONFIG {
- BOOLEAN ReadOnly;
- BOOLEAN write_thru;
- BOOLEAN nocache;
- + BOOLEAN timebasedcoherency;
- WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE];
- UNICODE_STRING SrvName; /* hostname, or hostname@port */
- WCHAR mntpt_buffer[NFS41_SYS_MAX_PATH_LEN];
- @@ -416,6 +417,7 @@ typedef struct _NFS41_V_NET_ROOT_EXTENSION {
- BOOLEAN read_only;
- BOOLEAN write_thru;
- BOOLEAN nocache;
- + BOOLEAN timebasedcoherency;
- } NFS41_V_NET_ROOT_EXTENSION, *PNFS41_V_NET_ROOT_EXTENSION;
- #define NFS41GetVNetRootExtension(pVNetRoot) \
- (((pVNetRoot) == NULL) ? NULL : \
- @@ -450,6 +452,7 @@ typedef struct _NFS41_FOBX {
- DWORD deleg_type;
- BOOLEAN write_thru;
- BOOLEAN nocache;
- + BOOLEAN timebasedcoherency;
- } NFS41_FOBX, *PNFS41_FOBX;
- #define NFS41GetFobxExtension(pFobx) \
- (((pFobx) == NULL) ? NULL : (PNFS41_FOBX)((pFobx)->Context))
- @@ -2891,6 +2894,7 @@ static void nfs41_MountConfig_InitDefaults(
- Config->ReadOnly = FALSE;
- Config->write_thru = FALSE;
- Config->nocache = FALSE;
- + Config->timebasedcoherency = FALSE; /* disabled by default because of bugs */
- Config->SrvName.Length = 0;
- Config->SrvName.MaximumLength = SERVER_NAME_BUFFER_SIZE;
- Config->SrvName.Buffer = Config->srv_buffer;
- @@ -3046,6 +3050,14 @@ static NTSTATUS nfs41_MountConfig_ParseOptions(
- status = nfs41_MountConfig_ParseBoolean(Option, &usValue,
- FALSE, &Config->nocache);
- }
- + else if (wcsncmp(L"timebasedcoherency", Name, NameLen) == 0) {
- + status = nfs41_MountConfig_ParseBoolean(Option, &usValue,
- + FALSE, &Config->timebasedcoherency);
- + }
- + else if (wcsncmp(L"notimebasedcoherency", Name, NameLen) == 0) {
- + status = nfs41_MountConfig_ParseBoolean(Option, &usValue,
- + TRUE, &Config->timebasedcoherency);
- + }
- else if (wcsncmp(L"timeout", Name, NameLen) == 0) {
- status = nfs41_MountConfig_ParseDword(Option, &usValue,
- &Config->timeout, UPCALL_TIMEOUT_DEFAULT,
- @@ -3428,6 +3440,7 @@ static NTSTATUS nfs41_CreateVNetRoot(
- pVNetRootContext->read_only = Config->ReadOnly;
- pVNetRootContext->write_thru = Config->write_thru;
- pVNetRootContext->nocache = Config->nocache;
- + pVNetRootContext->timebasedcoherency = Config->timebasedcoherency;
- } else {
- /*
- * Codepath for \\server@port\nfs4\path or
- @@ -3522,6 +3535,7 @@ static NTSTATUS nfs41_CreateVNetRoot(
- pVNetRootContext->read_only = Config->ReadOnly;
- pVNetRootContext->write_thru = Config->write_thru;
- pVNetRootContext->nocache = Config->nocache;
- + pVNetRootContext->timebasedcoherency = Config->timebasedcoherency;
- }
- Config->use_nfspubfh = pubfh_prefix;
- @@ -3533,6 +3547,7 @@ static NTSTATUS nfs41_CreateVNetRoot(
- "ReadOnly=%d, "
- "write_thru=%d, "
- "nocache=%d "
- + "timebasedcoherency=%d "
- "timeout=%d "
- "createmode.use_nfsv3attrsea_mode=%d "
- "Config->createmode.mode=0o%o "
- @@ -3543,6 +3558,7 @@ static NTSTATUS nfs41_CreateVNetRoot(
- Config->ReadOnly?1:0,
- Config->write_thru?1:0,
- Config->nocache?1:0,
- + Config->timebasedcoherency?1:0,
- Config->timeout,
- Config->createmode.use_nfsv3attrsea_mode?1:0,
- Config->createmode.mode);
- @@ -4462,6 +4478,7 @@ retry_on_link:
- (FCB_STATE_READBUFFERING_ENABLED |
- FCB_STATE_READCACHING_ENABLED);
- }
- + nfs41_fobx->timebasedcoherency = pVNetRootContext->timebasedcoherency;
- if (pVNetRootContext->nocache ||
- (params->CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING)) {
- #ifdef DEBUG_OPEN
- @@ -7551,6 +7568,14 @@ VOID fcbopen_main(PVOID ctx)
- if ((!cur->nfs41_fobx) || (!cur->nfs41_fobx->sec_ctx.ClientToken))
- goto out;
- + if (!cur->nfs41_fobx->timebasedcoherency) {
- +#ifdef DEBUG_TIME_BASED_COHERENCY
- + DbgP("fcbopen_main: timebasedcoherency disabled for "
- + "fcb=0x%p, nfs41_fobx=0x%p\n", cur->fcb, cur->nfs41_fobx);
- +#endif
- + goto out;
- + }
- +
- pNetRootContext =
- NFS41GetNetRootExtension(cur->fcb->pNetRoot);
- /* place an upcall for this srv_open */
- --
- 2.45.1
- From 07081dacdc9d2e740868748066b259b0d55cf928 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 5 Aug 2024 15:57:56 +0200
- Subject: [PATCH 3/6] cygwin: cygwinaccount2nfs4account: Add --man/--help and
- convert given user
- cygwinaccount2nfs4account: Add --man/--help options and
- a mode to convert a given user.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- .../cygwinaccount2nfs4account.ksh | 237 ++++++++++++++++--
- 1 file changed, 211 insertions(+), 26 deletions(-)
- diff --git a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
- index f765276..dbb440f 100644
- --- a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
- +++ b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
- @@ -25,7 +25,7 @@
- #
- #
- -# cygwinaccount2nfs4account.ksh93 - transfer Cygwin user/group account
- +# cygwinaccount2nfs4account.ksh93 - convert Cygwin user/group account
- # info to Linux/UNIX NFSv4 server account data
- #
- @@ -33,6 +33,13 @@
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- +function usage
- +{
- + (( OPTIND=0 ))
- + getopts -a "${1}" "${2}" OPT '-?'
- + return 2
- +}
- +
- function getent_passwd2compound
- {
- set -o nounset
- @@ -143,6 +150,10 @@ function accountdata2linuxscript
- #
- integer i
- + printf '\n\n#\n'
- + printf '# Group data:\n'
- + printf '#\n'
- +
- for ((i=0 ; i < ${#accountdata.group_list[@]} ; i++ )) ; do
- nameref currgrp=accountdata.group_list[$i]
- @@ -169,6 +180,10 @@ function accountdata2linuxscript
- #
- nameref curruser=accountdata.user
- + printf '\n\n#\n'
- + printf '# User data:\n'
- + printf '#\n'
- +
- printf 'mkdir -p %q\n' "${curruser.homedir}"
- printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
- "${curruser.uid}" \
- @@ -183,58 +198,228 @@ function accountdata2linuxscript
- return 0
- }
- +function print_nfs4_server_config
- +{
- + nameref cfg=$1
- +
- + # fixme: we need to figure out the real NFSv4 idmapping domain of the client
- + printf '\n\n#\n'
- + printf '# NFSv4 server config:\n'
- + printf '#\n'
- +
- + printf '# turn idmapper on, even for AUTH_SYS\n'
- + printf '{\n'
- + printf '\tprintf "[General]\\n"\n'
- + printf '\tprintf "Domain = %s\\n"\n' "GLOBAL.LOC"
- + printf '} >>"/etc/idmapd.conf"\n'
- +
- + printf 'printf "options nfsd nfs4_disable_idmapping=N\\noptions nfs nfs4_disable_idmapping=N\\n" >>"/etc/modprobe.d/nfs.conf"\n'
- + printf 'printf "NEED_IDMAPD=yes\\n" >>"/etc/default/nfs-common"\n'
- +
- + return 0
- +}
- function convert_curruser2linuxscript
- {
- + nameref cfg=$1
- + shift
- +
- compound account_data
- compound account_data.user
- compound -a account_data.group_list
- integer i=0
- - typeset currgroup
- + typeset -a group_list
- getent_passwd2compound account_data.user "$(id -u)"
- - for currgroup in $(id -G) ; do
- - getent_group2compound account_data.group_list[$((i++))] "$currgroup"
- + group_list=( $(id -G) )
- +
- + #
- + # Collect group information into "account_data" CPV
- + #
- + for ((i=0 ; i < ${#group_list[@]} ; i++ )) ; do
- + getent_group2compound account_data.group_list[$i] "${group_list[$i]}"
- done
- - print -v account_data
- + ${cfg.debug} && print -u2 -v account_data
- + #
- + # Generate Linux script from collected "account_data"
- + #
- accountdata2linuxscript account_data
- - # fixme: we need to figure out the real NFSv4 idmapping domain of the client
- -
- - printf '# turn idmapper on, even for AUTH_SYS\n'
- - printf '{\n'
- - printf '\tprintf "[General]\\n"\n'
- - printf '\tprintf "Domain = %s\\n"\n' "GLOBAL.LOC"
- - printf '} >>"/etc/idmapd.conf"\n'
- + #
- + # Print NFSv4 server config
- + #
- + print_nfs4_server_config cfg
- - printf 'printf "options nfsd nfs4_disable_idmapping=N\\noptions nfs nfs4_disable_idmapping=N\\n" >>"/etc/modprobe.d/nfs.conf"\n'
- - printf 'printf "NEED_IDMAPD=yes\\n" >>"/etc/default/nfs-common"\n'
- + #
- + # Done
- + #
- + printf '\n# Done.\n'
- return 0
- }
- +function convert_givenuser2linuxscript
- +{
- + nameref cfg=$1
- + shift
- +
- + typeset username="$1"
- +
- + compound account_data
- + compound account_data.user
- + compound -a account_data.group_list
- + integer i=0
- + typeset -a group_list
- +
- + getent_passwd2compound account_data.user "$username"
- +
- + compound out
- +
- + #
- + # Get group data from Directory Server
- + #
- +
- + #
- + # query DS via powershell
- + #
- + out.stderr="${ { out.stdout="${
- + queryuser="$username" powershell -Command '(New-Object System.DirectoryServices.DirectorySearcher("(&(objectCategory=User)(samAccountName=$("$env:queryuser")))")).FindOne().GetDirectoryEntry().memberOf'
- + (( out.res=$? )) ; }" ; } 2>&1 ; }"
- +
- + if [[ "${out.stderr}" != '' ]] || (( out.res != 0 )) ; then
- + print -u2 $"%s: powershell querying groups from DS failed, msg=%q, res=%d\n" \
- + "$0" "${out.stderr}" out.res
- + return 1
- + fi
- +
- + #
- + # Parse LDAP-style output
- + #
- + dummy="${out.stdout//~(E)CN=(.+?),/dummy}"
- + ${cfg.debug} && printf 'dummy=%q\n' "$dummy"
- +
- + for ((i=0 ; i < ${#.sh.match[1][@]} ; i++)) ; do
- + group_list+=( "${.sh.match[1][$i]}" )
- + done
- +
- + #
- + # Collect group information into "account_data" CPV
- + #
- + for ((i=0 ; i < ${#group_list[@]} ; i++ )) ; do
- + getent_group2compound account_data.group_list[$i] "${group_list[$i]}"
- + done
- +
- + ${cfg.debug} && print -u2 -v account_data
- +
- + #
- + # Generate Linux script from collected "account_data"
- + #
- + accountdata2linuxscript account_data
- +
- + #
- + # Print NFSv4 server config
- + #
- + print_nfs4_server_config cfg
- +
- + #
- + # Done
- + #
- + printf '\n# Done.\n'
- +
- + return 0
- +}
- -#
- -# ToDo:
- -# - Command-line options
- -# - Convert current user+groups to Linux bash script [done]
- -# - Convert current user+groups to /etc/passwd+/etc/group lines
- -# - Convert given user+groups to Linux bash script
- -# - Convert given user+groups to /etc/passwd+/etc/group lines
- -#
- function main
- {
- - convert_curruser2linuxscript "$@"
- - return $?
- + set -o nounset
- +
- + # fixme: Need better text layout for $ nfsurlconv --man #
- + typeset -r cygwinaccount2nfs4account_usage=$'+
- + [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2024-08-01 \$\n]
- + [-author?Roland Mainz <roland.mainz@nrubsig.org>]
- + [+NAME?cygwinaccount2nfs4account - convert Cygwin user/group account
- + info to Linux/UNIX NFSv4 server account data]
- + [+DESCRIPTION?\bcygwinaccount2nfs4account\b convert Cygwin user/group account
- + info to Linux/UNIX NFSv4 server account data.]
- + [D:debug?Enable debugging.]
- +
- + --man
- +
- + [+SEE ALSO?\bksh93\b(1),\bms-nfs41-client\b(1),\bnfs\b(5)]
- + '
- +
- + compound c
- + typeset -a c.args
- + integer saved_optind_m1 # saved OPTIND-1
- +
- + c.args=( "$@" )
- +
- + typeset c.debug=false
- +
- + #
- + # Argument parsing
- + #
- + while getopts -a "${progname}" "${cygwinaccount2nfs4account_usage}" OPT "${c.args[@]}" ; do
- + case "${OPT}" in
- + 'D')
- + c.debug=true
- + ;;
- + *)
- + usage "${progname}" "${cygwinaccount2nfs4account_usage}"
- + return $?
- + ;;
- + esac
- + done
- +
- + (( saved_optind_m1=OPTIND-1 ))
- +
- + # remove options we just parsed from c.args
- + for ((i=0 ; i < saved_optind_m1 ; i++)) ; do
- + unset c.args[$i]
- + done
- +
- + #
- + # c.args mighth be a sparse array (e.g. "([1]=aaa [2]=bbb [4]=ccc)")
- + # right now after we removed processed options/arguments.
- + # For easier processing below we "reflow" the array back to a
- + # normal linear layout (e.g. ([0]=aaa [1]=bbb [2]=ccc)
- + #
- + c.args=( "${c.args[@]}" )
- +
- + #
- + # ToDo:
- + # - Command-line options
- + # - Convert current user+groups to Linux bash script [done]
- + # - Convert current user+groups to /etc/passwd+/etc/group lines
- + # - Convert given user+groups to Linux bash script
- + # - Convert given user+groups to /etc/passwd+/etc/group lines
- + #
- +
- + if (( ${#c.args[@]} == 0 )) ; then
- + print -u2 -f $"# Converting current user\n"
- + convert_curruser2linuxscript c "$@"
- + else
- + print -u2 -f $"# Converting given user\n"
- + convert_givenuser2linuxscript c "$@"
- + fi
- +
- + return 2
- }
- +#
- +# main
- +#
- +builtin cat
- builtin id
- +builtin mkdir
- +builtin basename
- -main "$@"
- -return $?
- +typeset progname="${ basename "${0}" ; }"
- +main "$@"
- +exit $?
- # EOF.
- --
- 2.45.1
- From 15bcf2f22684061993cbce0fca8e0f1e1d36083e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 5 Aug 2024 16:03:39 +0200
- Subject: [PATCH 4/6] sys: Remove |DbgEn()|/|DbgEx()| from |fcbopen_main()|
- Remove |DbgEn()|/|DbgEx()| from |fcbopen_main()|, so any issues
- here are no longer hidden.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index c4b3af5..ec68192 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -7538,7 +7538,7 @@ VOID fcbopen_main(PVOID ctx)
- NTSTATUS status;
- LARGE_INTEGER timeout;
- - DbgEn();
- +// DbgEn();
- timeout.QuadPart = RELATIVE(SECONDS(30));
- while(1) {
- PLIST_ENTRY pEntry;
- @@ -7643,7 +7643,7 @@ out:
- }
- ExReleaseFastMutex(&fcblistLock);
- }
- - DbgEx();
- +// DbgEx();
- }
- --
- 2.45.1
- From a9b754f34159580ead6ae5cdb1126af13996fc8c Mon Sep 17 00:00:00 2001
- From: Cedric Blancher <cedric.blancher@gmail.com>
- Date: Mon, 5 Aug 2024 17:46:19 +0200
- Subject: [PATCH 5/6] cygwin: 32bit apps on 64bit Windows cannot enumerate NFS
- shares
- 32bit apps on 64bit Windows cannot enumerate NFS shares, because
- the 32bit network provider DLL was not installed.
- Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
- ---
- cygwin/devel/msnfs41client.bash | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 0553938..ce91e0d 100644
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -216,6 +216,16 @@ function nfsclient_adddriver
- rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 ./nfs41rdr.inf
- + #
- + # Hack: Manually Add 32bit provider DLL to a 64bit system, so
- + # 32bit applications can enumerate the ms-nfs41-client shares
- + # (FIXME: technically nfs41rdr.inf should do this)
- + #
- + if [[ -d '/cygdrive/c/Windows/SysWOW64/' ]] ; then
- + # copy from the 32bit install dir
- + cp '../../../../../cygdrive/c/cygwin/lib/msnfs41client/nfs41_np.dll' '/cygdrive/c/Windows/SysWOW64/'
- + fi
- +
- return 0
- }
- @@ -234,6 +244,9 @@ function nfsclient_removedriver
- nfs_install.exe 0
- rundll32.exe setupapi.dll,InstallHinfSection DefaultUninstall 132 ./nfs41rdr.inf
- rm /cygdrive/c/Windows/System32/nfs41_np.dll || true
- + if [[ -d '/cygdrive/c/Windows/SysWOW64/' ]] ; then
- + rm '/cygdrive/c/Windows/SysWOW64/nfs41_np.dll' || true
- + fi
- rm /cygdrive/c/Windows/System32/drivers/nfs41_driver.sys || true
- sync
- --
- 2.45.1
- From 90dd1beb8fcfdb659732f8f173986595bf86a21a Mon Sep 17 00:00:00 2001
- From: Cedric Blancher <cedric.blancher@gmail.com>
- Date: Mon, 5 Aug 2024 17:48:15 +0200
- Subject: [PATCH 6/6] mount: Move share enumation cmd into own function
- Move share enumation cmd into own function.
- Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
- ---
- mount/mount.c | 32 +++++++++++++++++++++++---------
- 1 file changed, 23 insertions(+), 9 deletions(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index 63efa11..a4b8eb1 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -178,14 +178,6 @@ int mount_main(int argc, wchar_t *argv[])
- wchar_t *mntopts[MAX_MNTOPTS] = { 0 };
- int num_mntopts = 0;
- - if (argc == 1) {
- - /* list open nfs shares */
- - result = EnumMounts(NULL);
- - if (result)
- - PrintErrorMessage(GetLastError());
- - goto out;
- - }
- -
- result = InitializeMountOptions(&Options, MAX_OPTION_BUFFER_SIZE);
- if (result) {
- PrintErrorMessage(GetLastError());
- @@ -532,6 +524,24 @@ out:
- }
- +static
- +int list_nfs_mounts_main(int argc, wchar_t *argv[])
- +{
- + DWORD result;
- +
- + /* Unused for now */
- + (void)argc;
- + (void)argv;
- +
- + /* list open nfs shares */
- + result = EnumMounts(NULL);
- + if (result)
- + PrintErrorMessage(GetLastError());
- +
- + return result;
- +}
- +
- +
- int __cdecl wmain(int argc, wchar_t *argv[])
- {
- DWORD result = NO_ERROR;
- @@ -545,7 +555,11 @@ int __cdecl wmain(int argc, wchar_t *argv[])
- (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
- (void)_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
- - if (wcsstr(argv[0], L"nfs_mount")) {
- + if (argc == 1) {
- + result = list_nfs_mounts_main(argc, argv);
- + goto out;
- + }
- + else if (wcsstr(argv[0], L"nfs_mount")) {
- result = mount_main(argc, argv);
- goto out;
- }
- --
- 2.45.1
msnfs41client: timebasedcoherency fixes&workarounds, fix 32bit share enumeration on 64bit kernel, cygwinaccount2nfs4account.ksh update, debug+misc, 2024-08-05
Posted by Anonymous on Mon 5th Aug 2024 17:12
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.