- From bb7a987aef144520be8b3f085aac50aee7194119 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 13 Mar 2024 18:27:46 +0100
- Subject: [PATCH 1/2] cygwin: bintarball README should automagically get
- filename+sha256 hash [refix]
- Fix tarball generation, which was disabled by accident in the original commit.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/cygwin/Makefile b/cygwin/Makefile
- index 71afd3c..4052c21 100644
- --- a/cygwin/Makefile
- +++ b/cygwin/Makefile
- @@ -111,7 +111,7 @@ bintarball: installdest
- base_filename="msnfs41client_cygwin_binaries_$$(date +%Y%m%d_%Hh%Mm)_git$$(git rev-parse --short HEAD)" ; \
- ( \
- cd "$(DESTDIR)" && \
- - true tar -cvf - \
- + tar -cvf - \
- --owner=SYSTEM:18 \
- --group=SYSTEM:18 \
- cygdrive/c/cygwin64 | \
- --
- 2.43.0
- From 9ba02b3b9456b860edc32e1bebb1e19ef3240074 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 13 Mar 2024 18:53:00 +0100
- Subject: [PATCH 2/2] daemon: The client should identify itself via NFSv4.1
- |nii_name| and |nii_domain|
- We should provide values for |nii_name| and |nii_domain| so NFSv4.1
- server admins can properly idently our NFSv4.1 client, e.g.
- on Linux via $ grep -E 'Implementation' /proc/fs/nfsd/clients/*/info #
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_daemon.c | 61 +++++++++++++++++++++++++++++++++++++++++++
- daemon/nfs41_daemon.h | 1 +
- daemon/nfs41_ops.c | 20 +++++++++++++-
- 3 files changed, 81 insertions(+), 1 deletion(-)
- diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c
- index a7ce502..9ba7885 100644
- --- a/daemon/nfs41_daemon.c
- +++ b/daemon/nfs41_daemon.c
- @@ -520,6 +520,66 @@ void nfsd_crt_debug_init(void)
- #endif /* _DEBUG */
- }
- +static
- +void init_version_string(void)
- +{
- + char uname_buff[256];
- + char *s;
- + DWORD buff_read;
- +
- + /*
- + * gisburn: fixme:
- + * We should get the Windows version numbers from the
- + * Windows registry, unfortunately this is going to be a
- + * another variantion of vesion hell, as |GetVersionEx()|
- + * is depreciated
- + */
- + subcmd_popen_context *scmd_uname = subcmd_popen("C:\\cygwin64\\bin\\uname.exe -a");
- + if (scmd_uname) {
- + buff_read = 0;
- + if (subcmd_readcmdoutput(scmd_uname, uname_buff, sizeof(uname_buff), &buff_read)) {
- + /* Remove trailing newline */
- + if ((buff_read > 0) && (uname_buff[buff_read-1] == '\n'))
- + uname_buff[buff_read-1] = '\0';
- + else
- + uname_buff[buff_read] = '\0';
- +
- + /* Stomp newline&co. */
- + for (s = uname_buff ; *s != '\0' ; s++) {
- + if ((*s == '\n') || (*s == '\r'))
- + *s = ' ';
- + }
- + }
- + else {
- + eprintf("init_version_string: subcmd_readcmdoutput() for 'uname -a' failed\n");
- + uname_buff[0] = '\0';
- + }
- + subcmd_pclose(scmd_uname);
- + }
- + else {
- + eprintf("init_version_string: subcmd_popen() for 'uname -a' failed\n");
- + uname_buff[0] = '\0';
- + }
- +
- + /*
- + * gisburn: fixme:
- + * 1. We should include cygwin uname output only in Cygwin mode
- + * 2. We should determinate the Windows version numvber ourselves
- + * 3. We should include our own version and git tag
- + * 4. We should honor RFC5661: "... it is RECOMMENDED
- + * that the nii_name be used to distinguish machine architecture,
- + * machine platforms, revisions, versions, and patch levels. The
- + * nii_date field is the timestamp of when the software instance
- + * was published or built..."
- + */
- + (void)snprintf(nfs41_dg.nfs41_nii_name,
- + sizeof(nfs41_dg.nfs41_nii_name),
- + "msnfs41client 0.1 WinNT NFSv4.1 client, cygwin_vers='%s'",
- + uname_buff);
- + DPRINTF(1, ("init_version_string: versionstring='%s'\n",
- + nfs41_dg.nfs41_nii_name));
- +}
- +
- #ifdef STANDALONE_NFSD
- void __cdecl _tmain(int argc, TCHAR *argv[])
- #else
- @@ -539,6 +599,7 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv)
- exit(1);
- set_debug_level(cmd_args.debug_level);
- open_log_files();
- + init_version_string();
- nfsd_crt_debug_init();
- #ifdef NFS41_DRIVER_SID_CACHE
- sidcache_init();
- diff --git a/daemon/nfs41_daemon.h b/daemon/nfs41_daemon.h
- index 9801379..2ab4366 100644
- --- a/daemon/nfs41_daemon.h
- +++ b/daemon/nfs41_daemon.h
- @@ -40,6 +40,7 @@ typedef struct __nfs41_daemon_globals {
- int default_gid;
- ssize_t num_worker_threads;
- int crtdbgmem_flags;
- + char nfs41_nii_name[256];
- } nfs41_daemon_globals;
- #define NFS41D_GLOBALS_CRTDBGMEM_FLAGS_NOT_SET (-1)
- diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
- index f5dce66..4790484 100644
- --- a/daemon/nfs41_ops.c
- +++ b/daemon/nfs41_ops.c
- @@ -27,6 +27,7 @@
- #include <time.h>
- #include "nfs41_build_features.h"
- +#include "nfs41_daemon.h"
- #include "nfs41_ops.h"
- #include "nfs41_compound.h"
- #include "nfs41_xdr.h"
- @@ -60,14 +61,31 @@ int nfs41_exchange_id(
- nfs_argop4 argop;
- nfs_resop4 resop;
- nfs41_exchange_id_args ex_id;
- + nfs_impl_id4 impl_id = { 0 };
- +
- + /* fixme: This should be a function argument */
- + extern nfs41_daemon_globals nfs41_dg;
- compound_init(&compound, &argop, &resop, "exchange_id");
- compound_add_op(&compound, OP_EXCHANGE_ID, &ex_id, res_out);
- +
- + /* gisburn: fixme: We do not have that domain yet */
- + impl_id.nii_domain = "msnfs41client.org";
- + impl_id.nii_domain_len = (uint32_t)strlen(impl_id.nii_domain);
- + impl_id.nii_name = nfs41_dg.nfs41_nii_name;
- + impl_id.nii_name_len = (uint32_t)strlen(impl_id.nii_name);
- + /*
- + * gisburn: fixme: |impl_id.nii_date| should be the timestamp
- + * of the binary
- + */
- + impl_id.nii_date.seconds = 0LL;
- + impl_id.nii_date.nseconds = 0UL;
- +
- ex_id.eia_clientowner = owner;
- ex_id.eia_flags = flags_in;
- ex_id.eia_state_protect.spa_how = SP4_NONE;
- - ex_id.eia_client_impl_id = NULL;
- + ex_id.eia_client_impl_id = &impl_id;
- res_out->server_owner.so_major_id_len = NFS4_OPAQUE_LIMIT;
- res_out->server_scope_len = NFS4_OPAQUE_LIMIT;
- --
- 2.43.0
msnfs41client: Patches for NFSv4.1 client identification+misc, 2024-03-13
Posted by Anonymous on Wed 13th Mar 2024 18:33
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.