- From b62c49c6bc17071b80d4b4e415109890bfe00225 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 4 Sep 2024 12:07:48 +0200
- Subject: [PATCH 1/5] cygwin: Document the Visual Studio Installer config
- file+Cygwin install
- Document the Visual Studio Installer config file
- ("ms-nfs41-client/build.vc19/ms-nfs41-client.vsconfig") and add Cygwin
- installion instructions.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.txt | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
- diff --git a/cygwin/README.txt b/cygwin/README.txt
- index 39dd517..eb26dd3 100644
- --- a/cygwin/README.txt
- +++ b/cygwin/README.txt
- @@ -7,9 +7,17 @@
- ######## Building ms-nfs41-client using Cygwin+Makefile:
- ** Required software:
- - Visual Studio 19
- + Start Visual Studio 19 installer and import the installer
- + config file "ms-nfs41-client/build.vc19/ms-nfs41-client.vsconfig",
- + and then install Visual Studio.
- + (Note that due to a bug in the VS installer it is sometimes
- + required to manually add another (random) component to be installed,
- + otherwise the imported config might be ignored)
- - WDK for Windows 10, version 2004, from
- https://go.microsoft.com/fwlink/?linkid=2128854
- -- Cygwin >= 3.5.0
- +- Cygwin 64bit >= 3.5.0
- + (see "ms-nfs41-clientcygwin/README.bintarball.txt" for Cygwin 32bit
- + and 64bit installation instructions)
- ** Build the project using Cygwin command line (bash/ksh93):
- export PATH+=":/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/"
- --
- 2.45.1
- From a4ac921e90e21678ba671662755da16db71b3467 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 4 Sep 2024 12:39:45 +0200
- Subject: [PATCH 2/5] tests: Add test module for |GetFileTime()| to winfsinfo
- Add test module for |GetFileTime()| to winfsinfo.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/winfsinfo1/winfsinfo.c | 71 +++++++++++++++++++++++++++++++++++-
- 1 file changed, 70 insertions(+), 1 deletion(-)
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index 42591f1..3c203f7 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -439,6 +439,71 @@ done:
- return res;
- }
- +
- +static
- +bool get_getfiletime(const char *progname, const char *filename)
- +{
- + int res = EXIT_FAILURE;
- + bool ok;
- + FILETIME creationTime;
- + FILETIME lastAccessTime;
- + FILETIME lastWriteTime;
- +
- + HANDLE fileHandle = CreateFileA(filename,
- + GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
- + FILE_FLAG_BACKUP_SEMANTICS, NULL);
- + if (fileHandle == INVALID_HANDLE_VALUE) {
- + (void)fprintf(stderr,
- + "%s: Error opening file '%s'. Last error was %d.\n",
- + progname,
- + filename,
- + (int)GetLastError());
- + return EXIT_FAILURE;
- + }
- +
- + ok = GetFileTime(fileHandle, &creationTime, &lastAccessTime, &lastWriteTime);
- +
- + if (!ok) {
- + (void)fprintf(stderr, "%s: GetFileTime() "
- + "error. GetLastError()==%d.\n",
- + progname,
- + (int)GetLastError());
- + res = EXIT_FAILURE;
- + goto done;
- + }
- +
- + (void)printf("(\n");
- + (void)printf("\tfilename='%s'\n", filename);
- +
- + SYSTEMTIME st;
- +
- + /*
- + * Note that SYSTEMTIME is in UTC, so
- + * use $ (TZ=UTC ls -lad "$filename") to compare
- + */
- + (void)FileTimeToSystemTime(&creationTime, &st);
- + (void)printf("\tcreationTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- + st.wYear, st.wMonth, st.wDay, st.wHour,
- + st.wMinute, st.wSecond, st.wMilliseconds);
- +
- + (void)FileTimeToSystemTime(&lastAccessTime, &st);
- + (void)printf("\tlastAccessTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- + st.wYear, st.wMonth, st.wDay, st.wHour,
- + st.wMinute, st.wSecond, st.wMilliseconds);
- +
- + (void)FileTimeToSystemTime(&lastWriteTime, &st);
- + (void)printf("\tlastWriteTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- + st.wYear, st.wMonth, st.wDay, st.wHour,
- + st.wMinute, st.wSecond, st.wMilliseconds);
- +
- + (void)printf(")\n");
- + res = EXIT_SUCCESS;
- +
- +done:
- + (void)CloseHandle(fileHandle);
- + return res;
- +}
- +
- static
- void usage(void)
- {
- @@ -447,7 +512,8 @@ void usage(void)
- "filebasicinfo|"
- "fileexinfostandard|"
- "filestandardinfo|"
- - "filenormalizednameinfo"
- + "filenormalizednameinfo|"
- + "getfiletime"
- "> path\n");
- }
- @@ -477,6 +543,9 @@ int main(int ac, char *av[])
- else if (!strcmp(subcmd, "filenormalizednameinfo")) {
- return get_filenormalizednameinfo(av[0], av[2]);
- }
- + else if (!strcmp(subcmd, "getfiletime")) {
- + return get_getfiletime(av[0], av[2]);
- + }
- else {
- (void)fprintf(stderr, "%s: Unknown subcmd '%s'\n", av[0], subcmd);
- return EXIT_FAILURE;
- --
- 2.45.1
- From 656b3156e07ef6f0af6ce1297eaa361a277abf58 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 4 Sep 2024 12:47:28 +0200
- Subject: [PATCH 3/5] tests: winfsinfo should output local time, not UTC
- winfsinfo should output local time, not UTC
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/winfsinfo1/winfsinfo.c | 33 ++++++++++++++++++---------------
- 1 file changed, 18 insertions(+), 15 deletions(-)
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index 3c203f7..702761a 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -38,6 +38,18 @@
- #include <stdint.h>
- #include <stdbool.h>
- +static
- +bool filetime2localsystemtime(const FILETIME *ft, SYSTEMTIME *st)
- +{
- + FILETIME localft;
- +
- + if (!FileTimeToLocalFileTime(ft, &localft))
- + return false;
- + if (!FileTimeToSystemTime(&localft, st))
- + return false;
- + return true;
- +}
- +
- static
- bool getvolumeinfo(const char *progname, const char *filename)
- @@ -222,7 +234,6 @@ done:
- return res;
- }
- -
- /*
- * Win10 uses |FileNetworkOpenInformation| to get the information
- * for |GetFileExInfoStandard|
- @@ -252,21 +263,17 @@ bool get_fileexinfostandard(const char *progname, const char *filename)
- SYSTEMTIME st;
- - /*
- - * Note that SYSTEMTIME is in UTC, so
- - * use $ (TZ=UTC ls -lad "$filename") to compare
- - */
- - (void)FileTimeToSystemTime(&finfo.ftCreationTime, &st);
- + (void)filetime2localsystemtime(&finfo.ftCreationTime, &st);
- (void)printf("\tftCreationTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- st.wYear, st.wMonth, st.wDay, st.wHour,
- st.wMinute, st.wSecond, st.wMilliseconds);
- - (void)FileTimeToSystemTime(&finfo.ftLastAccessTime, &st);
- + (void)filetime2localsystemtime(&finfo.ftLastAccessTime, &st);
- (void)printf("\tftLastAccessTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- st.wYear, st.wMonth, st.wDay, st.wHour,
- st.wMinute, st.wSecond, st.wMilliseconds);
- - (void)FileTimeToSystemTime(&finfo.ftLastWriteTime, &st);
- + (void)filetime2localsystemtime(&finfo.ftLastWriteTime, &st);
- (void)printf("\tftLastWriteTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- st.wYear, st.wMonth, st.wDay, st.wHour,
- st.wMinute, st.wSecond, st.wMilliseconds);
- @@ -477,21 +484,17 @@ bool get_getfiletime(const char *progname, const char *filename)
- SYSTEMTIME st;
- - /*
- - * Note that SYSTEMTIME is in UTC, so
- - * use $ (TZ=UTC ls -lad "$filename") to compare
- - */
- - (void)FileTimeToSystemTime(&creationTime, &st);
- + (void)filetime2localsystemtime(&creationTime, &st);
- (void)printf("\tcreationTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- st.wYear, st.wMonth, st.wDay, st.wHour,
- st.wMinute, st.wSecond, st.wMilliseconds);
- - (void)FileTimeToSystemTime(&lastAccessTime, &st);
- + (void)filetime2localsystemtime(&lastAccessTime, &st);
- (void)printf("\tlastAccessTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- st.wYear, st.wMonth, st.wDay, st.wHour,
- st.wMinute, st.wSecond, st.wMilliseconds);
- - (void)FileTimeToSystemTime(&lastWriteTime, &st);
- + (void)filetime2localsystemtime(&lastWriteTime, &st);
- (void)printf("\tlastWriteTime='%04d-%02d-%02d %02d:%02d:%02d.%d'\n",
- st.wYear, st.wMonth, st.wDay, st.wHour,
- st.wMinute, st.wSecond, st.wMilliseconds);
- --
- 2.45.1
- From a2186200f5ba607f6212ac27cd7caddffd72490f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 4 Sep 2024 13:26:11 +0200
- Subject: [PATCH 4/5] build.vc19: Add missing daemon/accesstoken.* to
- nfsd.vcxproj.filters
- Add missing daemon/accesstoken.* to nfsd.vcxproj.filters
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfsd/nfsd.vcxproj.filters | 6 ++++++
- 1 file changed, 6 insertions(+)
- diff --git a/build.vc19/nfsd/nfsd.vcxproj.filters b/build.vc19/nfsd/nfsd.vcxproj.filters
- index 439daec..d3cdf3e 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj.filters
- +++ b/build.vc19/nfsd/nfsd.vcxproj.filters
- @@ -132,6 +132,9 @@
- <ClCompile Include="..\..\daemon\volume.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- + <ClCompile Include="..\..\daemon\accesstoken.c">
- + <Filter>Source Files</Filter>
- + </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\daemon\cpvparser1.h">
- @@ -200,5 +203,8 @@
- <ClInclude Include="..\..\include\nfs_ea.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- + <ClInclude Include="..\..\daemon\accesstoken.h">
- + <Filter>Header Files</Filter>
- + </ClInclude>
- </ItemGroup>
- </Project>
- \ No newline at end of file
- --
- 2.45.1
- From 2b619f439552df6c5b4cd5f00848287af2cfc56a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 4 Sep 2024 14:02:55 +0200
- Subject: [PATCH 5/5] cygwin: Document workaround for VS19 "link.exe" crash on
- SMB/NFS filesystems
- Document workaround for VS19 "link.exe" crash on SMB/NFS filesystems.
- See also
- https://developercommunity.visualstudio.com/t/Visual-Studio-linkexe-crashes-on-networ/10735424
- ("Visual Studio link.exe crashes on network filesystem").
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.txt | 11 +++++++++++
- 1 file changed, 11 insertions(+)
- diff --git a/cygwin/README.txt b/cygwin/README.txt
- index eb26dd3..1e34fdb 100644
- --- a/cygwin/README.txt
- +++ b/cygwin/README.txt
- @@ -26,6 +26,17 @@ cd ms-nfs41-client
- cd cygwin
- make installdest
- +# Note that $ make installdest # can fail on SMB/NFSv4.1 filesystems
- +# with a "link.exe" crash.
- +# Workaround is to disable incremental linking before building, e.g. do
- +# ---- snip ----
- +cd ms-nfs41-client
- +sed -i -E 's/<LinkIncremental>true<\/LinkIncremental>/<LinkIncremental>false<\/LinkIncremental>/g' $(find build.vc19 -name \*.vcxproj)
- +# ---- snip ----
- +# This Visual Studio bug is tracked as
- +# https://developercommunity.visualstudio.com/t/Visual-Studio-linkexe-crashes-on-networ/10735424
- +# ("Visual Studio link.exe crashes on network filesystem").
- +
- #### Install the software (requires mintty.exe running as "Adminstrator"):
- cd ms-nfs41-client/destdir/cygdrive/c/cygwin64/sbin
- --
- 2.45.1
msnfs41client: Patches for VS19 link.exe crash on SMB/NFS filesystem, tests, docs+misc, 2024-09-04
Posted by Anonymous on Wed 4th Sep 2024 13:22
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.