- From 9b690c7cdbccbe30812bbe00a133b894d0ba56ce Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Fri, 7 Mar 2025 11:50:04 +0100
- Subject: [PATCH 1/4] daemon: Fix ReactOS clang warning
- Fix ReactOS clang warning
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_ops.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
- index 9302744..2ffaaeb 100644
- --- a/daemon/nfs41_ops.c
- +++ b/daemon/nfs41_ops.c
- @@ -1520,8 +1520,8 @@ int nfs41_setattr(
- if (((setattr_res.attrsset.count > 0) &&
- (setattr_res.attrsset.arr[0] & FATTR4_WORD0_SIZE)) ||
- - (setattr_res.attrsset.count > 1) &&
- - (setattr_res.attrsset.arr[1] & FATTR4_WORD1_SPACE_USED))
- + ((setattr_res.attrsset.count > 1) &&
- + (setattr_res.attrsset.arr[1] & FATTR4_WORD1_SPACE_USED)))
- nfs41_superblock_space_changed(file->fh.superblock);
- out:
- return status;
- --
- 2.45.1
- From f9c869abc8eb303458b07a1297615a376634eaa8 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 8 Mar 2025 20:35:14 +0100
- Subject: [PATCH 2/4] mount: nfs_mount |EnumMounts()| can crash if |lpProvider
- == NULL|
- nfs_mount |EnumMounts()| can crash if |lpProvider == NULL|.
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/enum.c | 3 +++
- 1 file changed, 3 insertions(+)
- diff --git a/mount/enum.c b/mount/enum.c
- index 5e30329..455b888 100644
- --- a/mount/enum.c
- +++ b/mount/enum.c
- @@ -262,6 +262,9 @@ DWORD EnumMounts(
- {
- for (i = 0; i < dwCount; i++)
- {
- + if (pResources[i].lpProvider == NULL)
- + continue;
- +
- if (!wcscmp(pResources[i].lpProvider,
- NFS41_PROVIDER_NAME_U))
- {
- --
- 2.45.1
- From 0acd5119c907911b9182b9ffddfefcdfb153152b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 8 Mar 2025 20:37:01 +0100
- Subject: [PATCH 3/4] dll: Fix |signed|/|unsigned| and |INT|/|ULONG| datatype
- mixing
- Fix |signed|/|unsigned| and |INT|/|ULONG| datatype mixing.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- dll/nfs41_np.c | 21 +++++++++++----------
- dll/nfs41_np.h | 4 ++--
- 2 files changed, 13 insertions(+), 12 deletions(-)
- diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
- index cb1148c..0943164 100644
- --- a/dll/nfs41_np.c
- +++ b/dll/nfs41_np.c
- @@ -267,7 +267,7 @@ static DWORD StoreConnectionInfo(
- HANDLE hMutex, hMemory;
- PNFS41NP_SHARED_MEMORY pSharedMemory;
- PNFS41NP_NETRESOURCE pNfs41NetResource;
- - INT i;
- + ULONG i;
- bool FreeEntryFound = false;
- #ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- LUID authenticationid = { .LowPart = 0, .HighPart = 0L };
- @@ -453,7 +453,7 @@ NPGetCaps(
- WNNC_CON_ADDCONNECTION3;
- break;
- case WNNC_ENUMERATION:
- - rc = WNNC_ENUM_LOCAL;
- + rc = WNNC_ENUM_CONTEXT;
- break;
- case WNNC_START:
- rc = 1;
- @@ -805,7 +805,7 @@ NPCancelConnection(
- if (Status != WN_SUCCESS)
- goto out;
- - INT Index;
- + ULONG Index;
- PNFS41NP_NETRESOURCE pNetResource;
- Status = WN_NOT_CONNECTED;
- @@ -945,7 +945,7 @@ DWORD is_unc_path_mounted(
- if (Status != WN_SUCCESS)
- goto out;
- - INT Index;
- + ULONG Index;
- PNFS41NP_NETRESOURCE pNetResource;
- PNFS41NP_NETRESOURCE foundNetResource = NULL;
- #ifdef NFS41_DRIVER_SYSTEM_LUID_MOUNTS_ARE_GLOBAL
- @@ -1073,7 +1073,7 @@ NPGetConnection3(
- if (Status != WN_SUCCESS)
- goto out;
- - INT Index;
- + ULONG Index;
- PNFS41NP_NETRESOURCE pNetResource;
- PNFS41NP_NETRESOURCE foundNetResource = NULL;
- #ifdef NFS41_DRIVER_SYSTEM_LUID_MOUNTS_ARE_GLOBAL
- @@ -1213,14 +1213,14 @@ NPEnumResource(
- HANDLE hMutex, hMemory;
- PNFS41NP_SHARED_MEMORY pSharedMemory;
- PNFS41NP_NETRESOURCE pNfsNetResource;
- - INT Index = *(PULONG)hEnum;
- + ULONG Index = *((PULONG)hEnum);
- #ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- LUID authenticationid =
- { .LowPart = 0, .HighPart = 0L };
- #endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
- - DbgP((L"--> NPEnumResource(hEnum=0x%x, *lpcCount=%d)\n",
- - HANDLE2INT(hEnum), (int)*lpcCount));
- + DbgP((L"--> NPEnumResource(hEnum=0x%x, *lpcCount=%lu)\n",
- + HANDLE2INT(hEnum), (unsigned long)*lpcCount));
- #ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- (void)get_token_authenticationid(GetCurrentThreadEffectiveToken(),
- @@ -1319,9 +1319,10 @@ NPEnumResource(
- CloseSharedMemory(&hMutex, &hMemory, (PVOID*)&pSharedMemory);
- out:
- *lpcCount = EntriesCopied;
- - *(PULONG) hEnum = Index;
- + *((PULONG)hEnum) = Index;
- - DbgP((L"<-- NPEnumResource returns: %d\n", (int)EntriesCopied));
- + DbgP((L"<-- NPEnumResource returns: %d, Index=%lu\n",
- + (int)EntriesCopied, (unsigned long)Index));
- return Status;
- }
- diff --git a/dll/nfs41_np.h b/dll/nfs41_np.h
- index d9089a4..eb563fe 100644
- --- a/dll/nfs41_np.h
- +++ b/dll/nfs41_np.h
- @@ -57,8 +57,8 @@ typedef struct __NFS41NP_NETRESOURCE {
- } NFS41NP_NETRESOURCE, *PNFS41NP_NETRESOURCE;
- typedef struct __NFS41NP_SHARED_MEMORY {
- - INT NextAvailableIndex;
- - INT NumberOfResourcesInUse;
- + ULONG NextAvailableIndex;
- + ULONG NumberOfResourcesInUse;
- NFS41NP_NETRESOURCE NetResources[NFS41NP_MAX_DEVICES];
- } NFS41NP_SHARED_MEMORY, *PNFS41NP_SHARED_MEMORY;
- --
- 2.45.1
msnfs41client: Patches for nfs_mount crash+misc, 2025-03-08
Posted by Anonymous on Sat 8th Mar 2025 20:10
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.