Modern versions of portmapper/mount daemon no longer respond to
broadcast rpc so nfs server discovery no longer works.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
The NFS4 pwrite operations contains a memory corruption if a write
is large than 4KB. The reason is that the buffer allocated within
nfs4_compund_async has a size of 4K and it does not account
for the size of the write buffer. To fix this the patch
padds a rpc_allocate_ndu2 function which an additional parameter
as an extra hint for the allocation.
This patch fixes various issues around chmod/chown/utimes:
- The chmod/chown/utimes approach uses open_async_internal, which only works
for files. This patch uses lookup_path so that chmod/chown is also
possible on directories.
- Implements SET_TO_SERVER for utimes
I never succeeded in getting all tests passing even without
these changes. Nor did I succeed in getting the CMake compilation to
work. Sorry. The patch includes extra unit tests for these calls.
We use the libary as part of a test harness to test an NFS server
implementation, so I am reasonably confident that the changes work.
They are also manually tested against the Linux Kernel NFS Server.
Before was by them as static all other parts not included, as they also
static libraries.
This change to create them as objects where then also included in a static and only `nfs.lib` is present.
Brought before on install by Windows:
```
Performing install step for 'nfs'
Microsoft (R)-Build-Engine, Version 15.9.21+g9802d43bc3 für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
nfs_mount.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\mount\Release\nfs_mount.lib
nfs_nfs.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\nfs\Release\nfs_nfs.lib
nfs_nfs4.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\nfs4\Release\nfs_nfs4.lib
nfs_nlm.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\nlm\Release\nfs_nlm.lib
nfs_nsm.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\nsm\Release\nfs_nsm.lib
nfs_portmap.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\portmap\Release\nfs_portmap.lib
nfs_rquota.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\rquota\Release\nfs_rquota.lib
nfs_win32.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\win32\Release\nfs_win32.lib
nfs.vcxproj -> D:\Dev\Kodi64-UWP\vfs.nfs\build\build\nfs\src\nfs-build\lib\Release\nfs.lib
-- Install configuration: "Release"
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/cmake/libnfs/libnfs-config.cmake
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/cmake/libnfs/libnfs-config-release.cmake
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/cmake/libnfs/FindNFS.cmake
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/cmake/libnfs/libnfs-config-version.cmake
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/pkgconfig/libnfs.pc
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-zdr.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs.h.orig
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw-mount.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw-nfs.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw-nlm.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw-nsm.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw-portmap.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/include/nfsc/libnfs-raw-rquota.h
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_win32.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_mount.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_nfs.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_nfs4.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_nlm.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_nsm.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_portmap.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs_rquota.lib
-- Installing: D:/Dev/Kodi64-UWP/vfs.nfs/build/build/depends/lib/nfs.lib
```