- From d628bf9478c24de7560f317abe8a32cb2ca9b590 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 25 Jan 2024 12:09:49 +0100
- Subject: [PATCH 1/4] mount: Fix absolute nfs://-URLs
- Fix absolute nfs://-URLs - the '/' after hostport is the separator,
- and NOT part of the path, so an absolute path needs another '/'.
- Example:
- "nfs://hostbar:93/relativepath/a"
- "nfs://hostbar:93//absolutepath/a"
- nfs://-URLs do support relative paths, usually relative to the
- public file handle, but we do not support that yet.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 28 ++++++++++++++++++++--------
- mount/urlparser1.c | 2 +-
- 2 files changed, 21 insertions(+), 9 deletions(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index 7edc05f..91d5292 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -103,11 +103,11 @@ static VOID PrintUsage(LPTSTR pProcess)
- TEXT("\tnfs_mount.exe -p -o rw 'H' derfwpc5131_ipv4:/export/home2/rmainz\n")
- TEXT("\tnfs_mount.exe -o rw '*' bigramhost:/tmp\n")
- TEXT("\tnfs_mount.exe -o rw,sec=sys,port=30000 T grendel:/net_tmpfs2\n")
- - TEXT("\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1/net_tmpfs2/test2\n")
- - TEXT("\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1:1234/net_tmpfs2/test2\n")
- - TEXT("\tnfs_mount.exe -o sec=sys,rw,port=1234 S nfs://myhost1/net_tmpfs2/test2\n")
- - TEXT("\tnfs_mount.exe -o sec=sys,rw '*' [fe80::21b:1bff:fec3:7713]:/net_tmpfs2/test2\n")
- - 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//net_tmpfs2/test2\n")
- + TEXT("\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1:1234//net_tmpfs2/test2\n")
- + TEXT("\tnfs_mount.exe -o sec=sys,rw,port=1234 S nfs://myhost1//net_tmpfs2/test2\n")
- + TEXT("\tnfs_mount.exe -o sec=sys,rw '*' [fe80::21b:1bff:fec3:7713]://net_tmpfs2/test2\n")
- + TEXT("\tnfs_mount.exe -o sec=sys,rw '*' nfs://[fe80::21b:1bff:fec3:7713]//net_tmpfs2/test2\n"),
- pProcess);
- }
- @@ -331,15 +331,27 @@ static DWORD ParseRemoteName(
- goto out;
- }
- - (void)_sntprintf(premotename, NFS41_SYS_MAX_PATH_LEN, TEXT("%s"),
- - uctx->hostport.hostname);
- -
- if (uctx->hostport.port != -1)
- port = uctx->hostport.port;
- else
- port = MOUNT_CONFIG_NFS_PORT_DEFAULT;
- + (void)_sntprintf(premotename, NFS41_SYS_MAX_PATH_LEN, TEXT("%s"),
- + uctx->hostport.hostname);
- ConvertUnixSlashes(premotename);
- +
- + if (!uctx->path) {
- + result = ERROR_BAD_ARGUMENTS;
- + (void)_ftprintf(stderr, TEXT("Path missing in nfs://-URL\n"));
- + goto out;
- + }
- +
- + if (uctx->path[0] != TEXT('/')) {
- + result = ERROR_BAD_ARGUMENTS;
- + (void)_ftprintf(stderr, TEXT("Relative nfs://-URLs are not supported\n"));
- + goto out;
- + }
- +
- pEnd = uctx->path;
- ConvertUnixSlashes(pEnd);
- }
- diff --git a/mount/urlparser1.c b/mount/urlparser1.c
- index 66b8b56..6a4f3f9 100644
- --- a/mount/urlparser1.c
- +++ b/mount/urlparser1.c
- @@ -156,7 +156,7 @@ int url_parser_parse(url_parser_context *uctx)
- slen = s-urlstr;
- (void)memcpy(uctx->hostport.hostname, urlstr, slen*sizeof(TCHAR));
- uctx->hostport.hostname[slen] = TEXT('\0');
- - urlstr += slen;
- + urlstr += slen + 1;
- /*
- * check for addresses within '[' and ']', like
- --
- 2.43.0
- From 9be7da9cea3a69dee00545e276e03ba95e52550f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 25 Jan 2024 13:21:08 +0100
- Subject: [PATCH 2/4] mount: urldecoding support in nfs://-URLs for <space> and
- Unicode support
- Add support for urldecoding (e.g. <space>=="%20" or "+") in nfs://-URLs
- for space and Unicode support, so nfs_mount.exe can mount paths with
- spaces or Unicode symbols (e.g. German umlauts etc.)
- Note that URLs do urlencoding and urldecoding in bytes
- (see RFC3986 ("Uniform Resource Identifier (URI): Generic Syntax"),
- e.g. Unicode Euro symbol U+20AC is encoded as "%E2%82%AC", but our code
- works with Windows |TCHAR|/|wchart_t|, so convertion from |wchar_t| to
- UTF-8 and back is required.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 89 ++++++++++++++++++++--
- mount/urlparser1.c | 180 +++++++++++++++++++++++++++++++++++----------
- mount/urlparser1.h | 24 +++---
- 3 files changed, 235 insertions(+), 58 deletions(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index 91d5292..94d1a66 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -107,7 +107,9 @@ static VOID PrintUsage(LPTSTR pProcess)
- TEXT("\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1:1234//net_tmpfs2/test2\n")
- TEXT("\tnfs_mount.exe -o sec=sys,rw,port=1234 S nfs://myhost1//net_tmpfs2/test2\n")
- TEXT("\tnfs_mount.exe -o sec=sys,rw '*' [fe80::21b:1bff:fec3:7713]://net_tmpfs2/test2\n")
- - 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 '*' 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);
- }
- @@ -289,6 +291,50 @@ static void ConvertUnixSlashes(
- *pos = TEXT('\\');
- }
- +
- +#define DEBUG_MOUNT 1
- +
- +static
- +char *wcs2utf8str(const wchar_t *wstr)
- +{
- + char *utf8str;
- + size_t wstr_len;
- + size_t utf8_len;
- +
- + wstr_len = wcslen(wstr);
- + utf8_len = WideCharToMultiByte(CP_UTF8, 0,
- + wstr, (int)wstr_len, NULL, 0, NULL, NULL);
- +
- + utf8str = malloc(utf8_len+1);
- + if (!utf8str)
- + return NULL;
- + (void)WideCharToMultiByte(CP_UTF8, 0,
- + wstr, (int)wstr_len, utf8str, (int)utf8_len, NULL, NULL);
- + utf8str[utf8_len] = '\0';
- + return utf8str;
- +}
- +
- +static
- +wchar_t *utf8str2wcs(const char *utf8str)
- +{
- + wchar_t *wstr;
- + size_t utf8len;
- + size_t wstr_len;
- +
- + utf8len = strlen(utf8str);
- + wstr_len = MultiByteToWideChar(CP_UTF8, 0,
- + utf8str, (int)utf8len, NULL, 0);
- +
- + wstr = malloc((wstr_len+1)*sizeof(wchar_t));
- + if (!wstr)
- + return NULL;
- +
- + (void)MultiByteToWideChar(CP_UTF8, 0,
- + utf8str, (int)utf8len, wstr, (int)wstr_len);
- + wstr[wstr_len] = L'\0';
- + return wstr;
- +}
- +
- static DWORD ParseRemoteName(
- IN LPTSTR pRemoteName,
- IN OUT PMOUNT_OPTION_LIST pOptions,
- @@ -298,6 +344,7 @@ static DWORD ParseRemoteName(
- {
- DWORD result = NO_ERROR;
- LPTSTR pEnd;
- + wchar_t *mountstrmem = NULL;
- int port = MOUNT_CONFIG_NFS_PORT_DEFAULT;
- PFILE_FULL_EA_INFORMATION port_option_val;
- wchar_t remotename[NFS41_SYS_MAX_PATH_LEN];
- @@ -313,7 +360,27 @@ static DWORD ParseRemoteName(
- * including port support (nfs://hostname@port/path/...)
- */
- if (!wcsncmp(premotename, TEXT("nfs://"), 6)) {
- - uctx = url_parser_create_context(premotename, 0);
- + char *premotename_utf8;
- + wchar_t *hostname_wstr;
- +
- + /*
- + * URLs do urlencoding and urldecoding in bytes (see
- + * RFC3986 ("Uniform Resource Identifier (URI): Generic
- + * Syntax"), e.g. Unicode Euro symbol U+20AC is encoded
- + * as "%E2%82%AC".
- + * So we have to convert from our |wchar_t| string to
- + * a UTF-8 byte string, do the URL processing on byte
- + * level, and convert that UTF-8 byte string back to a
- + * |wchar_t| string.
- + */
- + premotename_utf8 = wcs2utf8str(premotename);
- + if (!premotename_utf8) {
- + result = ERROR_NOT_ENOUGH_MEMORY;
- + goto out;
- + }
- +
- + uctx = url_parser_create_context(premotename_utf8, 0);
- + free(premotename_utf8);
- if (!uctx) {
- result = ERROR_NOT_ENOUGH_MEMORY;
- goto out;
- @@ -333,11 +400,14 @@ static DWORD ParseRemoteName(
- if (uctx->hostport.port != -1)
- port = uctx->hostport.port;
- - else
- - port = MOUNT_CONFIG_NFS_PORT_DEFAULT;
- - (void)_sntprintf(premotename, NFS41_SYS_MAX_PATH_LEN, TEXT("%s"),
- - uctx->hostport.hostname);
- + hostname_wstr = utf8str2wcs(uctx->hostport.hostname);
- + if (!hostname_wstr) {
- + result = ERROR_NOT_ENOUGH_MEMORY;
- + goto out;
- + }
- + (void)wcscpy_s(premotename, NFS41_SYS_MAX_PATH_LEN, hostname_wstr);
- + free(hostname_wstr);
- ConvertUnixSlashes(premotename);
- if (!uctx->path) {
- @@ -346,13 +416,13 @@ static DWORD ParseRemoteName(
- goto out;
- }
- - if (uctx->path[0] != TEXT('/')) {
- + if (uctx->path[0] != '/') {
- result = ERROR_BAD_ARGUMENTS;
- (void)_ftprintf(stderr, TEXT("Relative nfs://-URLs are not supported\n"));
- goto out;
- }
- - pEnd = uctx->path;
- + pEnd = mountstrmem = utf8str2wcs(uctx->path);
- ConvertUnixSlashes(pEnd);
- }
- else
- @@ -535,6 +605,9 @@ out:
- if (uctx) {
- url_parser_free_context(uctx);
- }
- + if (mountstrmem) {
- + free(mountstrmem);
- + }
- return result;
- }
- diff --git a/mount/urlparser1.c b/mount/urlparser1.c
- index 6a4f3f9..bdba1b5 100644
- --- a/mount/urlparser1.c
- +++ b/mount/urlparser1.c
- @@ -1,6 +1,9 @@
- -/* NFSv4.1 client for Windows
- +/*
- + * NFSv4.1 client for Windows
- * Copyright (c) 2024 Roland Mainz <roland.mainz@nrubsig.org>
- *
- + * Roland Mainz <roland.mainz@nrubsig.org>
- + *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- @@ -16,17 +19,16 @@
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- */
- -
- /* urlparser1.c - simple URL parser */
- #if ((__STDC_VERSION__-0) < 201710L)
- #error Code requires ISO C17
- #endif
- -
- -#include <crtdbg.h>
- -#include <Windows.h>
- #include <stdlib.h>
- +#include <stdbool.h>
- +#include <string.h>
- +#include <stdio.h>
- #include "urlparser1.h"
- @@ -58,34 +60,84 @@
- * "$"
- */
- -#define DBGNULLSTR(s) (((s)!=NULL)?(s):TEXT("<NULL>"))
- -#if 0
- +#define DBGNULLSTR(s) (((s)!=NULL)?(s):"<NULL>")
- +#if 1
- #define D(x) x
- #else
- #define D(x)
- #endif
- -url_parser_context *url_parser_create_context(const TCHAR *in_url, unsigned int flags)
- +static
- +void urldecodestr(char *dst, const char *src, size_t len)
- +{
- + /*
- + * Unicode characters with a code point > 255 are encoded
- + * as UTF-8 bytes
- + */
- +#define isurlxdigit(c) \
- + (((c) >= '0' && (c) <= '9') || \
- + ((c) >= 'a' && (c) <= 'f') || \
- + ((c) >= 'A' && (c) <= 'F'))
- + char a, b;
- + while (*src && len--) {
- + if (len > 2) {
- + if ((*src == '%') &&
- + (a = src[1]) && (b = src[2])) {
- + if ((isurlxdigit(a) &&
- + isurlxdigit(b))) {
- + if (a >= 'a')
- + a -= 'a'-'A';
- + if (a >= 'A')
- + a -= ('A' - 10);
- + else
- + a -= '0';
- +
- + if (b >= 'a')
- + b -= 'a'-'A';
- + if (b >= 'A')
- + b -= ('A' - 10);
- + else
- + b -= '0';
- +
- + *dst++ = 16*a+b;
- +
- + src+=3;
- + len-=2;
- + continue;
- + }
- + }
- + }
- + if (*src == '+') {
- + *dst++ = ' ';
- + src++;
- + continue;
- + }
- + *dst++ = *src++;
- + }
- + *dst++ = '\0';
- +}
- +
- +url_parser_context *url_parser_create_context(const char *in_url, unsigned int flags)
- {
- url_parser_context *uctx;
- - TCHAR *s;
- + char *s;
- size_t in_url_len;
- size_t context_len;
- if (!in_url)
- return NULL;
- - in_url_len = _tcsclen(in_url);
- + in_url_len = strlen(in_url);
- context_len = sizeof(url_parser_context) +
- - (((in_url_len+1)*5L*sizeof(TCHAR)));
- + ((in_url_len+1)*5);
- uctx = malloc(context_len);
- if (!uctx)
- return NULL;
- s = (void *)(uctx+1);
- uctx->in_url = s; s+= in_url_len+1;
- - (void)_tcscpy(uctx->in_url, in_url);
- + (void)strcpy(uctx->in_url, in_url);
- uctx->scheme = s; s+= in_url_len+1;
- uctx->login.username = s; s+= in_url_len+1;
- uctx->hostport.hostname = s; s+= in_url_len+1;
- @@ -97,38 +149,37 @@ url_parser_context *url_parser_create_context(const TCHAR *in_url, unsigned int
- int url_parser_parse(url_parser_context *uctx)
- {
- - D((void)_tprintf(TEXT("## parser in_url='%s'\n"), uctx->in_url));
- + D((void)fprintf(stderr, "## parser in_url='%s'\n", uctx->in_url));
- - TCHAR *s;
- - const TCHAR *urlstr = uctx->in_url;
- + char *s;
- + const char *urlstr = uctx->in_url;
- size_t slen;
- - s = _tcsstr(urlstr, TEXT("://"));
- + s = strstr(urlstr, "://");
- if (!s) {
- - D((void)_tprintf(TEXT("url_parser: Not an URL\n")));
- + D((void)fprintf(stderr, "url_parser: Not an URL\n"));
- return -1;
- }
- slen = s-urlstr;
- - (void)memcpy(uctx->scheme, urlstr, slen*sizeof(TCHAR));
- - uctx->scheme[slen] = TEXT('\0');
- + (void)memcpy(uctx->scheme, urlstr, slen);
- + uctx->scheme[slen] = '\0';
- urlstr += slen + 3;
- - D((void)_tprintf(TEXT("scheme='%s', rest='%s'\n"), uctx->scheme, urlstr));
- + D((void)fprintf(stdout, "scheme='%s', rest='%s'\n", uctx->scheme, urlstr));
- - s = _tcsstr(urlstr, TEXT("@"));
- + s = strstr(urlstr, "@");
- if (s) {
- /* URL has user/password */
- slen = s-urlstr;
- - (void)memcpy(uctx->login.username, urlstr, slen*sizeof(TCHAR));
- - uctx->login.username[slen] = TEXT('\0');
- + urldecodestr(uctx->login.username, urlstr, slen);
- urlstr += slen + 1;
- - s = _tcsstr(uctx->login.username, TEXT(":"));
- + s = strstr(uctx->login.username, ":");
- if (s) {
- /* found passwd */
- uctx->login.passwd = s+1;
- - *s = TEXT('\0');
- + *s = '\0';
- }
- else
- {
- @@ -136,7 +187,7 @@ int url_parser_parse(url_parser_context *uctx)
- }
- /* catch password-only URLs */
- - if (uctx->login.username[0] == TEXT('\0'))
- + if (uctx->login.username[0] == '\0')
- uctx->login.username = NULL;
- }
- else
- @@ -145,17 +196,16 @@ int url_parser_parse(url_parser_context *uctx)
- uctx->login.passwd = NULL;
- }
- - D((void)_tprintf(TEXT("login='%s', passwd='%s', rest='%s'\n"),
- + D((void)fprintf(stdout, "login='%s', passwd='%s', rest='%s'\n",
- DBGNULLSTR(uctx->login.username),
- DBGNULLSTR(uctx->login.passwd),
- DBGNULLSTR(urlstr)));
- - s = _tcsstr(urlstr, TEXT("/"));
- + s = strstr(urlstr, "/");
- if (s) {
- /* URL has hostport */
- slen = s-urlstr;
- - (void)memcpy(uctx->hostport.hostname, urlstr, slen*sizeof(TCHAR));
- - uctx->hostport.hostname[slen] = TEXT('\0');
- + urldecodestr(uctx->hostport.hostname, urlstr, slen);
- urlstr += slen + 1;
- /*
- @@ -163,29 +213,29 @@ int url_parser_parse(url_parser_context *uctx)
- * IPv6 addresses
- */
- s = uctx->hostport.hostname;
- - if (s[0] == TEXT('['))
- - s = _tcsstr(s, TEXT("]"));
- + if (s[0] == '[')
- + s = strstr(s, "]");
- if (s == NULL) {
- - D((void)_tprintf(TEXT("url_parser: Unmatched '[' in hostname\n")));
- + D((void)fprintf(stderr, "url_parser: Unmatched '[' in hostname\n"));
- return -1;
- }
- - s = _tcsstr(s, TEXT(":"));
- + s = strstr(s, ":");
- if (s) {
- /* found port number */
- - uctx->hostport.port = _tstoi(s+1);
- - *s = TEXT('\0');
- + uctx->hostport.port = atoi(s+1);
- + *s = '\0';
- }
- }
- else
- {
- - (void)_tcscpy(uctx->hostport.hostname, urlstr);
- + (void)strcpy(uctx->hostport.hostname, urlstr);
- uctx->path = NULL;
- urlstr = NULL;
- }
- - D((void)_tprintf(TEXT("hostport='%s', port=%d, rest='%s'\n"),
- + D((void)fprintf(stdout, "hostport='%s', port=%d, rest='%s'\n",
- DBGNULLSTR(uctx->hostport.hostname),
- uctx->hostport.port,
- DBGNULLSTR(urlstr)));
- @@ -194,8 +244,8 @@ int url_parser_parse(url_parser_context *uctx)
- return 0;
- }
- - (void)_tcscpy(uctx->path, urlstr);
- - D((void)_tprintf(TEXT("path='%s'\n"), uctx->path));
- + urldecodestr(uctx->path, urlstr, strlen(urlstr));
- + D((void)fprintf(stdout, "path='%s'\n", uctx->path));
- return 0;
- }
- @@ -204,3 +254,53 @@ void url_parser_free_context(url_parser_context *c)
- {
- free(c);
- }
- +
- +#ifdef TEST_URLPARSER
- +static
- +void test_url_parser(const char *instr)
- +{
- + url_parser_context *c;
- +
- + c = url_parser_create_context(instr, 0);
- +
- + (void)url_parser_parse(c);
- +
- + (void)fputc('\n', stdout);
- +
- + url_parser_free_context(c);
- +}
- +
- +int main(int ac, char *av[])
- +{
- + (void)puts("#start");
- +
- + (void)setvbuf(stdout, NULL, _IONBF, 0);
- + (void)setvbuf(stderr, NULL, _IONBF, 0);
- +
- + (void)test_url_parser("foo://hostbar/baz");
- + (void)test_url_parser("foo://myuser@hostbar/baz");
- + (void)test_url_parser("foo://myuser:mypasswd@hostbar/baz");
- + (void)test_url_parser("foo://Vorname+Nachname:mypasswd@hostbar/baz");
- + (void)test_url_parser("foo://Vorname%20Nachname:mypasswd@hostbar/baz%");
- + (void)test_url_parser("foo://myuser:mypasswd@hostbar:666/baz");
- + (void)test_url_parser("foo://myuser:mypasswd@hostbar:666//baz");
- + (void)test_url_parser("foo://myuser:mypasswd@[fe80::21b:1bff:fec3:7713]:666/baz");
- + (void)test_url_parser("foo://:mypasswd2@hostbar2:667/baf");
- + (void)test_url_parser("foo://hostbar/euro/symbol/%E2%82%AC/here");
- + (void)test_url_parser("foo://hostbar");
- + (void)test_url_parser("foo://hostbar:93");
- + (void)test_url_parser("nfs://hostbar:93/relativepath/a");
- + (void)test_url_parser("nfs://hostbar:93//absolutepath/a");
- + (void)test_url_parser("nfs://hostbar:93//absolutepath/blank%20path/a");
- + (void)test_url_parser("nfs://hostbar:93//absolutepath/blank+path/a");
- +
- +
- + (void)test_url_parser("foo://");
- + (void)test_url_parser("typo:/hostbar");
- + (void)test_url_parser("wrong");
- +
- + (void)puts("#done");
- +
- + return EXIT_SUCCESS;
- +}
- +#endif /* !TEST_URLPARSER */
- diff --git a/mount/urlparser1.h b/mount/urlparser1.h
- index ea715d2..8ed0f91 100644
- --- a/mount/urlparser1.h
- +++ b/mount/urlparser1.h
- @@ -1,6 +1,9 @@
- -/* NFSv4.1 client for Windows
- +/*
- + * NFSv4.1 client for Windows
- * Copyright (c) 2024 Roland Mainz <roland.mainz@nrubsig.org>
- *
- + * Roland Mainz <roland.mainz@nrubsig.org>
- + *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- @@ -16,30 +19,31 @@
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- */
- +/* urlparser1.h - header for simple URL parser */
- +
- #ifndef __URLPARSER1_H__
- #define __URLPARSER1_H__
- -#include <tchar.h>
- +#include <stdlib.h>
- typedef
- struct _url_parser_context {
- - TCHAR *in_url;
- + char *in_url;
- - TCHAR *scheme;
- + char *scheme;
- struct {
- - TCHAR *username;
- - TCHAR *passwd;
- + char *username;
- + char *passwd;
- } login;
- struct {
- - TCHAR *hostname;
- + char *hostname;
- signed int port;
- } hostport;
- - TCHAR *path;
- + char *path;
- } url_parser_context;
- -
- /* Prototypes */
- -url_parser_context *url_parser_create_context(const TCHAR *in_url, unsigned int flags);
- +url_parser_context *url_parser_create_context(const char *in_url, unsigned int flags);
- int url_parser_parse(url_parser_context *uctx);
- void url_parser_free_context(url_parser_context *c);
- --
- 2.43.0
- From bf076ef13ad325d961776e499aa4b87e0b988f34 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 25 Jan 2024 13:28:52 +0100
- Subject: [PATCH 3/4] mount: Disable debug output
- Disable debug output in nfs_mount.exe
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 2 --
- 1 file changed, 2 deletions(-)
- diff --git a/mount/mount.c b/mount/mount.c
- index 94d1a66..1656508 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -292,8 +292,6 @@ static void ConvertUnixSlashes(
- }
- -#define DEBUG_MOUNT 1
- -
- static
- char *wcs2utf8str(const wchar_t *wstr)
- {
- --
- 2.43.0
- From 2a9d9c7719edd1213c70d1fb7a18a10f3831bc55 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 25 Jan 2024 13:36:46 +0100
- Subject: [PATCH 4/4] mount: Disable DEBUG mode in URL parser
- Disable DEBUG mode in URL parser
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/urlparser1.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/mount/urlparser1.c b/mount/urlparser1.c
- index bdba1b5..3de1047 100644
- --- a/mount/urlparser1.c
- +++ b/mount/urlparser1.c
- @@ -61,7 +61,7 @@
- */
- #define DBGNULLSTR(s) (((s)!=NULL)?(s):"<NULL>")
- -#if 1
- +#if 0
- #define D(x) x
- #else
- #define D(x)
- --
- 2.43.0
msnfs41client: Patches for nfs://-URLs, 2024-01-25
Posted by Anonymous on Thu 25th Jan 2024 12:49
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.