- From 2058c172554416322d03970c4635263378ceb3b0 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 13:36:00 +0200
- Subject: [PATCH 1/8] daemon: Rework
- |print_nfs_access_mask()|+|print_windows_access_mask()|
- Rework |print_nfs_access_mask()| and |print_windows_access_mask()|.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 8 +-
- daemon/daemon_debug.c | 192 ++++++++++++++++++------------------------
- daemon/daemon_debug.h | 5 +-
- 3 files changed, 90 insertions(+), 115 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 54a5815..6f6512e 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -528,7 +528,9 @@ static void map_winaccessmask2nfs4acemask(ACCESS_MASK mask, int file_type, uint3
- DPRINTF(ACLLVL,
- ("--> map_winaccessmask2nfs4acemask(mask=0x%x)\n",
- (int)mask));
- - print_windows_access_mask(ACLLVL, mask);
- + if (DPRINTF_LEVEL_ENABLED(0)) {
- + print_windows_access_mask(mask);
- + }
- /* check if any GENERIC bits set */
- if (mask & 0xf000000) {
- if (mask & GENERIC_ALL) {
- @@ -547,7 +549,9 @@ static void map_winaccessmask2nfs4acemask(ACCESS_MASK mask, int file_type, uint3
- }
- else /* ignoring generic and reserved bits */
- *nfs4_mask = mask & 0x00ffffff;
- - print_nfs_access_mask(ACLLVL, *nfs4_mask);
- + if (DPRINTF_LEVEL_ENABLED(0)) {
- + print_nfs_access_mask(*nfs4_mask);
- + }
- DPRINTF(ACLLVL,
- ("<-- map_winaccessmask2nfs4acemask(mask=0x%x, *nfs4_mask=0x%x)\n",
- (int)mask, (int)*nfs4_mask));
- diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
- index ab4cee6..2da8256 100644
- --- a/daemon/daemon_debug.c
- +++ b/daemon/daemon_debug.c
- @@ -801,121 +801,91 @@ const char* secflavorop2name(DWORD sec_flavor)
- return "<Unknown RPCSEC_AUTH* flavour>";
- }
- -void print_windows_access_mask(int on, ACCESS_MASK m)
- +void print_windows_access_mask(ACCESS_MASK win_mask)
- {
- - if (!on)
- - return;
- - if (!DPRINTF_LEVEL_ENABLED(1))
- - return;
- -
- - dprintf_out("--> print_windows_access_mask: %x\n", m);
- - if (m & GENERIC_READ)
- - dprintf_out("\tGENERIC_READ\n");
- - if (m & GENERIC_WRITE)
- - dprintf_out("\tGENERIC_WRITE\n");
- - if (m & GENERIC_EXECUTE)
- - dprintf_out("\tGENERIC_EXECUTE\n");
- - if (m & GENERIC_ALL)
- - dprintf_out("\tGENERIC_ALL\n");
- - if (m & MAXIMUM_ALLOWED)
- - dprintf_out("\tMAXIMUM_ALLOWED\n");
- - if (m & ACCESS_SYSTEM_SECURITY)
- - dprintf_out("\tACCESS_SYSTEM_SECURITY\n");
- - if ((m & SPECIFIC_RIGHTS_ALL) == SPECIFIC_RIGHTS_ALL)
- - dprintf_out("\tSPECIFIC_RIGHTS_ALL\n");
- - if ((m & STANDARD_RIGHTS_ALL) == STANDARD_RIGHTS_ALL)
- - dprintf_out("\tSTANDARD_RIGHTS_ALL\n");
- - if ((m & STANDARD_RIGHTS_REQUIRED) == STANDARD_RIGHTS_REQUIRED)
- - dprintf_out("\tSTANDARD_RIGHTS_REQUIRED\n");
- - if (m & SYNCHRONIZE)
- - dprintf_out("\tSYNCHRONIZE\n");
- - if (m & WRITE_OWNER)
- - dprintf_out("\tWRITE_OWNER\n");
- - if (m & WRITE_DAC)
- - dprintf_out("\tWRITE_DAC\n");
- - if (m & READ_CONTROL)
- - dprintf_out("\tREAD_CONTROL\n");
- - if (m & DELETE)
- - dprintf_out("\tDELETE\n");
- - if (m & FILE_READ_DATA)
- - dprintf_out("\tFILE_READ_DATA\n");
- - if (m & FILE_LIST_DIRECTORY)
- - dprintf_out("\tFILE_LIST_DIRECTORY\n");
- - if (m & FILE_WRITE_DATA)
- - dprintf_out("\tFILE_WRITE_DATA\n");
- - if (m & FILE_ADD_FILE)
- - dprintf_out("\tFILE_ADD_FILE\n");
- - if (m & FILE_APPEND_DATA)
- - dprintf_out("\tFILE_APPEND_DATA\n");
- - if (m & FILE_ADD_SUBDIRECTORY)
- - dprintf_out("\tFILE_ADD_SUBDIRECTORY\n");
- - if (m & FILE_CREATE_PIPE_INSTANCE)
- - dprintf_out("\tFILE_CREATE_PIPE_INSTANCE\n");
- - if (m & FILE_READ_EA)
- - dprintf_out("\tFILE_READ_EA\n");
- - if (m & FILE_WRITE_EA)
- - dprintf_out("\tFILE_WRITE_EA\n");
- - if (m & FILE_EXECUTE)
- - dprintf_out("\tFILE_EXECUTE\n");
- - if (m & FILE_TRAVERSE)
- - dprintf_out("\tFILE_TRAVERSE\n");
- - if (m & FILE_DELETE_CHILD)
- - dprintf_out("\tFILE_DELETE_CHILD\n");
- - if (m & FILE_READ_ATTRIBUTES)
- - dprintf_out("\tFILE_READ_ATTRIBUTES\n");
- - if (m & FILE_WRITE_ATTRIBUTES)
- - dprintf_out("\tFILE_WRITE_ATTRIBUTES\n");
- - if ((m & FILE_ALL_ACCESS) == FILE_ALL_ACCESS)
- - dprintf_out("\tFILE_ALL_ACCESS\n");
- - if ((m & FILE_GENERIC_READ) == FILE_GENERIC_READ)
- - dprintf_out("\tFILE_GENERIC_READ\n");
- - if ((m & FILE_GENERIC_WRITE) == FILE_GENERIC_WRITE)
- - dprintf_out("\tFILE_GENERIC_WRITE\n");
- - if ((m & FILE_GENERIC_EXECUTE) == FILE_GENERIC_EXECUTE)
- - dprintf_out("\tFILE_GENERIC_EXECUTE\n");
- + dprintf_out("--> print_windows_access_mask: 0x%lx\n", (long)win_mask);
- +#define PRINTWINACCESSMASKBITS(s) \
- + if ((win_mask & (s)) == (s)) { \
- + dprintf_out("\t" #s "\n"); \
- + win_mask &= ~(s); \
- + }
- + PRINTWINACCESSMASKBITS(GENERIC_READ);
- + PRINTWINACCESSMASKBITS(GENERIC_WRITE);
- + PRINTWINACCESSMASKBITS(GENERIC_EXECUTE);
- + PRINTWINACCESSMASKBITS(GENERIC_ALL);
- + PRINTWINACCESSMASKBITS(MAXIMUM_ALLOWED);
- + PRINTWINACCESSMASKBITS(ACCESS_SYSTEM_SECURITY);
- + PRINTWINACCESSMASKBITS(SPECIFIC_RIGHTS_ALL);
- + PRINTWINACCESSMASKBITS(STANDARD_RIGHTS_ALL);
- + PRINTWINACCESSMASKBITS(STANDARD_RIGHTS_REQUIRED);
- + PRINTWINACCESSMASKBITS(SYNCHRONIZE);
- + PRINTWINACCESSMASKBITS(WRITE_OWNER);
- + PRINTWINACCESSMASKBITS(WRITE_DAC);
- + PRINTWINACCESSMASKBITS(READ_CONTROL);
- + PRINTWINACCESSMASKBITS(DELETE);
- + PRINTWINACCESSMASKBITS(FILE_READ_DATA);
- + PRINTWINACCESSMASKBITS(FILE_LIST_DIRECTORY);
- + PRINTWINACCESSMASKBITS(FILE_WRITE_DATA);
- + PRINTWINACCESSMASKBITS(FILE_ADD_FILE);
- + PRINTWINACCESSMASKBITS(FILE_APPEND_DATA);
- + PRINTWINACCESSMASKBITS(FILE_ADD_SUBDIRECTORY);
- + PRINTWINACCESSMASKBITS(FILE_CREATE_PIPE_INSTANCE);
- + PRINTWINACCESSMASKBITS(FILE_READ_EA);
- + PRINTWINACCESSMASKBITS(FILE_WRITE_EA);
- + PRINTWINACCESSMASKBITS(FILE_EXECUTE);
- + PRINTWINACCESSMASKBITS(FILE_TRAVERSE);
- + PRINTWINACCESSMASKBITS(FILE_DELETE_CHILD);
- + PRINTWINACCESSMASKBITS(FILE_READ_ATTRIBUTES);
- + PRINTWINACCESSMASKBITS(FILE_WRITE_ATTRIBUTES);
- + PRINTWINACCESSMASKBITS(FILE_ALL_ACCESS);
- + PRINTWINACCESSMASKBITS(FILE_GENERIC_READ);
- + PRINTWINACCESSMASKBITS(FILE_GENERIC_WRITE);
- + PRINTWINACCESSMASKBITS(FILE_GENERIC_EXECUTE);
- +
- + /* Print any "leftover" bits */
- + if (win_mask) {
- + dprintf_out("\t0x%lx\n", (long)win_mask);
- + }
- + dprintf_out("<-- print_windows_access_mask\n");
- }
- -void print_nfs_access_mask(int on, int m)
- +void print_nfs_access_mask(uint32_t nfs_mask)
- {
- - if (!on) return;
- - if (!DPRINTF_LEVEL_ENABLED(1))
- - return;
- -
- - dprintf_out("--> print_nfs_access_mask: %x\n", m);
- - if (m & ACE4_READ_DATA)
- - dprintf_out("\tACE4_READ_DATA\n");
- - if (m & ACE4_LIST_DIRECTORY)
- - dprintf_out("\tACE4_LIST_DIRECTORY\n");
- - if (m & ACE4_WRITE_DATA)
- - dprintf_out("\tACE4_WRITE_DATA\n");
- - if (m & ACE4_ADD_FILE)
- - dprintf_out("\tACE4_ADD_FILE\n");
- - if (m & ACE4_APPEND_DATA)
- - dprintf_out("\tACE4_APPEND_DATA\n");
- - if (m & ACE4_ADD_SUBDIRECTORY)
- - dprintf_out("\tACE4_ADD_SUBDIRECTORY\n");
- - if (m & ACE4_READ_NAMED_ATTRS)
- - dprintf_out("\tACE4_READ_NAMED_ATTRS\n");
- - if (m & ACE4_WRITE_NAMED_ATTRS)
- - dprintf_out("\tACE4_WRITE_NAMED_ATTRS\n");
- - if (m & ACE4_EXECUTE)
- - dprintf_out("\tACE4_EXECUTE\n");
- - if (m & ACE4_DELETE_CHILD)
- - dprintf_out("\tACE4_DELETE_CHILD\n");
- - if (m & ACE4_READ_ATTRIBUTES)
- - dprintf_out("\tACE4_READ_ATTRIBUTES\n");
- - if (m & ACE4_WRITE_ATTRIBUTES)
- - dprintf_out("\tACE4_WRITE_ATTRIBUTES\n");
- - if (m & ACE4_DELETE)
- - dprintf_out("\tACE4_DELETE\n");
- - if (m & ACE4_READ_ACL)
- - dprintf_out("\tACE4_READ_ACL\n");
- - if (m & ACE4_WRITE_ACL)
- - dprintf_out("\tACE4_WRITE_ACL\n");
- - if (m & ACE4_WRITE_OWNER)
- - dprintf_out("\tACE4_WRITE_OWNER\n");
- - if (m & ACE4_SYNCHRONIZE)
- - dprintf_out("\tACE4_SYNCHRONIZE\n");
- + dprintf_out("--> print_nfs_access_mask: 0x%lx\n", (long)nfs_mask);
- +#define PRINTNFSMASKBITS(s) \
- + if ((nfs_mask & (s)) == (s)) { \
- + dprintf_out("\t" #s "\n"); \
- + nfs_mask &= ~(s); \
- + }
- + PRINTNFSMASKBITS(ACE4_READ_DATA);
- + PRINTNFSMASKBITS(ACE4_LIST_DIRECTORY);
- + PRINTNFSMASKBITS(ACE4_WRITE_DATA);
- + PRINTNFSMASKBITS(ACE4_ADD_FILE);
- + PRINTNFSMASKBITS(ACE4_APPEND_DATA);
- + PRINTNFSMASKBITS(ACE4_ADD_SUBDIRECTORY);
- + PRINTNFSMASKBITS(ACE4_READ_NAMED_ATTRS);
- + PRINTNFSMASKBITS(ACE4_WRITE_NAMED_ATTRS);
- + PRINTNFSMASKBITS(ACE4_EXECUTE);
- + PRINTNFSMASKBITS(ACE4_DELETE_CHILD);
- + PRINTNFSMASKBITS(ACE4_READ_ATTRIBUTES);
- + PRINTNFSMASKBITS(ACE4_WRITE_ATTRIBUTES);
- + PRINTNFSMASKBITS(ACE4_DELETE);
- + PRINTNFSMASKBITS(ACE4_READ_ACL);
- + PRINTNFSMASKBITS(ACE4_WRITE_ACL);
- + PRINTNFSMASKBITS(ACE4_WRITE_OWNER);
- + PRINTNFSMASKBITS(ACE4_SYNCHRONIZE);
- + PRINTNFSMASKBITS(ACE4_ALL_FILE);
- + PRINTNFSMASKBITS(ACE4_ALL_DIR);
- + PRINTNFSMASKBITS(ACE4_GENERIC_READ);
- + PRINTNFSMASKBITS(ACE4_GENERIC_WRITE);
- + PRINTNFSMASKBITS(ACE4_GENERIC_EXECUTE);
- + PRINTNFSMASKBITS(ACE4_FILE_ALL_ACCESS);
- +
- + /* Print any "leftover" bits */
- + if (nfs_mask) {
- + dprintf_out("\t0x%lx\n", (long)nfs_mask);
- + }
- + dprintf_out("<-- print_nfs_access_mask\n");
- }
- diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
- index 8f0c166..a1a22a2 100644
- --- a/daemon/daemon_debug.h
- +++ b/daemon/daemon_debug.h
- @@ -31,6 +31,7 @@
- #else
- # include <stdlib.h>
- #endif
- +#include <stdint.h>
- #include <stdbool.h>
- #define DEFAULT_DEBUG_LEVEL 1
- @@ -103,8 +104,8 @@ void dprintf_out(LPCSTR format, ...);
- void eprintf_out(LPCSTR format, ...);
- void eprintf(LPCSTR format, ...);
- -void print_windows_access_mask(int on, ACCESS_MASK m);
- -void print_nfs_access_mask(int on, int m);
- +void print_windows_access_mask(ACCESS_MASK win_mask);
- +void print_nfs_access_mask(uint32_t nfs_mask);
- void print_hexbuf_no_asci(const char *title, const unsigned char *buf, int len);
- void print_hexbuf(const char *title, const unsigned char *buf, int len);
- void print_create_attributes(int level, DWORD create_opts);
- --
- 2.45.1
- From f5b1aa0d0f150c23874a5a3e4a7d8a8ed5718454 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 13:47:06 +0200
- Subject: [PATCH 2/8] daemon: Add debug |map_nfs_ftype2str()| function
- Add debug |map_nfs_ftype2str()| function
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 9 +++++----
- daemon/daemon_debug.c | 18 ++++++++++++++++++
- daemon/daemon_debug.h | 1 +
- 3 files changed, 24 insertions(+), 4 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 6f6512e..83bfd3b 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -111,8 +111,8 @@ static int convert_nfs4acl_2_dacl(nfs41_daemon_globals *nfs41dg,
- LPSTR domain = NULL;
- BOOLEAN flag;
- - DPRINTF(ACLLVL, ("--> convert_nfs4acl_2_dacl(acl=0x%p,file_type=%d)\n",
- - acl, file_type));
- + DPRINTF(ACLLVL, ("--> convert_nfs4acl_2_dacl(acl=0x%p,file_type='%s'(=%d))\n",
- + acl, map_nfs_ftype2str(file_type), file_type));
- sids = malloc(acl->count * sizeof(PSID));
- if (sids == NULL) {
- @@ -210,8 +210,9 @@ static int convert_nfs4acl_2_dacl(nfs41_daemon_globals *nfs41dg,
- *sids_out = sids;
- *dacl_out = dacl;
- out:
- - DPRINTF(ACLLVL, ("<-- convert_nfs4acl_2_dacl(acl=0x%p,file_type=%d) returning %d\n",
- - acl, file_type, status));
- + DPRINTF(ACLLVL, ("<-- convert_nfs4acl_2_dacl("
- + "acl=0x%p,file_type='%s'(=%d)) returning %d\n",
- + acl, map_nfs_ftype2str(file_type), file_type, status));
- return status;
- out_free_dacl:
- free(dacl);
- diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
- index 2da8256..dcf2f4d 100644
- --- a/daemon/daemon_debug.c
- +++ b/daemon/daemon_debug.c
- @@ -801,6 +801,24 @@ const char* secflavorop2name(DWORD sec_flavor)
- return "<Unknown RPCSEC_AUTH* flavour>";
- }
- +const char *map_nfs_ftype2str(int ftype)
- +{
- + switch(ftype) {
- +#define NFSTYPE2STRLITERAL(e) case e: return #e;
- + NFSTYPE2STRLITERAL(NF4REG)
- + NFSTYPE2STRLITERAL(NF4DIR)
- + NFSTYPE2STRLITERAL(NF4BLK)
- + NFSTYPE2STRLITERAL(NF4CHR)
- + NFSTYPE2STRLITERAL(NF4LNK)
- + NFSTYPE2STRLITERAL(NF4SOCK)
- + NFSTYPE2STRLITERAL(NF4FIFO)
- + NFSTYPE2STRLITERAL(NF4ATTRDIR)
- + NFSTYPE2STRLITERAL(NF4NAMEDATTR)
- + }
- +
- + return "<Unknown nfs_ftype4 type>";
- +}
- +
- void print_windows_access_mask(ACCESS_MASK win_mask)
- {
- dprintf_out("--> print_windows_access_mask: 0x%lx\n", (long)win_mask);
- diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
- index a1a22a2..78e5925 100644
- --- a/daemon/daemon_debug.h
- +++ b/daemon/daemon_debug.h
- @@ -104,6 +104,7 @@ void dprintf_out(LPCSTR format, ...);
- void eprintf_out(LPCSTR format, ...);
- void eprintf(LPCSTR format, ...);
- +const char *map_nfs_ftype2str(int ftype);
- void print_windows_access_mask(ACCESS_MASK win_mask);
- void print_nfs_access_mask(uint32_t nfs_mask);
- void print_hexbuf_no_asci(const char *title, const unsigned char *buf, int len);
- --
- 2.45.1
- From d4dda3d20b3149704338fe77d4ec3e946939078f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 13:59:21 +0200
- Subject: [PATCH 3/8] daemon: Add missing brackets in |ACE_*| macros
- Add missing brackets in |ACE_*| macros
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_const.h | 39 ++++++++++++++++++++++-----------------
- 1 file changed, 22 insertions(+), 17 deletions(-)
- diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h
- index 5010816..48a108d 100644
- --- a/daemon/nfs41_const.h
- +++ b/daemon/nfs41_const.h
- @@ -373,30 +373,35 @@ enum nfs_ftype4 {
- #define ACE4_WRITE_OWNER 0x00080000
- #define ACE4_SYNCHRONIZE 0x00100000
- -#define ACE4_ALL_FILE ACE4_READ_DATA|ACE4_WRITE_DATA|ACE4_APPEND_DATA| \
- +#define ACE4_ALL_FILE \
- + (ACE4_READ_DATA|ACE4_WRITE_DATA|ACE4_APPEND_DATA| \
- ACE4_READ_NAMED_ATTRS|ACE4_WRITE_NAMED_ATTRS|ACE4_EXECUTE| \
- ACE4_READ_ATTRIBUTES|ACE4_WRITE_ATTRIBUTES| \
- ACE4_DELETE|ACE4_READ_ACL|ACE4_WRITE_ACL|ACE4_WRITE_OWNER| \
- - ACE4_SYNCHRONIZE
- -#define ACE4_ALL_DIR ACE4_READ_DATA|ACE4_WRITE_DATA|ACE4_APPEND_DATA| \
- + ACE4_SYNCHRONIZE)
- +#define ACE4_ALL_DIR \
- + (ACE4_READ_DATA|ACE4_WRITE_DATA|ACE4_APPEND_DATA| \
- ACE4_READ_NAMED_ATTRS|ACE4_WRITE_NAMED_ATTRS|ACE4_EXECUTE| \
- ACE4_DELETE_CHILD|ACE4_READ_ATTRIBUTES|ACE4_WRITE_ATTRIBUTES| \
- ACE4_DELETE|ACE4_READ_ACL|ACE4_WRITE_ACL|ACE4_WRITE_OWNER| \
- - ACE4_SYNCHRONIZE
- -
- -#define ACE4_GENERIC_READ ACE4_READ_DATA|ACE4_READ_NAMED_ATTRS| \
- - ACE4_READ_ATTRIBUTES|ACE4_READ_ACL|ACE4_SYNCHRONIZE
- -#define ACE4_GENERIC_WRITE ACE4_WRITE_DATA|ACE4_WRITE_NAMED_ATTRS| \
- - ACE4_WRITE_ATTRIBUTES|ACE4_READ_ACL|ACE4_SYNCHRONIZE
- -#define ACE4_GENERIC_EXECUTE ACE4_EXECUTE|ACE4_READ_ATTRIBUTES| \
- - ACE4_READ_ACL|ACE4_SYNCHRONIZE
- -
- -
- -
- -#define ACE4_FILE_ALL_ACCESS ACE4_READ_DATA|ACE4_LIST_DIRECTORY| \
- - ACE4_WRITE_DATA|ACE4_ADD_FILE|ACE4_APPEND_DATA|ACE4_ADD_SUBDIRECTORY| \
- + ACE4_SYNCHRONIZE)
- +
- +#define ACE4_GENERIC_READ \
- + (ACE4_READ_DATA|ACE4_READ_NAMED_ATTRS| \
- + ACE4_READ_ATTRIBUTES|ACE4_READ_ACL|ACE4_SYNCHRONIZE)
- +#define ACE4_GENERIC_WRITE \
- + (ACE4_WRITE_DATA|ACE4_WRITE_NAMED_ATTRS| \
- + ACE4_WRITE_ATTRIBUTES|ACE4_READ_ACL|ACE4_SYNCHRONIZE)
- +#define ACE4_GENERIC_EXECUTE \
- + (ACE4_EXECUTE|ACE4_READ_ATTRIBUTES| \
- + ACE4_READ_ACL|ACE4_SYNCHRONIZE)
- +
- +#define ACE4_FILE_ALL_ACCESS \
- + (ACE4_READ_DATA|ACE4_LIST_DIRECTORY| \
- + ACE4_WRITE_DATA|ACE4_ADD_FILE|ACE4_APPEND_DATA| \
- + ACE4_ADD_SUBDIRECTORY| \
- ACE4_READ_NAMED_ATTRS|ACE4_WRITE_NAMED_ATTRS|ACE4_EXECUTE| \
- - ACE4_READ_ATTRIBUTES|ACE4_WRITE_ATTRIBUTES
- + ACE4_READ_ATTRIBUTES|ACE4_WRITE_ATTRIBUTES)
- /* ACLS aceflag4 field constants */
- #define ACE4_FILE_INHERIT_ACE 0x00000001
- --
- 2.45.1
- From 85600e90f322cd91f203490468ab5516536e106d Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 14:06:40 +0200
- Subject: [PATCH 4/8] daemon: Rework
- |print_nfs_access_mask()|+|print_windows_access_mask()| [refix]
- Refix, set correct debug level
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 83bfd3b..0aff8d2 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -529,7 +529,7 @@ static void map_winaccessmask2nfs4acemask(ACCESS_MASK mask, int file_type, uint3
- DPRINTF(ACLLVL,
- ("--> map_winaccessmask2nfs4acemask(mask=0x%x)\n",
- (int)mask));
- - if (DPRINTF_LEVEL_ENABLED(0)) {
- + if (DPRINTF_LEVEL_ENABLED(ACLLVL)) {
- print_windows_access_mask(mask);
- }
- /* check if any GENERIC bits set */
- @@ -550,7 +550,7 @@ static void map_winaccessmask2nfs4acemask(ACCESS_MASK mask, int file_type, uint3
- }
- else /* ignoring generic and reserved bits */
- *nfs4_mask = mask & 0x00ffffff;
- - if (DPRINTF_LEVEL_ENABLED(0)) {
- + if (DPRINTF_LEVEL_ENABLED(ACLLVL)) {
- print_nfs_access_mask(*nfs4_mask);
- }
- DPRINTF(ACLLVL,
- --
- 2.45.1
- From bb3b1865ab0d4f8fd968ea6988e5adfdd503d07b Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 17:22:57 +0200
- Subject: [PATCH 5/8] sys,mount,nfs41_build_features.h: Add new "createmode="
- mount option
- Add new "createmode=" mount option to set the default POSIX
- permission mode for new files created on the NFS share (similar
- to the "fileaccess=" mount option in Microsofts NFSv3 driver).
- This default mode value can be overridden by a "NfsV3Attributes" EA
- (e.g. like Cygwin uses), if the value for the "createmode" option
- was prefixed with "nfsv3attrmode+", e.g.
- "createmode=nfsv3attrmode+0o777".
- The default value for this option is "nfsv3attrmode+0o755", the
- default mode can be defined at build time via the
- |NFS41_DRIVER_DEFAULT_CREATE_MODE| build option in
- "nfs41_build_features.h".
- Note this changes the default mode from "0777" to "0755".
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 10 +++-
- nfs41_build_features.h | 6 ++
- sys/nfs41_driver.c | 130 +++++++++++++++++++++++++++++++++++++----
- 3 files changed, 134 insertions(+), 12 deletions(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index 3c07cd5..2dffc91 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -93,7 +93,13 @@ static VOID PrintUsage(LPTSTR pProcess)
- TEXT("\tnowritethru\tturns on rdbss caching for writes (default)\n")
- TEXT("\tcache\tturns on rdbss caching (default)\n")
- TEXT("\tnocache\tturns off rdbss caching\n")
- - TEXT("\ttimeout=#\tspecify upcall timeout value in seconds (default 120s)\n")
- + TEXT("\twsize=#\twrite buffer size in bytes\n")
- + TEXT("\tcreatemode=\tspecify default POSIX permission mode\n"
- + "\t\tfor new files created on the NFS share.\n"
- + "\t\tArgument is an octal value prefixed with '0o',\n"
- + "\t\tif this value is prefixed with 'nfsv3attrmode+'\n"
- + "\t\tthe mode value from a \"NfsV3Attributes\" EA will be used\n"
- + "\t\t(defaults \"nfsv3attrmode+0o%o\").\n")
- TEXT("* Hostname:\n")
- TEXT("\tDNS name, or hostname in domain\n")
- TEXT("\tentry in C:\\Windows\\System32\\drivers\\etc\\hosts\n")
- @@ -111,7 +117,7 @@ static VOID PrintUsage(LPTSTR pProcess)
- TEXT("\tnfs_mount.exe -o sec=sys,rw '*' nfs://[fe80::21b:1bff:fec3:7713]//net_tmpfs2/test2\n")
- TEXT("\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1//dirwithspace/dir%%20space/test2\n")
- TEXT("\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1//dirwithspace/dir+space/test2\n"),
- - pProcess);
- + pProcess, (int)NFS41_DRIVER_DEFAULT_CREATE_MODE);
- }
- DWORD __cdecl _tmain(DWORD argc, LPTSTR argv[])
- diff --git a/nfs41_build_features.h b/nfs41_build_features.h
- index 697f4d5..7ca7b45 100644
- --- a/nfs41_build_features.h
- +++ b/nfs41_build_features.h
- @@ -117,4 +117,10 @@
- */
- #define NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE 1
- +/*
- + * Default POSIX permission mode bits for new files
- + * Can be ovrriden with a "NfsV3Attributes" EA
- + */
- +#define NFS41_DRIVER_DEFAULT_CREATE_MODE (0755)
- +
- #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 58a312c..ca3c813 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -44,6 +44,7 @@
- /* debugging printout defines */
- #define DEBUG_MARSHAL_HEADER
- #define DEBUG_MARSHAL_DETAIL
- +#define DEBUG_MOUNTCONFIG
- //#define DEBUG_OPEN
- //#define DEBUG_CLOSE
- //#define DEBUG_CACHE
- @@ -304,6 +305,10 @@ typedef struct _NFS41_MOUNT_CONFIG {
- WCHAR sec_flavor_buffer[MAX_SEC_FLAVOR_LEN];
- UNICODE_STRING SecFlavor;
- DWORD timeout;
- + struct {
- + BOOLEAN use_nfsv3attrsea_mode;
- + DWORD mode;
- + } createmode;
- } NFS41_MOUNT_CONFIG, *PNFS41_MOUNT_CONFIG;
- typedef struct _nfs41_mount_entry {
- @@ -387,6 +392,10 @@ typedef struct _NFS41_V_NET_ROOT_EXTENSION {
- FILE_FS_ATTRIBUTE_INFORMATION FsAttrs;
- DWORD sec_flavor;
- DWORD timeout;
- + struct {
- + BOOLEAN use_nfsv3attrsea_mode;
- + DWORD mode;
- + } createmode;
- USHORT MountPathLen;
- BOOLEAN read_only;
- BOOLEAN write_thru;
- @@ -2842,6 +2851,8 @@ void nfs41_MountConfig_InitDefaults(
- Config->SecFlavor.Buffer = Config->sec_flavor_buffer;
- RtlCopyUnicodeString(&Config->SecFlavor, &AUTH_SYS_NAME);
- Config->timeout = UPCALL_TIMEOUT_DEFAULT;
- + Config->createmode.use_nfsv3attrsea_mode = TRUE;
- + Config->createmode.mode = NFS41_DRIVER_DEFAULT_CREATE_MODE;
- }
- NTSTATUS nfs41_MountConfig_ParseBoolean(
- @@ -3001,6 +3012,71 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
- else
- RtlCopyUnicodeString(&Config->SecFlavor, &usValue);
- }
- + else if (wcsncmp(L"createmode", Name, NameLen) == 0) {
- +#define NFSV3ATTRMODE_WSTR L"nfsv3attrmode+"
- +#define NFSV3ATTRMODE_WCSLEN (14)
- +#define NFSV3ATTRMODE_BYTELEN (NFSV3ATTRMODE_WCSLEN*sizeof(WCHAR))
- + if ((usValue.Length >= NFSV3ATTRMODE_BYTELEN) &&
- + (!wcsncmp(NFSV3ATTRMODE_WSTR,
- + usValue.Buffer,
- + min(NFSV3ATTRMODE_WCSLEN,
- + usValue.Length/sizeof(WCHAR))))) {
- + usValue.Buffer += NFSV3ATTRMODE_WCSLEN;
- + usValue.Length = usValue.MaximumLength =
- + usValue.Length - NFSV3ATTRMODE_BYTELEN;
- +#ifdef DEBUG_MOUNTCONFIG
- + DbgP("nfs41_MountConfig_ParseOptions: createmode "
- + "nfs4attr "
- + "leftover option/usValue='%wZ'/%ld\n",
- + &usValue, (long)usValue.Length);
- +#endif /* DEBUG_MOUNTCONFIG */
- +
- + Config->createmode.use_nfsv3attrsea_mode = TRUE;
- + }
- + else {
- +#ifdef DEBUG_MOUNTCONFIG
- + DbgP("nfs41_MountConfig_ParseOptions: createmode "
- + "leftover option/usValue='%wZ'/%ld\n",
- + &usValue, (long)usValue.Length);
- +#endif /* DEBUG_MOUNTCONFIG */
- + Config->createmode.use_nfsv3attrsea_mode = FALSE;
- + }
- +
- + /*
- + * Reject mode values not prefixed with "0o", as
- + * |RtlUnicodeStringToInteger()| uses
- + * 0o (e.g. "0o123") as prefix for octal values,
- + * and does not understand the traditional
- + * UNIX/POSIX/ISO C "0" (e.g. "0123") prefix
- + */
- + if ((usValue.Length >= (3*sizeof(WCHAR))) &&
- + (usValue.Buffer[0] == L'0') &&
- + (usValue.Buffer[1] == L'o')) {
- + status = nfs41_MountConfig_ParseDword(Option,
- + &usValue,
- + &Config->createmode.mode, 0,
- + 0777);
- + if (status == STATUS_SUCCESS) {
- + if (Config->createmode.mode > 0777) {
- + status = STATUS_INVALID_PARAMETER;
- + print_error("mode 0o%o out of bounds\n",
- + (int)Config->createmode.mode);
- + }
- + }
- + }
- + else {
- + status = STATUS_INVALID_PARAMETER;
- + print_error("Invalid createmode '%wZ'\n",
- + usValue);
- + }
- +
- + DbgP("nfs41_MountConfig_ParseOptions: createmode: "
- + "status=0x%lx, "
- + "createmode=(use_nfsv3attrsea_mode=%d, mode=0o%o\n",
- + (long)status,
- + (int)Config->createmode.use_nfsv3attrsea_mode,
- + (int)Config->createmode.mode);
- + }
- else {
- status = STATUS_INVALID_PARAMETER;
- print_error("Unrecognized option '%ls' -> '%wZ'\n",
- @@ -3015,7 +3091,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
- }
- out:
- - DbgP("<-- nfs41_MountConfig_ParseOptions, status=%ld\n", (long)status);
- + DbgP("<-- nfs41_MountConfig_ParseOptions, status=0x%lx\n", (long)status);
- return status;
- }
- @@ -3288,15 +3364,31 @@ NTSTATUS nfs41_CreateVNetRoot(
- pVNetRootContext->nocache = Config->nocache;
- }
- - DbgP("Config->{ MntPt='%wZ', SrvName='%wZ', ReadOnly=%d, write_thru=%d, nocache=%d }\n",
- + DbgP("Config->{ "
- + "MntPt='%wZ', "
- + "SrvName='%wZ', "
- + "ReadOnly=%d, "
- + "write_thru=%d, "
- + "nocache=%d "
- + "timeout=%d "
- + "createmode.use_nfsv3attrsea_mode=%d "
- + "Config->createmode.mode=0o%o "
- + "}\n",
- &Config->MntPt,
- &Config->SrvName,
- Config->ReadOnly?1:0,
- Config->write_thru?1:0,
- - Config->nocache?1:0);
- + Config->nocache?1:0,
- + Config->timeout,
- + Config->createmode.use_nfsv3attrsea_mode?1:0,
- + Config->createmode.mode);
- pVNetRootContext->MountPathLen = Config->MntPt.Length;
- pVNetRootContext->timeout = Config->timeout;
- + pVNetRootContext->createmode.use_nfsv3attrsea_mode =
- + Config->createmode.use_nfsv3attrsea_mode;
- + pVNetRootContext->createmode.mode =
- + Config->createmode.mode;
- status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
- if (status != STATUS_SUCCESS) {
- @@ -3949,16 +4041,34 @@ NTSTATUS nfs41_Create(
- entry->u.Open.open_owner_id = InterlockedIncrement(&open_owner_id);
- // if we are creating a file check if nfsv3attributes were passed in
- if (params->Disposition != FILE_OPEN && params->Disposition != FILE_OVERWRITE) {
- - entry->u.Open.mode = 0777;
- - if (ea && AnsiStrEq(&NfsV3Attributes, ea->EaName, ea->EaNameLength)) {
- - nfs3_attrs *attrs = (nfs3_attrs *)(ea->EaName + ea->EaNameLength + 1);
- + /* Get default mode */
- + entry->u.Open.mode = pVNetRootContext->createmode.mode;
- +
- + /* Use mode from NfsV3Attributes */
- + if (pVNetRootContext->createmode.use_nfsv3attrsea_mode &&
- + ea && AnsiStrEq(&NfsV3Attributes,
- + ea->EaName, ea->EaNameLength)) {
- + nfs3_attrs *attrs =
- + (nfs3_attrs *)(ea->EaName + ea->EaNameLength + 1);
- +
- + entry->u.Open.mode = attrs->mode;
- #ifdef DEBUG_OPEN
- - DbgP("creating file with mode 0%o\n", attrs->mode);
- + DbgP("creating file with EA mode 0%o\n",
- + entry->u.Open.mode);
- #endif
- - entry->u.Open.mode = attrs->mode;
- }
- - if (params->FileAttributes & FILE_ATTRIBUTE_READONLY)
- - entry->u.Open.mode = 0444;
- + else {
- +#ifdef DEBUG_OPEN
- + DbgP("creating file with default mode 0%o\n",
- + entry->u.Open.mode);
- +#endif
- + }
- +
- + if (params->FileAttributes & FILE_ATTRIBUTE_READONLY) {
- + entry->u.Open.mode &= ~0222;
- + DbgP("FILE_ATTRIBUTE_READONLY set, using mode 0%o\n",
- + entry->u.Open.mode);
- + }
- }
- if (entry->u.Open.disp == FILE_CREATE && ea &&
- AnsiStrEq(&NfsSymlinkTargetName, ea->EaName, ea->EaNameLength)) {
- --
- 2.45.1
- From 860311def30d30c3984a6bad41795ba2ce07dd4a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 17:44:35 +0200
- Subject: [PATCH 6/8] sys: Debug: Use %lx for |NTSTATUS|
- Use %lx for |NTSTATUS| when printing debug messages
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 46 +++++++++++++++++++++++++---------------------
- 1 file changed, 25 insertions(+), 21 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index ca3c813..6a237e4 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -1649,7 +1649,7 @@ retry_wait:
- case STATUS_USER_APC:
- case STATUS_ALERTED:
- DbgP("nfs41_UpcallWaitForReply: KeWaitForSingleObject() "
- - "returned status(=%ld), "
- + "returned status(=0x%lx), "
- "retry waiting for '%s' entry=0x%p xid=%lld\n",
- (long)status,
- ENTRY_OPCODE2STRING(entry),
- @@ -1723,7 +1723,7 @@ retry_wait:
- case STATUS_USER_APC:
- case STATUS_ALERTED:
- DbgP("nfs41_upcall: KeWaitForSingleObject() "
- - "returned status(=%ld)"
- + "returned status(=0x%lx)"
- #ifdef NFSV41_UPCALL_RETRY_WAIT
- ", retry waiting"
- #endif /* NFSV41_UPCALL_RETRY_WAIT */
- @@ -1736,7 +1736,7 @@ retry_wait:
- #endif /* NFSV41_UPCALL_RETRY_WAIT */
- default:
- DbgP("nfs41_upcall: KeWaitForSingleObject() "
- - "returned UNEXPECTED status(=%ld)\n",
- + "returned UNEXPECTED status(=0x%lx)\n",
- (long)status);
- goto out;
- }
- @@ -1760,8 +1760,10 @@ void unmarshal_nfs41_header(
- RtlCopyMemory(&tmp->errno, *buf, sizeof(tmp->errno));
- *buf += sizeof(tmp->errno);
- #ifdef DEBUG_MARSHAL_HEADER
- - DbgP("[downcall header] xid=%lld opcode='%s' status=0x%x errno=%d\n", tmp->xid,
- - ENTRY_OPCODE2STRING(tmp), tmp->status, tmp->errno);
- + DbgP("[downcall header] "
- + "xid=%lld opcode='%s' status=0x%lx errno=%d\n",
- + tmp->xid,
- + ENTRY_OPCODE2STRING(tmp), (long)tmp->status, tmp->errno);
- #endif
- }
- @@ -2921,9 +2923,9 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
- status = IoCheckEaBufferValidity(EaBuffer, EaLength, &error_offset);
- if (status) {
- - DbgP("status(=0x%x)=IoCheckEaBufferValidity"
- + DbgP("status(=0x%lx)=IoCheckEaBufferValidity"
- "(eainfo=0x%p, buflen=%lu, &(error_offset=%d)) failed\n",
- - (int)status, (void *)EaBuffer, EaLength,
- + (long)status, (void *)EaBuffer, EaLength,
- (int)error_offset);
- goto out;
- }
- @@ -3091,7 +3093,8 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
- }
- out:
- - DbgP("<-- nfs41_MountConfig_ParseOptions, status=0x%lx\n", (long)status);
- + DbgP("<-- nfs41_MountConfig_ParseOptions, status=0x%lx\n",
- + (long)status);
- return status;
- }
- @@ -5114,9 +5117,9 @@ NTSTATUS nfs41_SetEaInformation(
- status = IoCheckEaBufferValidity(eainfo, buflen, &error_offset);
- if (status) {
- DbgP("nfs41_SetEaInformation: "
- - "status(=0x%x)=IoCheckEaBufferValidity"
- + "status(=0x%lx)=IoCheckEaBufferValidity"
- "(eainfo=0x%p, buflen=%lu, &(error_offset=%d))\n",
- - (int)status, (void *)eainfo, buflen,
- + (long)status, (void *)eainfo, buflen,
- (int)error_offset);
- nfs41_UpcallDestroy(entry);
- entry = NULL;
- @@ -5773,8 +5776,8 @@ NTSTATUS nfs41_QueryFileInformation(
- pVNetRootContext->session, nfs41_fobx->nfs41_open_state,
- pNetRootContext->nfs41d_version, SrvOpen->pAlreadyPrefixedName, &entry);
- if (status) {
- - print_error("nfs41_UpcallCreate() failed, status=0x%x\n",
- - status);
- + print_error("nfs41_UpcallCreate() failed, status=0x%lx\n",
- + (long)status);
- goto out;
- }
- @@ -5784,8 +5787,8 @@ NTSTATUS nfs41_QueryFileInformation(
- status = nfs41_UpcallWaitForReply(entry, pVNetRootContext->timeout);
- if (status) {
- - print_error("nfs41_UpcallWaitForReply() failed, status=0x%x\n",
- - status);
- + print_error("nfs41_UpcallWaitForReply() failed, status=0x%lx\n",
- + (long)status);
- goto out;
- }
- @@ -5855,7 +5858,8 @@ NTSTATUS nfs41_QueryFileInformation(
- }
- } else {
- status = map_queryfile_error(entry->status);
- - print_error("status(0x%lx) = map_queryfile_error(entry->status(0x%lx));\n", (long)status, (long)entry->status);
- + print_error("status(0x%lx) = map_queryfile_error(entry->status(0x%lx));\n",
- + (long)status, (long)entry->status);
- }
- nfs41_UpcallDestroy(entry);
- out:
- @@ -7081,12 +7085,12 @@ NTSTATUS nfs41_FsCtl(
- const char *fsctl_str = fsctl2string(fscontrolcode);
- if (fsctl_str) {
- - DbgP("nfs41_FsCtl: FsControlCode='%s', status=0x%x\n",
- - fsctl_str, (int)status);
- + DbgP("nfs41_FsCtl: FsControlCode='%s', status=0x%lx\n",
- + fsctl_str, (long)status);
- }
- else {
- - DbgP("nfs41_FsCtl: FsControlCode=0x%lx, status=0x%x\n",
- - (unsigned long)fscontrolcode, (int)status);
- + DbgP("nfs41_FsCtl: FsControlCode=0x%lx, status=0x%lx\n",
- + (unsigned long)fscontrolcode, (long)status);
- }
- #endif /* DEBUG_FSCTL */
- @@ -7135,8 +7139,8 @@ NTSTATUS nfs41_FsdDispatch (
- out:
- #ifdef DEBUG_FSDDISPATCH
- - DbgP("IoStatus status = 0x%x info = 0x%x\n",
- - Irp->IoStatus.Status,
- + DbgP("IoStatus status = 0x%lx info = 0x%x\n",
- + (long)Irp->IoStatus.Status,
- Irp->IoStatus.Information);
- DbgEx();
- #endif
- --
- 2.45.1
- From 07569b1489a9a390138808f1e146b606d2dabc81 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 17:51:50 +0200
- Subject: [PATCH 7/8] cygwin,tests: Add workaround for $ svn checkout # failure
- to README+tests
- Add workaround for $ svn checkout # failure to the bintarball README
- and add this to the list of manual tests.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 31 +++++++++++++++++++++++++++++
- tests/manual_testing.txt | 38 ++++++++++++++++++++++++++++++++++++
- 2 files changed, 69 insertions(+)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index 81e8ab3..5a366bc 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -388,6 +388,37 @@ $ /sbin/nfs_mount
- - Win10/32bit-only: $ net use H: /delete # does not work,
- use $ nfs_mount -d 'H' instead #
- +- Bug: Subversion checkout can fail with
- + "sqlite[S11]: database disk image is malformed" like this:
- + ---- snip ----
- + $ svn checkout https://svn.FreeBSD.org/base/head/share/man
- + A man/man4
- + A man/man4/tcp.4
- + A man/man4/ndis.4
- + A man/man4/Makefile
- + A man/man4/altq.4
- + A man/man4/miibus.4
- + A man/man4/vlan.4
- + A man/man4/ng_macfilter.4
- + A man/man4/mn.4
- + A man/man4/ossl.4
- + A man/man4/ktls.4
- + A man/man4/ftwd.4
- + A man/man4/inet6.4
- + A man/man4/crypto.4
- + A man/man4/rtsx.4
- + A man/man4/isp.4
- + svn: E200030: sqlite[S11]: database disk image is malformed
- + svn: E200042: Additional errors:
- + svn: E200030: sqlite[S11]: database disk image is malformed
- + svn: E200030: sqlite[S11]: database disk image is malformed
- + svn: E200030: sqlite[S11]: database disk image is malformed
- + ---- snip ----
- + Workaround is to mount the NFS filesystem with the "writethru"
- + option, e.g.
- + $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
- +
- +
- #
- # 11. Notes for troubleshooting && finding bugs/debugging:
- #
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 7ce7c2f..3e1cfb1 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -279,4 +279,42 @@ chmod a+rx setup-x86_64.exe
- # check whether this will open the Cygwin installer window
- ./setup-x86_64 --no-admin
- +
- +#
- +# Subversion checkout:
- +#
- +# Currently fails like this:
- +# ---- snip ----
- +# $ svn checkout https://svn.FreeBSD.org/base/head/share/man
- +# A man/man4
- +# A man/man4/tcp.4
- +# A man/man4/ndis.4
- +# A man/man4/Makefile
- +# A man/man4/altq.4
- +# A man/man4/miibus.4
- +# A man/man4/vlan.4
- +# A man/man4/ng_macfilter.4
- +# A man/man4/mn.4
- +# A man/man4/ossl.4
- +# A man/man4/ktls.4
- +# A man/man4/ftwd.4
- +# A man/man4/inet6.4
- +# A man/man4/crypto.4
- +# A man/man4/rtsx.4
- +# A man/man4/isp.4
- +# svn: E200030: sqlite[S11]: database disk image is malformed
- +# svn: E200042: Additional errors:
- +# svn: E200030: sqlite[S11]: database disk image is malformed
- +# svn: E200030: sqlite[S11]: database disk image is malformed
- +# svn: E200030: sqlite[S11]: database disk image is malformed
- +# ---- snip ----
- +#
- +# Workaround is to mount the NFS filesystem with the "writethru"
- +# option, e.g.
- +# $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
- +#
- +# Test:
- +svn checkout https://svn.FreeBSD.org/base/head/share/man
- +
- +
- # EOF.
- --
- 2.45.1
- From fe4e8a32714ce886c46f2d2652363a77608d44a7 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 17 Jun 2024 18:45:23 +0200
- Subject: [PATCH 8/8] sys,nfs41_build_features.h: Add
- |NFS41_DRIVER_DEBUG_FS_NAME| to set fs name
- Add |NFS41_DRIVER_DEBUG_FS_NAME| to set fs name returned by
- |FileFsAttributeInfo|.
- This is STRICTLY for debugging only, as any other name than "NFS"
- breaks compatibilty with SFU and other applications, and breaks
- backwards compatibility with the Microsoft NFSv3 driver.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- nfs41_build_features.h | 10 ++++++++++
- sys/nfs41_driver.c | 6 ++++++
- 2 files changed, 16 insertions(+)
- diff --git a/nfs41_build_features.h b/nfs41_build_features.h
- index 7ca7b45..0fb2882 100644
- --- a/nfs41_build_features.h
- +++ b/nfs41_build_features.h
- @@ -123,4 +123,14 @@
- */
- #define NFS41_DRIVER_DEFAULT_CREATE_MODE (0755)
- +/*
- + * NFS41_DRIVER_DEBUG_FS_NAME - define which filesystem name should
- + * be returned by |FileFsAttributeInfo|
- + * 1 == "NFS" (like Microsoft, Exceed and OpenText NFS drivers)
- + * 2 == "DEBUG-NFS41" (custom value, used for disabling
- + * hardcoded codepaths for "nfs" drivers, and just treat
- + * this like a normal non-NFS MiniRDR driver
- + */
- +#define NFS41_DRIVER_DEBUG_FS_NAME 1
- +
- #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 6a237e4..09dd881 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -376,7 +376,13 @@ typedef struct _NFS41_NETROOT_EXTENSION {
- (PNFS41_NETROOT_EXTENSION)((pNetRoot)->Context))
- /* FileSystemName as reported by FileFsAttributeInfo query */
- +#if ((NFS41_DRIVER_DEBUG_FS_NAME) == 1)
- #define FS_NAME L"NFS"
- +#elif ((NFS41_DRIVER_DEBUG_FS_NAME) == 2)
- +#define FS_NAME L"DEBUG-NFS41"
- +#else
- +#error NFS41_DRIVER_DEBUG_FS_NAME not defined
- +#endif
- #define FS_NAME_LEN (sizeof(FS_NAME) - sizeof(WCHAR))
- #define FS_ATTR_LEN (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + FS_NAME_LEN)
- --
- 2.45.1
msnfs41client: "createmode=" mount option, debug rework+misc, 2024-06-17
Posted by Anonymous on Mon 17th Jun 2024 17:55
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.