Difference between
modified post cf70 by Anonymous on Fri 8th Dec 2023 10:08
original post bf464d81 by Anonymous on Thu 7th Dec 2023 14:19
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | diff --git a/cygwin/Makefile b/cygwin/Makefile | |
| 2 | - | index b7a3b1e..41e2340 100644 | |
| 2 | + | index b7a3b1e..e423d6f 100644 | |
| 3 | 3 | --- a/cygwin/Makefile | |
| 4 | 4 | +++ b/cygwin/Makefile | |
| 5 | - | @@ -57,7 +57,11 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \ | |
| 5 | + | @@ -57,7 +57,12 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \ | |
| 6 | 6 | fi | |
| 7 | 7 | mkdir -p $(DESTDIR) | |
| 8 | 8 | mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/sbin/ | |
| 9 | 9 | - mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/usr/bin | |
| 10 | 10 | + # /usr/bin is a bind mount to C:/cygwin64/bin, so copy binaries to /cygdrive/c/cygwin64/bin | |
| 11 | 11 | + mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/bin | |
| 12 | 12 | + # /usr/lib is a bind mount to C:/cygwin64/lib, so copy library data to /cygdrive/c/cygwin64/lib | |
| 13 | 13 | + mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/lib | |
| 14 | 14 | + mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client | |
| 15 | + | + mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/src/msnfs41client | |
| 15 | 16 | cp -r $(VS_BUILD_DIR)/nfsd.exe $(DESTDIR)/cygdrive/c/cygwin64/sbin/nfsd_debug.exe | |
| 16 | 17 | cp -r $(VS_BUILD_DIR)/nfsd.pdb $(DESTDIR)/cygdrive/c/cygwin64/sbin/nfsd_debug.pdb | |
| 17 | 18 | cp -r $(VS_BUILD_DIR)/nfs_mount.* $(DESTDIR)/cygdrive/c/cygwin64/sbin/. | |
| 18 | - | @@ -70,15 +74,16 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \ | |
| 19 | + | @@ -70,15 +75,21 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \ | |
| 19 | 20 | cp $(PROJECT_BASEDIR_DIR)/etc_netconfig $(DESTDIR)/cygdrive/c/cygwin64/sbin/. | |
| 20 | 21 | cp $(PROJECT_BASEDIR_DIR)/ms-nfs41-idmap.conf $(DESTDIR)/cygdrive/c/cygwin64/sbin/. | |
| 21 | 22 | cp $(CYGWIN_MAKEFILE_DIR)/devel/msnfs41client.bash $(DESTDIR)/cygdrive/c/cygwin64/sbin/. | |
| 22 | 23 | + cp $(PROJECT_BASEDIR_DIR)/cygwin_idmapper.ksh $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/. | |
| 24 | + | + @ printf "# Package sources and diffs\n" | |
| 23 | 29 | cp $(CYGWIN_MAKEFILE_DIR)/utils/mount_sshnfs/mount_sshnfs.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/mount_sshnfs | |
| 24 | 30 | chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/mount_sshnfs | |
| 25 | 31 | cp $(CYGWIN_MAKEFILE_DIR)/utils/sshnfs/sshnfs.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs | |
| 26 | 32 | chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs | |
| 27 | 33 | @ printf "# Package tests\n" | |
| 28 | 34 | - cp tests/winfsinfo1/winfsinfo.exe $(DESTDIR)/cygdrive/c/cygwin64/usr/bin/winfsinfo.exe | |
| 29 | 35 | + cp tests/winfsinfo1/winfsinfo.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/winfsinfo.exe | |
| 30 | 36 | @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n" | |
| 31 | 37 | - [[ -x /usr/bin/ksh93.exe ]] && cp /usr/bin/ksh93.exe $(DESTDIR)/cygdrive/c/cygwin64/usr/bin/ksh93.exe | |
| 32 | 38 | - [[ -x /usr/bin/shcomp.exe ]] && cp /usr/bin/shcomp.exe $(DESTDIR)/cygdrive/c/cygwin64/usr/bin/shcomp.exe | |
| 33 | 39 | + [[ -x /usr/bin/ksh93.exe ]] && cp /usr/bin/ksh93.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/ksh93.exe | |
| 34 | 40 | + [[ -x /usr/bin/shcomp.exe ]] && cp /usr/bin/shcomp.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/shcomp.exe | |
| 35 | 41 | @ printf "# Set file flags\n" | |
| 36 | 42 | (cd $(DESTDIR)/cygdrive/c/cygwin64/sbin/ ; chmod a+x *.exe *.dll *.sys *.bash) | |
| 37 | 43 | @printf "\n#\n# TEST sbin dir is %s\n#\n" "$(DESTDIR)/cygdrive/c/cygwin64/sbin/" | |
| 38 | - | @@ -86,6 +91,14 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \ | |
| 44 | + | @@ -86,6 +97,14 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \ | |
| 39 | 45 | @printf "\n#\n# Now use\n# $$ cd '%s' && bash ./msnfs41client.bash install #\n# to install the kernel driver as Admin\n#\n" \ | |
| 40 | 46 | "$(DESTDIR)/cygdrive/c/cygwin64/sbin/" | |
| 41 | 47 | ||
| 42 | 48 | +bintarball: installdest | |
| 43 | 49 | + (cd destdir && \ | |
| 44 | 50 | + tar -cvf - \ | |
| 45 | 51 | + --owner=SYSTEM \ | |
| 46 | 52 | + --group=SYSTEM \ | |
| 47 | 53 | + cygdrive/c/cygwin64 | \ | |
| 48 | 54 | + bzip2 -9 >msnfs41client_cygwin_binaries.tar.bz2) | |
| 49 | 55 | + | |
| 50 | 56 | # | |
| 51 | 57 | # clean destdir/, but only if nfsd*.exe does not use it right now | |
| 52 | 58 | # | |
| 53 | - | @@ -94,6 +107,6 @@ cleandest: | |
| 59 | + | @@ -94,6 +113,6 @@ cleandest: | |
| 54 | 60 | printf 'DIR %q is in use by a process\n' "$DESTDIR" 1>&2 ; \ | |
| 55 | 61 | exit 1 ; \ | |
| 56 | 62 | fi | |
| 57 | 63 | - rm -r "$(DESTDIR)" | |
| 58 | - | + rm -rf "$(DESTDIR)" | |
| 64 | + | + rm -rvf "$(DESTDIR)" | |
| 59 | 65 | ||
| 60 | 66 | # EOF. | |
| 61 | - | diff --git a/daemon/getattr.c b/daemon/getattr.c | |
| 67 | + | diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | |
| 62 | - | index 7c5f241..7621dba 100644 | |
| 68 | + | index 9b5c76e..4193d56 100755 | |
| 63 | - | --- a/daemon/getattr.c | |
| 69 | + | --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | |
| 64 | - | +++ b/daemon/getattr.c | |
| 70 | + | +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | |
| 65 | - | @@ -59,8 +59,19 @@ int nfs41_cached_getattr( | |
| 71 | + | @@ -312,7 +312,7 @@ function cmd_mount | |
| 66 | - | static int parse_getattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall) | |
| 72 | + | ||
| 67 | - | { | |
| 73 | + | # fixme: Need better text layout for $ mount_sshnfs mount --man # | |
| 68 | - | int status; | |
| 74 | + | typeset -r mount_sshnfs_cmdmount_usage=$'+ | |
| 69 | - | +#if 1 | |
| 75 | + | - [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2023-07-24 \$\n] | |
| 70 | - | + EASSERT(length > 4); | |
| 76 | + | + [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2023-12-08 \$\n] | |
| 71 | - | + if (length <= 4) { | |
| 77 | + | [-author?Roland Mainz <roland.mainz@nrubsig.org>] | |
| 72 | - | + status = ERROR_INVALID_PARAMETER; | |
| 78 | + | [+NAME?mount_sshnfs mount - mount NFSv4 filesystem through ssh | |
| 73 | - | + goto out; | |
| 79 | + | tunnel] | |
| 74 | - | + } | |
| 80 | + | @@ -668,7 +668,7 @@ function cmd_umount | |
| 75 | - | + EASSERT(upcall->state_ref != NULL); | |
| 81 | + | typeset mydebug=false # fixme: should be "bool" for ksh93v | |
| 76 | - | + if (upcall->state_ref == NULL) { | |
| 82 | + | # fixme: Need better text layout for $ mount_sshnfs mount --man # | |
| 77 | - | + status = ERROR_INVALID_PARAMETER; | |
| 83 | + | typeset -r mount_sshnfs_cmdumount_usage=$'+ | |
| 78 | - | + goto out; | |
| 84 | + | - [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2023-07-24 \$\n] | |
| 79 | - | + } | |
| 85 | + | + [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2023-12-08 \$\n] | |
| 80 | - | +#endif | |
| 86 | + | [-author?Roland Mainz <roland.mainz@nrubsig.org>] | |
| 81 | - | getattr_upcall_args *args = &upcall->args.getattr; | |
| 87 | + | [+NAME?mount_sshnfs umount - unmount NFSv4 filesystem mounted | |
| 82 | - | - | |
| 88 | + | via mount_sshnfs mount] | |
| 83 | - | status = safe_read(&buffer, &length, &args->query_class, sizeof(args->query_class)); | |
| 89 | + | @@ -772,7 +772,7 @@ function main | |
| 89 | 90 | ||
| 90 | - | +#if 1 | |
| 91 | + | # fixme: Need better text layout for $ mount_sshnfs --man # | |
| 91 | - | + if (((char *)state->session) == ((char *)0xdddddddddddddddd)) { | |
| 92 | + | typeset -r mount_sshnfs_usage=$'+ | |
| 92 | - | + eprintf("handle_getattr: Invalid session pointer 0xdddddddddddddddd\n"); | |
| 93 | + | - [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2023-07-24 \$\n] | |
| 93 | - | + status = ERROR_INVALID_PARAMETER; | |
| 94 | + | + [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2023-12-08 \$\n] | |
| 94 | - | + goto out; | |
| 95 | + | [-author?Roland Mainz <roland.mainz@nrubsig.org>] | |
| 95 | - | + } | |
| 96 | + | [+NAME?mount_sshnfs - mount/umount NFSv4 filesystem via ssh | |
| 96 | - | + | |
| 97 | + | tunnel] | |
| 97 | - | + EASSERT(state->file.fh.superblock != NULL); | |
| 98 | + | @@ -809,8 +809,8 @@ function main | |
| 98 | - | + if (state->file.fh.superblock == NULL) { | |
| 99 | + | if [[ "${ uname -o ;}" == 'Cygwin' ]] ; then | |
| 99 | - | + /* gisburn: fixme: maybe this should be |ERROR_INTERNAL_ERROR| ? */ | |
| 100 | + | integer c.is_ccygwin=1 | |
| 100 | - | + status = ERROR_INVALID_PARAMETER; | |
| 101 | + | ||
| 101 | - | + goto out; | |
| 102 | + | - # only for testing!! | |
| 102 | - | + } | |
| 103 | + | - PATH+=':/cygdrive/c/Users/roland_mainz/Downloads/ms-nfs41-client-x64/ms-nfs41-client-x64/' | |
| 103 | - | +#endif | |
| 104 | + | + # Cygwin has nfs_mount.exe in /sbin | |
| 104 | - | + | |
| 105 | + | + PATH+=':/sbin:/usr/sbin:/usr/bin:/bin' | |
| 113 | 106 | ||
| 114 | - | #define CYGWIN_IDMAPPER_SCRIPT \ | |
| 107 | + | typeset c.msnfsv41_nfsmountcmd="$(which 'nfs_mount.exe')" | |
| 118 | 108 | ||
| 119 | - | ||
| 109 | + | diff --git a/daemon/getattr.c b/daemon/getattr.c | |
| 120 | - | #ifdef NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN | |
| 110 | + | index 7c5f241..7621dba 100644 | |
| 121 | - | diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c | |
| 111 | + | --- a/daemon/getattr.c | |
| 122 | - | index fe0683e..a43d51e 100644 | |
| 112 | + | +++ b/daemon/getattr.c | |
| 123 | - | --- a/daemon/nfs41_daemon.c | |
| 113 | + | @@ -59,8 +59,19 @@ int nfs41_cached_getattr( | |
| 124 | - | +++ b/daemon/nfs41_daemon.c | |
| 114 | + | static int parse_getattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall) | |
| 125 | - | @@ -415,7 +415,21 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv) | |
| 115 | + | { | |
| 126 | - | #ifdef _DEBUG | |
| 116 | + | int status; | |
| 134 | 117 | +#if 1 | |
| 135 | - | + /* | |
| 118 | + | + EASSERT(length > 4); | |
| 136 | - | + * _CRTDBG_DELAY_FREE_MEM_DF - Delay freeing of memory, but fill | |
| 119 | + | + if (length <= 4) { | |
| 137 | - | + * memory blocks passed to |free()| with 0xdd. We rely on that to | |
| 120 | + | + status = ERROR_INVALID_PARAMETER; | |
| 138 | - | + * see 0xdddddddddddddddd-pointers for use-after-free and catch | |
| 121 | + | + goto out; | |
| 139 | - | + * them in stress testing instead of having to deal with a core | |
| 122 | + | + } | |
| 140 | - | + * dump | |
| 123 | + | + EASSERT(upcall->state_ref != NULL); | |
| 141 | - | + */ | |
| 124 | + | + if (upcall->state_ref == NULL) { | |
| 142 | - | + crtsetdbgflags |= _CRTDBG_DELAY_FREE_MEM_DF; | |
| 125 | + | + status = ERROR_INVALID_PARAMETER; | |
| 126 | + | + goto out; | |
| 143 | 128 | +#endif | |
| 144 | - | + (void)_CrtSetDbgFlag(crtsetdbgflags); | |
| 129 | + | getattr_upcall_args *args = &upcall->args.getattr; | |
| 145 | - | _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); | |
| 130 | + | - | |
| 131 | + | status = safe_read(&buffer, &length, &args->query_class, sizeof(args->query_class)); | |
| 146 | 137 | ||
| 147 | - | /* | |
| 138 | + | +#if 1 | |
| 148 | - | diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c | |
| 139 | + | + if (((char *)state->session) == ((char *)0xdddddddddddddddd)) { | |
| 149 | - | index bcca070..f2a4f22 100644 | |
| 140 | + | + eprintf("handle_getattr: Invalid session pointer 0xdddddddddddddddd\n"); | |
| 150 | - | --- a/daemon/nfs41_ops.c | |
| 141 | + | + status = ERROR_INVALID_PARAMETER; | |
| 151 | - | +++ b/daemon/nfs41_ops.c | |
| 142 | + | + goto out; | |
| 152 | - | @@ -400,6 +400,9 @@ int nfs41_open( | |
| 143 | + | + } | |
| 158 | 144 | + | |
| 159 | - | /* depending on the claim type, OPEN expects CURRENT_FH set | |
| 145 | + | + EASSERT(state->file.fh.superblock != NULL); | |
| 160 | - | * to either the parent directory, or to the file itself */ | |
| 146 | + | + if (state->file.fh.superblock == NULL) { | |
| 161 | - | switch (claim->claim) { | |
| 147 | + | + /* gisburn: fixme: maybe this should be |ERROR_INTERNAL_ERROR| ? */ | |
| 162 | - | diff --git a/daemon/open.c b/daemon/open.c | |
| 148 | + | + status = ERROR_INVALID_PARAMETER; | |
| 163 | - | index 8c01ac1..1cbac2c 100644 | |
| 149 | + | + goto out; | |
| 164 | - | --- a/daemon/open.c | |
| 150 | + | + } | |
| 165 | - | +++ b/daemon/open.c | |
| 151 | + | +#endif | |
| 166 | - | @@ -99,6 +99,24 @@ static void open_state_free( | |
| 152 | + | + | |
| 167 | - | void nfs41_open_state_ref( | |
| 153 | + | status = nfs41_cached_getattr(state->session, &state->file, &info); | |
| 168 | - | IN nfs41_open_state *state) | |
| 154 | + | if (status) { | |
| 169 | - | { | |
| 155 | + | eprintf("nfs41_cached_getattr() failed with %d\n", status); | |
| 170 | - | +#if 1 | |
| 156 | + | diff --git a/daemon/idmap_cygwin.c b/daemon/idmap_cygwin.c | |
| 171 | - | + /* | |
| 157 | + | index 64c1bff..f8bb74e 100644 | |
| 172 | - | + * gisburn: fixme: sometimes this happens under high parallel | |
| 158 | + | --- a/daemon/idmap_cygwin.c | |
| 173 | - | + * usage with multiple mounts - but why ? | |
| 159 | + | +++ b/daemon/idmap_cygwin.c | |
| 174 | - | + * 0:038> kp | |
| 160 | + | @@ -40,7 +40,7 @@ | |
| 175 | - | + * Child-SP RetAddr Call Site | |
| 161 | + | ||
| 176 | - | + * 0000006d`431fde10 00007ff7`32f7d905 nfsd!nfs41_open_state_ref(struct __nfs41_open_state * state = 0x00000000`00000000)+0x31 | |
| 162 | + | #define CYGWIN_IDMAPPER_SCRIPT \ | |
| 177 | - | + * 0000006d`431fdf30 00007ff7`32f4d284 nfsd!upcall_parse(unsigned char * buffer = 0x0000006d`431fe180 "???", unsigned int length = 8, struct __nfs41_upcall * upcall = 0x0000006d`431ff1e0)+0x2e5 | |
| 163 | + | ("C:\\cygwin64\\bin\\ksh93.exe " \ | |
| 178 | - | + * 0000006d`431fe0b0 00007ffc`1ca24c7c nfsd!thread_main(void * args = 0x00007ff7`32fb6080)+0x144 | |
| 164 | + | - "/home/roland_mainz/work/msnfs41_uidmapping/ms-nfs41-client/cygwin_idmapper.ksh") | |
| 179 | - | + * 0000006d`431ffe00 00007ffc`4d4b7344 ucrtbased!thread_start<unsigned int (void * parameter = 0x0000025d`a9c6def0)+0x9c | |
| 165 | + | + "/cygdrive/c/cygwin64/lib/msnfs41client/cygwin_idmapper.ksh") | |
| 189 | 166 | ||
| 190 | - | dprintf(2, "nfs41_open_state_ref(%s) count %d\n", state->path.path, count); | |
| 167 | + | ||
| 191 | - | diff --git a/daemon/upcall.c b/daemon/upcall.c | |
| 168 | + | #ifdef NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN | |
| 192 | - | index bd13c61..7778429 100644 | |
| 169 | + | diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c | |
| 193 | - | --- a/daemon/upcall.c | |
| 170 | + | index fe0683e..ecea1db 100644 | |
| 194 | - | +++ b/daemon/upcall.c | |
| 171 | + | --- a/daemon/nfs41_daemon.c | |
| 195 | - | @@ -121,6 +121,7 @@ int upcall_parse( | |
| 172 | + | +++ b/daemon/nfs41_daemon.c | |
| 196 | - | /* parse the operation's arguments */ | |
| 173 | + | @@ -415,7 +415,21 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv) | |
| 197 | - | op = g_upcall_op_table[upcall->opcode]; | |
| 174 | + | #ifdef _DEBUG | |
| 198 | - | if (op && op->parse) { | |
| 175 | + | /* dump memory leaks to stderr on exit; this requires the debug heap, | |
| 199 | - | + EASSERT(length > 0); | |
| 176 | + | /* available only when built in debug mode under visual studio -cbodley */ | |
| 200 | - | status = op->parse(buffer, length, upcall); | |
| 177 | + | - _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); | |
| 201 | - | if (status) { | |
| 178 | + | + | |
| 202 | - | eprintf("parsing of upcall '%s' failed with %d.\n", | |
| 179 | + | + int crtsetdbgflags = 0; | |
| 203 | - | diff --git a/sys/nfs41_build_features.h b/sys/nfs41_build_features.h | |
| 180 | + | + crtsetdbgflags |= _CRTDBG_ALLOC_MEM_DF; /* use debug heap */ | |
| 204 | - | index 93ee7a9..d43334a 100644 | |
| 181 | + | + crtsetdbgflags |= _CRTDBG_LEAK_CHECK_DF; /* report leaks on exit */ | |
| 205 | - | --- a/sys/nfs41_build_features.h | |
| 182 | + | +#if 0 | |
| 206 | - | +++ b/sys/nfs41_build_features.h | |
| 183 | + | + /* | |
| 207 | - | @@ -32,19 +32,19 @@ | |
| 184 | + | + * _CRTDBG_DELAY_FREE_MEM_DF - Delay freeing of memory, but fill | |
| 208 | - | /* | |
| 185 | + | + * memory blocks passed to |free()| with 0xdd. We rely on that to | |
| 209 | - | * NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES - return local uid/gid values | |
| 186 | + | + * see 0xdddddddddddddddd-pointers for use-after-free and catch | |
| 210 | - | */ | |
| 187 | + | + * them in stress testing instead of having to deal with a core | |
| 211 | - | -// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1 | |
| 188 | + | + * dump | |
| 212 | - | +#define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1 | |
| 189 | + | + */ | |
| 190 | + | + crtsetdbgflags |= _CRTDBG_DELAY_FREE_MEM_DF; | |
| 213 | 194 | ||
| 214 | 195 | /* | |
| 215 | - | * NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID - give NFS | |
| 196 | + | diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c | |
| 216 | - | * files which do not map to a local account a SID in the | |
| 197 | + | index bcca070..f2a4f22 100644 | |
| 217 | - | * Unix_User+x/Unix_Group+x range | |
| 198 | + | --- a/daemon/nfs41_ops.c | |
| 218 | - | */ | |
| 199 | + | +++ b/daemon/nfs41_ops.c | |
| 219 | - | -// #define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1 | |
| 200 | + | @@ -400,6 +400,9 @@ int nfs41_open( | |
| 220 | - | +#define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1 | |
| 201 | + | bool_t already_delegated = delegation->type == OPEN_DELEGATE_READ | |
| 202 | + | || delegation->type == OPEN_DELEGATE_WRITE; | |
| 221 | 203 | ||
| 222 | - | /* | |
| 204 | + | + EASSERT(parent); | |
| 223 | - | * NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN - use Cygwin /usr/bin/getent | |
| 205 | + | + EASSERT(parent->fh.superblock); | |
| 224 | - | * as "name service" | |
| 206 | + | + | |
| 225 | - | */ | |
| 207 | + | /* depending on the claim type, OPEN expects CURRENT_FH set | |
| 226 | - | -// #define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1 | |
| 208 | + | * to either the parent directory, or to the file itself */ | |
| 227 | - | +#define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1 | |
| 209 | + | switch (claim->claim) { | |
| 228 | - | ||
| 210 | + | diff --git a/daemon/open.c b/daemon/open.c | |
| 229 | - | #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */ | |
| 211 | + | index 8c01ac1..1cbac2c 100644 | |
| 230 | - | diff --git a/tests/winlocktest1/winlocktest1.ksh b/tests/winlocktest1/winlocktest1.ksh | |
| 212 | + | --- a/daemon/open.c | |
| 231 | - | old mode 100644 | |
| 213 | + | +++ b/daemon/open.c | |
| 232 | - | new mode 100755 | |
| 214 | + | @@ -99,6 +99,24 @@ static void open_state_free( | |
| 233 | - | ||
| 215 | + | void nfs41_open_state_ref( | |
| 234 | - | ||
| 216 | + | IN nfs41_open_state *state) | |
| 235 | - | ||
| 217 | + | { | |
| 236 | - | ||
| 218 | + | +#if 1 | |
| 237 | - | ||
| 219 | + | + /* | |
| 238 | - | ||
| 220 | + | + * gisburn: fixme: sometimes this happens under high parallel | |
| 239 | - | ||
| 221 | + | + * usage with multiple mounts - but why ? | |
| 240 | - | ||
| 222 | + | + * 0:038> kp | |
| 241 | - | ||
| 223 | + | + * Child-SP RetAddr Call Site | |
| 242 | - | ||
| 224 | + | + * 0000006d`431fde10 00007ff7`32f7d905 nfsd!nfs41_open_state_ref(struct __nfs41_open_state * state = 0x00000000`00000000)+0x31 | |
| 243 | - | ||
| 225 | + | + * 0000006d`431fdf30 00007ff7`32f4d284 nfsd!upcall_parse(unsigned char * buffer = 0x0000006d`431fe180 "???", unsigned int length = 8, struct __nfs41_upcall * upcall = 0x0000006d`431ff1e0)+0x2e5 | |
| 244 | - | ||
| 226 | + | + * 0000006d`431fe0b0 00007ffc`1ca24c7c nfsd!thread_main(void * args = 0x00007ff7`32fb6080)+0x144 | |
| 245 | - | ||
| 227 | + | + * 0000006d`431ffe00 00007ffc`4d4b7344 ucrtbased!thread_start<unsigned int (void * parameter = 0x0000025d`a9c6def0)+0x9c | |
| 246 | - | ||
| 228 | + | + * 0000006d`431ffe60 00007ffc`4efc26b1 KERNEL32!BaseThreadInitThunk+0x14 | |
| 247 | - | ||
| 229 | + | + * 0000006d`431ffe90 00000000`00000000 ntdll!RtlUserThreadStart+0x21 | |
| 248 | - | ||
| 230 | + | + */ | |
| 249 | - | ||
| 231 | + | + EASSERT(state != NULL); | |
| 250 | - | ||
| 232 | + | + if (state == NULL) | |
| 251 | - | ||
| 233 | + | + return; | |
| 252 | - | ||
| 234 | + | +#endif | |
| 253 | - | ||
| 235 | + | + | |
| 254 | - | ||
| 236 | + | const LONG count = InterlockedIncrement(&state->ref_count); | |
| 255 | 237 | ||
| 256 | - | ||
| 238 | + | dprintf(2, "nfs41_open_state_ref(%s) count %d\n", state->path.path, count); | |
| 257 | - | ||
| 239 | + | diff --git a/daemon/upcall.c b/daemon/upcall.c | |
| 258 | - | ||
| 240 | + | index bd13c61..7778429 100644 | |
| 259 | - | ||
| 241 | + | --- a/daemon/upcall.c | |
| 260 | - | ||
| 242 | + | +++ b/daemon/upcall.c | |
| 261 | - | ||
| 243 | + | @@ -121,6 +121,7 @@ int upcall_parse( | |
| 262 | - | ||
| 244 | + | /* parse the operation's arguments */ | |
| 263 | - | ||
| 245 | + | op = g_upcall_op_table[upcall->opcode]; | |
| 264 | - | ||
| 246 | + | if (op && op->parse) { | |
| 265 | - | ||
| 247 | + | + EASSERT(length > 0); | |
| 266 | - | ||
| 248 | + | status = op->parse(buffer, length, upcall); | |
| 267 | - | ||
| 249 | + | if (status) { | |
| 268 | - | ||
| 250 | + | eprintf("parsing of upcall '%s' failed with %d.\n", | |
| 269 | - | ||
| 251 | + | diff --git a/sys/nfs41_build_features.h b/sys/nfs41_build_features.h | |
| 270 | - | ||
| 252 | + | index 93ee7a9..d43334a 100644 | |
| 271 | - | ||
| 253 | + | --- a/sys/nfs41_build_features.h | |
| 272 | - | ||
| 254 | + | +++ b/sys/nfs41_build_features.h | |
| 273 | - | ||
| 255 | + | @@ -32,19 +32,19 @@ | |
| 274 | - | ||
| 256 | + | /* | |
| 275 | - | ||
| 257 | + | * NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES - return local uid/gid values | |
| 276 | - | ||
| 258 | + | */ | |
| 277 | - | ||
| 259 | + | -// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1 | |
| 278 | - | ||
| 260 | + | +#define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1 | |
| 279 | 261 | ||
| 280 | - | ||
| 262 | + | /* | |
| 281 | - | ||
| 263 | + | * NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID - give NFS | |
| 282 | - | ||
| 264 | + | * files which do not map to a local account a SID in the | |
| 283 | - | ||
| 265 | + | * Unix_User+x/Unix_Group+x range | |
| 284 | - | ||
| 266 | + | */ | |
| 285 | - | ||
| 267 | + | -// #define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1 | |
| 286 | - | ||
| 268 | + | +#define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1 | |
| 287 | 269 | ||
| 288 | - | ||
| 270 | + | /* | |
| 289 | - | ||
| 271 | + | * NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN - use Cygwin /usr/bin/getent | |
| 290 | - | ||
| 272 | + | * as "name service" | |
| 291 | - | ||
| 273 | + | */ | |
| 292 | - | ||
| 274 | + | -// #define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1 | |
| 293 | - | ||
| 275 | + | +#define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1 | |
| 294 | 276 | ||
| 295 | - | ||
| 277 | + | #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */ | |
| 296 | - | ||
| 278 | + | diff --git a/tests/winlocktest1/winlocktest1.ksh b/tests/winlocktest1/winlocktest1.ksh | |
| 297 | - | ||
| 279 | + | old mode 100644 | |
| 298 | - | ||
| 280 | + | new mode 100755 | |
| 299 | 281 |
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.
nrubsig.kpaste.net RSS