pastebin - collaborative debugging tool
rovema.kpaste.net RSS

Difference between
modified post b120881 by Anonymous on Wed 20th Sep 2023 15:07
original post 36f61 by Anonymous on Tue 19th Sep 2023 17:08
Download diff
Show old version | new version | both versions

    
11
diff --git a/daemon/mount.c b/daemon/mount.c
2-
index 55345f6..50b986b 100644
2+
index 55345f6..3b18cba 100644
33
--- a/daemon/mount.c
44
+++ b/daemon/mount.c
55
@@ -37,6 +37,8 @@ static int parse_mount(unsigned char *buffer, uint32_t length, nfs41_upcall *upc
66
77
     status = get_name(&buffer, &length, &args->hostname);
88
     if(status) goto out;
99
+    status = safe_read(&buffer, &length, &args->port, sizeof(DWORD));
1010
+    if (status) goto out;
1111
     status = get_name(&buffer, &length, &args->path);
1212
     if(status) goto out;
1313
     status = safe_read(&buffer, &length, &args->sec_flavor, sizeof(DWORD));
1414
@@ -46,10 +48,12 @@ static int parse_mount(unsigned char *buffer, uint32_t length, nfs41_upcall *upc
1515
     status = safe_read(&buffer, &length, &args->wsize, sizeof(DWORD));
1616
     if (status) goto out;
1717
1818
-    dprintf(1, "parsing NFS14_MOUNT: srv_name=%s root=%s sec_flavor=%s "
1919
-        "rsize=%d wsize=%d\n", args->hostname, args->path,
20-
+    dprintf(1, "parsing NFS14_MOUNT: srv_name=%s port=%d root=%s "
20+
+    dprintf(1, "parsing NFS41_MOUNT: srv_name=%s port=%d root=%s "
2121
+        "sec_flavor=%s rsize=%d wsize=%d\n", args->hostname, args->port, args->path,
2222
         secflavorop2name(args->sec_flavor), args->rsize, args->wsize);
2323
+    return status;
2424
 out:
25-
+    dprintf(1, "parsing NFS14_MOUNT: failed %d\n", status);
25+
+    dprintf(1, "parsing NFS41_MOUNT: failed %d\n", status);
2626
     return status;
2727
 }
2828
2929
@@ -64,7 +68,7 @@ static int handle_mount(nfs41_upcall *upcall)
3030
     nfs41_path_fh file;
3131
3232
     // resolve hostname,port
3333
-    status = nfs41_server_resolve(args->hostname, 2049, &addrs);
3434
+    status = nfs41_server_resolve(args->hostname, (unsigned short)args->port, &addrs);
3535
     if (status) {
3636
         eprintf("nfs41_server_resolve() failed with %d\n", status);
3737
         goto out;
3838
@@ -76,7 +80,7 @@ static int handle_mount(nfs41_upcall *upcall)
3939
         root = upcall->root_ref;
4040
     } else {
4141
         // create root
4242
-        status = nfs41_root_create(args->hostname, args->sec_flavor,
4343
+        status = nfs41_root_create(args->hostname, args->port, args->sec_flavor,
4444
             args->wsize + WRITE_OVERHEAD, args->rsize + READ_OVERHEAD, &root);
4545
         if (status) {
4646
             eprintf("nfs41_root_create() failed %d\n", status);
4747
diff --git a/daemon/namespace.c b/daemon/namespace.c
48-
index ab16f49..11917e2 100644
48+
index ab16f49..e3ea077 100644
4949
--- a/daemon/namespace.c
5050
+++ b/daemon/namespace.c
5151
@@ -36,6 +36,7 @@
5252
 /* nfs41_root */
5353
 int nfs41_root_create(
5454
     IN const char *name,
5555
+    IN uint32_t port,
5656
     IN uint32_t sec_flavor,
5757
     IN uint32_t wsize,
5858
     IN uint32_t rsize,
5959
@@ -44,7 +45,7 @@ int nfs41_root_create(
6060
     int status = NO_ERROR;
6161
     nfs41_root *root;
6262
6363
-    dprintf(NSLVL, "--> nfs41_root_create()\n");
6464
+    dprintf(NSLVL, "--> nfs41_root_create(name=%s, port=%d)\n", name, port);
6565
6666
     root = calloc(1, sizeof(nfs41_root));
6767
     if (root == NULL) {
6868
@@ -60,7 +61,7 @@ int nfs41_root_create(
6969
     root->sec_flavor = sec_flavor;
7070
7171
     /* generate a unique client_owner */
7272
-    status = nfs41_client_owner(name, sec_flavor, &root->client_owner);
7373
+    status = nfs41_client_owner(name, port, sec_flavor, &root->client_owner);
7474
     if (status) {
7575
         eprintf("nfs41_client_owner() failed with %d\n", status);
7676
         free(root);
7777
@@ -443,6 +444,8 @@ static int referral_mount_location(
7878
     int status = ERROR_BAD_NET_NAME;
7979
     uint32_t i;
8080
8181
+    dprintf(NSLVL, "--> referral_mount_location()\n");
8282
+
8383
     /* create a client and session for the first available server */
8484
     for (i = 0; i < loc->server_count; i++) {
8585
         /* XXX: only deals with 'address' as a hostname with default port */
8686
@@ -453,6 +456,9 @@ static int referral_mount_location(
8787
         if (status == NO_ERROR)
8888
             break;
8989
     }
9090
+
9191
+    dprintf(NSLVL, "<-- referral_mount_location() returning %d\n", status);
9292
+
9393
     return status;
9494
 }
9595
9696
diff --git a/daemon/nfs41.h b/daemon/nfs41.h
9797
index aa679a6..3902393 100644
9898
--- a/daemon/nfs41.h
9999
+++ b/daemon/nfs41.h
100100
@@ -287,6 +287,7 @@ typedef struct __nfs41_root {
101101
 /* nfs41_namespace.c */
102102
 int nfs41_root_create(
103103
     IN const char *name,
104104
+    IN uint32_t port,
105105
     IN uint32_t sec_flavor,
106106
     IN uint32_t wsize,
107107
     IN uint32_t rsize,
108108
@@ -404,6 +405,7 @@ void nfs41_server_addrs(
109109
 /* nfs41_client.c */
110110
 int nfs41_client_owner(
111111
     IN const char *name,
112112
+    IN uint32_t port,
113113
     IN uint32_t sec_flavor,
114114
     OUT client_owner4 *owner);
115115
116116
diff --git a/daemon/nfs41_client.c b/daemon/nfs41_client.c
117-
index 0460fc5..01d19ac 100644
117+
index 0460fc5..f5bac1d 100644
118118
--- a/daemon/nfs41_client.c
119119
+++ b/daemon/nfs41_client.c
120120
@@ -353,6 +353,7 @@ out:
121121
122122
 int nfs41_client_owner(
123123
     IN const char *name,
124124
+    IN uint32_t port,
125125
     IN uint32_t sec_flavor,
126126
     OUT client_owner4 *owner)
127127
 {
128-
diff --git a/daemon/nfs41_server.c b/daemon/nfs41_server.c
128+
@@ -405,6 +406,12 @@ int nfs41_client_owner(
129-
index d58c03a..ef8f0ac 100644
129+
         goto out_hash;
139130
 }
140-
diff --git a/daemon/upcall.h b/daemon/upcall.h
131+
141-
index fd26353..cf85598 100644
132+
+    if (!CryptHashData(hash, (const BYTE*)&port, (DWORD)sizeof(port), 0)) {
142-
--- a/daemon/upcall.h
133+
+        status = GetLastError();
143-
+++ b/daemon/upcall.h
134+
+        eprintf("CryptHashData() failed with %d\n", status);
144-
@@ -30,6 +30,7 @@
135+
+        goto out_hash;
145-
 /* structures for upcall arguments */
136+
+    }
146-
 typedef struct __mount_upcall_args {
137+
+
147-
     const char *hostname;
138+
     /* add the mac address from each applicable adapter to the hash */
148-
+    DWORD       port;
139+
     status = hash_mac_addrs(hash);
149-
     const char *path;
140+
     if (status) {
150-
     DWORD       sec_flavor;
141+
diff --git a/daemon/nfs41_server.c b/daemon/nfs41_server.c
151-
     DWORD       rsize;
142+
index d58c03a..ef8f0ac 100644
152-
diff --git a/mount/mount.c b/mount/mount.c
143+
--- a/daemon/nfs41_server.c
153-
index 4615fc9..6d8c8ee 100644
144+
+++ b/daemon/nfs41_server.c
154-
--- a/mount/mount.c
145+
@@ -338,6 +338,6 @@ out:
155-
+++ b/mount/mount.c
146+
             "error %d\n", hostname, port, status);
156-
@@ -61,13 +61,14 @@ static VOID PrintUsage(LPTSTR pProcess)
147+
     else
157-
         TEXT("\t-o <comma-separated mount options>\n")
148+
         dprintf(SRVLVL, "<-- nfs41_server_resolve(%s:%u) returning "
158-
         TEXT("Mount options:\n")
149+
-            "%s\n", hostname, port, addrs->arr[0].uaddr);
159-
         TEXT("\tro\tmount as read-only\n")
150+
+            "OK %s\n", hostname, port, addrs->arr[0].uaddr);
160-
+        TEXT("\tport=#\tTCP port to use (defaults to 2049)\n")
151+
     return status;
169152
 }
170-
153+
diff --git a/daemon/upcall.h b/daemon/upcall.h
171-
 DWORD __cdecl _tmain(DWORD argc, LPTSTR argv[])
154+
index fd26353..9cdc0a1 100644
172-
diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
155+
--- a/daemon/upcall.h
173-
index da9327f..242b020 100644
156+
+++ b/daemon/upcall.h
174-
--- a/sys/nfs41_driver.c
157+
@@ -30,6 +30,7 @@
175-
+++ b/sys/nfs41_driver.c
158+
 /* structures for upcall arguments */
176-
@@ -166,6 +166,7 @@ typedef struct _updowncall_entry {
159+
 typedef struct __mount_upcall_args {
177-
     union {
160+
     const char *hostname;
178-
         struct {
161+
+    DWORD       port;
179-
             PUNICODE_STRING srv_name;
162+
     const char *path;
180-
+	    DWORD port;
163+
     DWORD       sec_flavor;
181-
             PUNICODE_STRING root;
164+
     DWORD       rsize;
182-
             PFILE_FS_ATTRIBUTE_INFORMATION FsAttrs;
165+
diff --git a/libtirpc/src/pmap_getport.c b/libtirpc/src/pmap_getport.c
183-
             DWORD sec_flavor;
166+
index 45c8b1c..4d3a277 100644
184-
@@ -314,6 +315,7 @@ DECLARE_CONST_UNICODE_STRING(SLASH, L"\\");
167+
--- a/libtirpc/src/pmap_getport.c
185-
 DECLARE_CONST_UNICODE_STRING(EMPTY_STRING, L"");
168+
+++ b/libtirpc/src/pmap_getport.c
186-
169+
@@ -62,6 +62,7 @@ pmap_getport(address, program, version, protocol)
187-
 #define SERVER_NAME_BUFFER_SIZE         1024
170+
 	u_long version;
188-
+#define MOUNT_CONFIG_NFS_PORT_DEFAULT   2049
171+
 	u_int protocol;
189-
 #define MOUNT_CONFIG_RW_SIZE_MIN        1024
172+
 {
190-
 #define MOUNT_CONFIG_RW_SIZE_DEFAULT    1048576
173+
+	(void)fprintf(stderr, "pmap_getport: returning default NFS port 2049\n");
191-
 #define MOUNT_CONFIG_RW_SIZE_MAX        1048576
174+
 	return (u_short)2049;
192-
@@ -328,6 +330,7 @@ typedef struct _NFS41_MOUNT_CONFIG {
175+
 }
193-
     BOOLEAN nocache;
176+
 #else
194-
     WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE];
177+
@@ -106,4 +107,4 @@ pmap_getport(address, program, version, protocol)
195-
     UNICODE_STRING SrvName;
178+
 	address->sin_port = 0;
196-
+    DWORD Port;
179+
 	return (port);
202180
     }
203-
     header_len = *len + length_as_utf8(entry->u.Mount.srv_name) +
181+
-#endif /* ! _WIN32 */
204-
-        length_as_utf8(entry->u.Mount.root) + 3 * sizeof(DWORD);
182+
\ No newline at end of file
205-
+        length_as_utf8(entry->u.Mount.root) + 4 * sizeof(DWORD);
183+
+#endif /* ! _WIN32 */
206-
     if (header_len > buf_len) {
184+
diff --git a/mount/mount.c b/mount/mount.c
207-
         status = STATUS_INSUFFICIENT_RESOURCES;
185+
index 4615fc9..6d8c8ee 100644
208-
         goto out;
186+
--- a/mount/mount.c
209-
     }
187+
+++ b/mount/mount.c
210-
     status = marshall_unicode_as_utf8(&tmp, entry->u.Mount.srv_name);
188+
@@ -61,13 +61,14 @@ static VOID PrintUsage(LPTSTR pProcess)
211-
     if (status) goto out;
189+
         TEXT("\t-o <comma-separated mount options>\n")
212-
+    RtlCopyMemory(tmp, &entry->u.Mount.port, sizeof(DWORD));
190+
         TEXT("Mount options:\n")
213-
+    tmp += sizeof(DWORD);
191+
         TEXT("\tro\tmount as read-only\n")
214-
     status = marshall_unicode_as_utf8(&tmp, entry->u.Mount.root);
192+
+        TEXT("\tport=#\tTCP port to use (defaults to 2049)\n")
215-
     if (status) goto out;
193+
         TEXT("\trsize=#\tread buffer size in bytes\n")
216-
     RtlCopyMemory(tmp, &entry->u.Mount.sec_flavor, sizeof(DWORD));
194+
         TEXT("\twsize=#\twrite buffer size in bytes\n")
217-
@@ -633,8 +638,9 @@ NTSTATUS marshal_nfs41_mount(
195+
         TEXT("\tsec=krb5:krb5i:krb5p\tspecify gss security flavor\n")
218-
     *len = header_len;
196+
         TEXT("\twritethru\tturns off rdbss caching for writes\n")
197+
         TEXT("\tnocache\tturns off rdbss caching\n")
219202
220-
 #ifdef DEBUG_MARSHAL_DETAIL
203+
 DWORD __cdecl _tmain(DWORD argc, LPTSTR argv[])
221-
-    DbgP("marshal_nfs41_mount: server name=%wZ mount point=%wZ sec_flavor=%s "
204+
diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
222-
-         "rsize=%d wsize=%d\n", entry->u.Mount.srv_name, entry->u.Mount.root,
205+
index da9327f..080679e 100644
223-
+    DbgP("marshal_nfs41_mount: server name=%wZ port=%d mount point=%wZ "
206+
--- a/sys/nfs41_driver.c
224-
+         "sec_flavor=%s rsize=%d wsize=%d\n",
207+
+++ b/sys/nfs41_driver.c
225-
+	 entry->u.Mount.srv_name, entry->u.Mount.port, entry->u.Mount.root,
208+
@@ -166,6 +166,7 @@ typedef struct _updowncall_entry {
226-
          secflavorop2name(entry->u.Mount.sec_flavor), entry->u.Mount.rsize,
209+
     union {
227-
          entry->u.Mount.wsize);
210+
         struct {
228-
 #endif
211+
             PUNICODE_STRING srv_name;
229-
@@ -2574,6 +2580,7 @@ NTSTATUS nfs41_mount(
212+
+	    DWORD port;
230-
     if (status) goto out;
213+
             PUNICODE_STRING root;
214+
             PFILE_FS_ATTRIBUTE_INFORMATION FsAttrs;
231218
232-
     entry->u.Mount.srv_name = &config->SrvName;
219+
 #define SERVER_NAME_BUFFER_SIZE         1024
233-
+    entry->u.Mount.port = config->Port;
220+
+#define MOUNT_CONFIG_NFS_PORT_DEFAULT   2049
234-
     entry->u.Mount.root = &config->MntPt;
221+
 #define MOUNT_CONFIG_RW_SIZE_MIN        1024
235-
     entry->u.Mount.rsize = config->ReadSize;
222+
 #define MOUNT_CONFIG_RW_SIZE_DEFAULT    1048576
236-
     entry->u.Mount.wsize = config->WriteSize;
223+
 #define MOUNT_CONFIG_RW_SIZE_MAX        1048576
237-
@@ -2606,6 +2613,7 @@ void nfs41_MountConfig_InitDefaults(
224+
@@ -328,6 +330,7 @@ typedef struct _NFS41_MOUNT_CONFIG {
238-
 {
225+
     BOOLEAN nocache;
239-
     RtlZeroMemory(Config, sizeof(NFS41_MOUNT_CONFIG));
226+
     WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE];
240-
227+
     UNICODE_STRING SrvName;
241-
+    Config->Port = MOUNT_CONFIG_NFS_PORT_DEFAULT;
228+
+    DWORD Port;
242-
     Config->ReadSize = MOUNT_CONFIG_RW_SIZE_DEFAULT;
229+
     WCHAR mntpt_buffer[MAX_PATH];
243-
     Config->WriteSize = MOUNT_CONFIG_RW_SIZE_DEFAULT;
230+
     UNICODE_STRING MntPt;
244-
     Config->ReadOnly = FALSE;
231+
     WCHAR sec_flavor[MAX_SEC_FLAVOR_LEN];
245-
@@ -2724,6 +2732,11 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
232+
@@ -364,6 +367,15 @@ typedef struct _NFS41_V_NET_ROOT_EXTENSION {
246-
             else
233+
     FILE_FS_ATTRIBUTE_INFORMATION FsAttrs;
247-
                 RtlCopyUnicodeString(&Config->SrvName, &usValue);
234+
     DWORD                   sec_flavor;
248-
         }
235+
     DWORD                   timeout;
249-
+        else if (wcsncmp(L"port", Name, NameLen) == 0) {
236+
+    /*
250-
+            status = nfs41_MountConfig_ParseDword(Option, &usValue,
237+
+     * gisburn: FIXME: Putting |port| here is wrong:
251-
+                &Config->Port, 1,
238+
+     * TCP port information should be encoded in the server name
252-
+                65535);
239+
+     * (e.g. \\server@port\nfs4\path, to make sure we do not get
253-
+        }
240+
+     * conflicts in case of (ssh) port forwarding
254-
         else if (wcsncmp(L"mntpt", Name, NameLen) == 0) {
241+
+     * (see https://learn.microsoft.com/en-gb/windows/win32/api/davclnt/nf-davclnt-davgethttpfromuncpath
255-
             if (usValue.Length > Config->MntPt.MaximumLength)
242+
+     * how to specify ports in an UNC path)
256-
                 status = STATUS_NAME_TOO_LONG;
243+
+     */
257-
244+
+    DWORD                   port;
258-
245+
     USHORT                  MountPathLen;
259-
246+
     BOOLEAN                 read_only;
260-
247+
     BOOLEAN                 write_thru;
261-
248+
@@ -615,13 +627,15 @@ NTSTATUS marshal_nfs41_mount(
262-
249+
         goto out;
263-
250+
     }
264-
251+
     header_len = *len + length_as_utf8(entry->u.Mount.srv_name) +
265-
252+
-        length_as_utf8(entry->u.Mount.root) + 3 * sizeof(DWORD);
266-
253+
+        length_as_utf8(entry->u.Mount.root) + 4 * sizeof(DWORD);
267-
254+
     if (header_len > buf_len) {
268-
255+
         status = STATUS_INSUFFICIENT_RESOURCES;
269-
256+
         goto out;
270-
257+
     }
271-
258+
     status = marshall_unicode_as_utf8(&tmp, entry->u.Mount.srv_name);
272-
259+
     if (status) goto out;
273-
260+
+    RtlCopyMemory(tmp, &entry->u.Mount.port, sizeof(DWORD));
274-
261+
+    tmp += sizeof(DWORD);
275-
262+
     status = marshall_unicode_as_utf8(&tmp, entry->u.Mount.root);
276-
263+
     if (status) goto out;
277-
264+
     RtlCopyMemory(tmp, &entry->u.Mount.sec_flavor, sizeof(DWORD));
278-
265+
@@ -633,8 +647,9 @@ NTSTATUS marshal_nfs41_mount(
279-
266+
     *len = header_len;
280267
281-
268+
 #ifdef DEBUG_MARSHAL_DETAIL
282-
269+
-    DbgP("marshal_nfs41_mount: server name=%wZ mount point=%wZ sec_flavor=%s "
283-
270+
-         "rsize=%d wsize=%d\n", entry->u.Mount.srv_name, entry->u.Mount.root,
284-
271+
+    DbgP("marshal_nfs41_mount: server name=%wZ port=%d mount point=%wZ "
285-
272+
+         "sec_flavor=%s rsize=%d wsize=%d\n",
286-
273+
+	 entry->u.Mount.srv_name, entry->u.Mount.port, entry->u.Mount.root,
287-
274+
          secflavorop2name(entry->u.Mount.sec_flavor), entry->u.Mount.rsize,
288-
275+
          entry->u.Mount.wsize);
289-
276+
 #endif
290-
277+
@@ -2566,14 +2581,15 @@ NTSTATUS nfs41_mount(
291278
292-
279+
 #ifdef DEBUG_MOUNT
293-
280+
     DbgEn();
294-
281+
-    DbgP("Server Name %wZ Mount Point %wZ SecFlavor %d\n",
295-
282+
-        &config->SrvName, &config->MntPt, sec_flavor);
296-
283+
+    DbgP("Server Name %wZ Port %d Mount Point %wZ SecFlavor %d\n",
297-
284+
+        &config->SrvName, config->Port, &config->MntPt, sec_flavor);
298-
285+
 #endif
299-
286+
     status = nfs41_UpcallCreate(NFS41_MOUNT, NULL, *session,
300-
287+
         INVALID_HANDLE_VALUE, *version, &config->MntPt, &entry);
301-
288+
     if (status) goto out;
302289
303-
290+
     entry->u.Mount.srv_name = &config->SrvName;
304-
291+
+    entry->u.Mount.port = config->Port;
305-
292+
     entry->u.Mount.root = &config->MntPt;
306-
293+
     entry->u.Mount.rsize = config->ReadSize;
307-
294+
     entry->u.Mount.wsize = config->WriteSize;
308-
295+
@@ -2606,6 +2622,7 @@ void nfs41_MountConfig_InitDefaults(
309-
296+
 {
310-
297+
     RtlZeroMemory(Config, sizeof(NFS41_MOUNT_CONFIG));
311298
312-
299+
+    Config->Port = MOUNT_CONFIG_NFS_PORT_DEFAULT;
313-
300+
     Config->ReadSize = MOUNT_CONFIG_RW_SIZE_DEFAULT;
314-
301+
     Config->WriteSize = MOUNT_CONFIG_RW_SIZE_DEFAULT;
315-
302+
     Config->ReadOnly = FALSE;
316-
303+
@@ -2724,6 +2741,11 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
317-
304+
             else
318-
305+
                 RtlCopyUnicodeString(&Config->SrvName, &usValue);
319-
306+
         }
320-
307+
+        else if (wcsncmp(L"port", Name, NameLen) == 0) {
321-
308+
+            status = nfs41_MountConfig_ParseDword(Option, &usValue,
322-
309+
+                &Config->Port, 1,
323-
310+
+                65535);
324-
311+
+        }
325-
312+
         else if (wcsncmp(L"mntpt", Name, NameLen) == 0) {
326-
313+
             if (usValue.Length > Config->MntPt.MaximumLength)
327-
314+
                 status = STATUS_NAME_TOO_LONG;
328-
315+
@@ -2910,6 +2932,8 @@ NTSTATUS nfs41_CreateVNetRoot(
329-
316+
     nfs41_MountConfig_InitDefaults(Config);
330317
331-
318+
     if (pCreateNetRootContext->RxContext->Create.EaLength) {
332-
319+
+        /* Codepath for nfs_mount.exe */
333-
320+
+
334-
321+
         /* parse the extended attributes for mount options */
335-
322+
         status = nfs41_MountConfig_ParseOptions(
336-
323+
             pCreateNetRootContext->RxContext->Create.EaBuffer,
337-
324+
@@ -2920,13 +2944,25 @@ NTSTATUS nfs41_CreateVNetRoot(
338-
325+
         pVNetRootContext->read_only = Config->ReadOnly;
339-
326+
         pVNetRootContext->write_thru = Config->write_thru;
340-
327+
         pVNetRootContext->nocache = Config->nocache;
341-
328+
+	pVNetRootContext->port = Config->Port;
342-
329+
     } else {
343-
330+
+        /* Codepath for \\server:port\nfs4\path */
344-
331+
+
345-
332+
         /* use the SRV_CALL name (without leading \) as the hostname */
346-
333+
         Config->SrvName.Buffer = pSrvCall->pSrvCallName->Buffer + 1;
347-
334+
         Config->SrvName.Length =
348-
335+
             pSrvCall->pSrvCallName->Length - sizeof(WCHAR);
349-
336+
         Config->SrvName.MaximumLength =
350-
337+
             pSrvCall->pSrvCallName->MaximumLength - sizeof(WCHAR);
351-
338+
+        /*
352-
339+
+         * gisburn: FIXME: Using |port| here is wrong:
353-
340+
+         * TCP port information should be encoded in the server name
354-
341+
+         * (e.g. \\server@port\nfs4\path, to make sure we do not get
355-
342+
+         * conflicts in case of (ssh) port forwarding
356-
343+
+	 * (see https://learn.microsoft.com/en-gb/windows/win32/api/davclnt/nf-davclnt-davgethttpfromuncpath
357-
344+
+	 * how to specify ports in an UNC path)
358-
345+
+         */
359-
346+
+	Config->Port = pVNetRootContext->port;
360-
347+
     }
361-
348+
     pVNetRootContext->MountPathLen = Config->MntPt.Length;
362-
349+
     pVNetRootContext->timeout = Config->timeout;
363350

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at