pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for strict nfs://-URL+paths from/to nfsd UTF-8 character sequence validation+misc, 2024-11-22
Posted by Anonymous on Fri 22nd Nov 2024 16:32
raw | new post

  1. From 003aa383d60530edce9b42ac77faa8b08ccf5abe Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Fri, 22 Nov 2024 12:35:56 +0100
  4. Subject: [PATCH 1/4] tests: Add |FileNameInfo| support to winfsinfo1
  5.  
  6. Add |FileNameInfo| support to winfsinfo1
  7.  
  8. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  9. ---
  10. tests/winfsinfo1/winfsinfo.c | 56 ++++++++++++++++++++++++++++++++++++
  11.  1 file changed, 56 insertions(+)
  12.  
  13. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  14. index 4832ea9..682d089 100644
  15. --- a/tests/winfsinfo1/winfsinfo.c
  16. +++ b/tests/winfsinfo1/winfsinfo.c
  17. @@ -388,6 +388,58 @@ typedef struct _FILE_NAME_INFORMATION4096 {
  18.  } FILE_NAME_INFORMATION4096, *PFILE_NAME_INFORMATION4096;
  19.  
  20.  
  21. +/*
  22. + * |FileNameInfo| will get the absolute path of a file with symbolic
  23. + * links resolved
  24. + */
  25. +static
  26. +bool get_filenameinfo(const char *progname, const char *filename)
  27. +{
  28. +    int res = EXIT_FAILURE;
  29. +    bool ok;
  30. +    FILE_NAME_INFORMATION4096 finfo;
  31. +    (void)memset(&finfo, 0, sizeof(finfo));
  32. +
  33. +    HANDLE fileHandle = CreateFileA(filename,
  34. +        GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
  35. +        FILE_FLAG_BACKUP_SEMANTICS, NULL);
  36. +    if (fileHandle == INVALID_HANDLE_VALUE) {
  37. +        (void)fprintf(stderr,
  38. +            "%s: Error opening file '%s'. Last error was %d.\n",
  39. +            progname,
  40. +            filename,
  41. +            (int)GetLastError());
  42. +        return EXIT_FAILURE;
  43. +    }
  44. +
  45. +    ok = GetFileInformationByHandleEx(fileHandle,
  46. +        FileNameInfo,
  47. +        &finfo, sizeof(finfo));
  48. +
  49. +    if (!ok) {
  50. +        (void)fprintf(stderr, "%s: GetFileInformationByHandleEx() "
  51. +            "error. GetLastError()==%d.\n",
  52. +            progname,
  53. +            (int)GetLastError());
  54. +        res = EXIT_FAILURE;
  55. +        goto done;
  56. +    }
  57. +
  58. +    (void)printf("(\n");
  59. +    (void)printf("\tfilename='%s'\n", filename);
  60. +
  61. +    (void)printf("\tFileNameLength=%ld\n",
  62. +        (long)finfo.FileNameLength);
  63. +    (void)printf("\tFileName='%S'\n",   finfo.FileName);
  64. +    (void)printf(")\n");
  65. +    res = EXIT_SUCCESS;
  66. +
  67. +done:
  68. +    (void)CloseHandle(fileHandle);
  69. +    return res;
  70. +}
  71. +
  72. +
  73.  static
  74.  bool get_filenormalizednameinfo(const char *progname, const char *filename)
  75.  {
  76. @@ -578,6 +630,7 @@ void usage(void)
  77.          "filebasicinfo|"
  78.          "fileexinfostandard|"
  79.          "filestandardinfo|"
  80. +        "filenameinfo|"
  81.          "filenormalizednameinfo|"
  82.          "filecasesensitiveinfo|"
  83.          "getfiletime"
  84. @@ -607,6 +660,9 @@ int main(int ac, char *av[])
  85.      else if (!strcmp(subcmd, "filestandardinfo")) {
  86.          return get_file_standard_info(av[0], av[2]);
  87.      }
  88. +    else if (!strcmp(subcmd, "filenameinfo")) {
  89. +        return get_filenameinfo(av[0], av[2]);
  90. +    }
  91.      else if (!strcmp(subcmd, "filenormalizednameinfo")) {
  92.          return get_filenormalizednameinfo(av[0], av[2]);
  93.      }
  94. --
  95. 2.45.1
  96.  
  97. From 067befbef48ee2162b3f9fef1df76af81b3bcc6b Mon Sep 17 00:00:00 2001
  98. From: Roland Mainz <roland.mainz@nrubsig.org>
  99. Date: Fri, 22 Nov 2024 16:04:27 +0100
  100. Subject: [PATCH 2/4] mount: Reject invalid UTF-8 sequences in nfs://-URLs
  101.  
  102. Reject invalid UTF-8 sequences in nfs://-URLs
  103.  
  104. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  105. ---
  106. mount/mount.c | 41 ++++++++++++++++++++++++++++++++---------
  107.  1 file changed, 32 insertions(+), 9 deletions(-)
  108.  
  109. diff --git a/mount/mount.c b/mount/mount.c
  110. index db6f94c..8c6b008 100644
  111. --- a/mount/mount.c
  112. +++ b/mount/mount.c
  113. @@ -616,13 +616,20 @@ char *wcs2utf8str(const wchar_t *wstr)
  114.      size_t utf8_len;
  115.  
  116.      wstr_len = wcslen(wstr);
  117. -    utf8_len = WideCharToMultiByte(CP_UTF8, 0,
  118. +    utf8_len = WideCharToMultiByte(CP_UTF8,
  119. +        WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  120.          wstr, (int)wstr_len, NULL, 0, NULL, NULL);
  121. +    if (utf8_len == 0)
  122. +        return NULL;
  123.  
  124.      utf8str = malloc(utf8_len+1);
  125. -    if (!utf8str)
  126. +    if (!utf8str) {
  127. +        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
  128.          return NULL;
  129. -    (void)WideCharToMultiByte(CP_UTF8, 0,
  130. +    }
  131. +
  132. +    (void)WideCharToMultiByte(CP_UTF8,
  133. +        WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  134.          wstr, (int)wstr_len, utf8str, (int)utf8_len, NULL, NULL);
  135.      utf8str[utf8_len] = '\0';
  136.      return utf8str;
  137. @@ -636,14 +643,18 @@ wchar_t *utf8str2wcs(const char *utf8str)
  138.      size_t wstr_len;
  139.  
  140.      utf8len = strlen(utf8str);
  141. -    wstr_len = MultiByteToWideChar(CP_UTF8, 0,
  142. +    wstr_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
  143.          utf8str, (int)utf8len, NULL, 0);
  144. +    if (wstr_len == 0)
  145. +        return NULL;
  146.  
  147.      wstr = malloc((wstr_len+1)*sizeof(wchar_t));
  148. -    if (!wstr)
  149. +    if (!wstr) {
  150. +        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
  151.          return NULL;
  152. +    }
  153.  
  154. -    (void)MultiByteToWideChar(CP_UTF8, 0,
  155. +    (void)MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
  156.          utf8str, (int)utf8len, wstr, (int)wstr_len);
  157.      wstr[wstr_len] = L'\0';
  158.      return wstr;
  159. @@ -692,7 +703,10 @@ static DWORD ParseRemoteName(
  160.           */
  161.          premotename_utf8 = wcs2utf8str(premotename);
  162.          if (!premotename_utf8) {
  163. -            result = ERROR_NOT_ENOUGH_MEMORY;
  164. +            (void)fwprintf(stderr,
  165. +                L"wcs2utf8str() failed, lasterr=%d\n.",
  166. +                (int)GetLastError());
  167. +            result = GetLastError();
  168.              goto out;
  169.          }
  170.  
  171. @@ -705,7 +719,7 @@ static DWORD ParseRemoteName(
  172.  
  173.          if (url_parser_parse(uctx) < 0) {
  174.              result = ERROR_BAD_ARGUMENTS;
  175. -            (void)fwprintf(stderr, L"Error parsing nfs://-URL.\n");
  176. +            (void)fwprintf(stderr, L"Error parsing nfs://-URL '%S'.\n", premotename_utf8);
  177.              goto out;
  178.          }
  179.  
  180. @@ -777,9 +791,12 @@ static DWORD ParseRemoteName(
  181.  
  182.          hostname_wstr = utf8str2wcs(uctx->hostport.hostname);
  183.          if (!hostname_wstr) {
  184. -            result = ERROR_NOT_ENOUGH_MEMORY;
  185. +            result = GetLastError();
  186. +            (void)fwprintf(stderr, L"Cannot convert URL host '%S', lasterr=%d\n",
  187. +                uctx->hostport.hostname, result);
  188.              goto out;
  189.          }
  190. +
  191.          (void)wcscpy_s(premotename, NFS41_SYS_MAX_PATH_LEN, hostname_wstr);
  192.          free(hostname_wstr);
  193.          ConvertUnixSlashes(premotename);
  194. @@ -797,6 +814,12 @@ static DWORD ParseRemoteName(
  195.          }
  196.  
  197.          pEnd = mountstrmem = utf8str2wcs(uctx->path);
  198. +        if (!mountstrmem) {
  199. +            result = GetLastError();
  200. +            (void)fwprintf(stderr, L"Cannot convert URL path '%S', lasterr=%d\n",
  201. +                uctx->path, result);
  202. +            goto out;
  203. +        }
  204.          ConvertUnixSlashes(pEnd);
  205.      }
  206.      else
  207. --
  208. 2.45.1
  209.  
  210. From 2991b563a693199c80eb2e27ea4b8f867d128ca4 Mon Sep 17 00:00:00 2001
  211. From: Roland Mainz <roland.mainz@nrubsig.org>
  212. Date: Fri, 22 Nov 2024 16:07:56 +0100
  213. Subject: [PATCH 3/4] daemon: Reject invalid UTF-8 characters from/to NFS
  214.  server
  215.  
  216. Reject invalid UTF-8 characters from/to NFS server
  217.  
  218. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  219. ---
  220. daemon/open.c    |  3 ++-
  221.  daemon/readdir.c |  3 ++-
  222.  daemon/setattr.c | 18 ++++++++++++------
  223.  daemon/symlink.c | 11 ++++++++++-
  224.  4 files changed, 26 insertions(+), 9 deletions(-)
  225.  
  226. diff --git a/daemon/open.c b/daemon/open.c
  227. index 9be3e89..7d3ae46 100644
  228. --- a/daemon/open.c
  229. +++ b/daemon/open.c
  230. @@ -1081,7 +1081,8 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
  231.          status = safe_write(&buffer, length, &len, sizeof(len));
  232.          if (status) goto out;
  233.          /* convert args->symlink to wchar */
  234. -        if (*length <= len || !MultiByteToWideChar(CP_UTF8, 0,
  235. +        if (*length <= len || !MultiByteToWideChar(CP_UTF8,
  236. +            MB_ERR_INVALID_CHARS,
  237.              args->symlink.path, args->symlink.len,
  238.              (LPWSTR)buffer, len / sizeof(WCHAR))) {
  239.              status = ERROR_BUFFER_OVERFLOW;
  240. diff --git a/daemon/readdir.c b/daemon/readdir.c
  241. index 62d0904..5239037 100644
  242. --- a/daemon/readdir.c
  243. +++ b/daemon/readdir.c
  244. @@ -512,8 +512,9 @@ static int readdir_copy_entry(
  245.      uint32_t wname_len, wname_size, needed;
  246.      PFILE_DIR_INFO_UNION info;
  247.  
  248. -    wname_len = MultiByteToWideChar(CP_UTF8, 0,
  249. +    wname_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
  250.          entry->name, entry->name_len, wname, NFS4_OPAQUE_LIMIT);
  251. +    EASSERT(wname_len > 0);
  252.      wname_size = (wname_len - 1) * sizeof(WCHAR);
  253.  
  254.      needed = readdir_size_for_entry(args->query_class, wname_size);
  255. diff --git a/daemon/setattr.c b/daemon/setattr.c
  256. index 676d3ab..0e16a83 100644
  257. --- a/daemon/setattr.c
  258. +++ b/daemon/setattr.c
  259. @@ -282,12 +282,15 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  260.          goto out;
  261.      }
  262.  
  263. -    dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8, 0,
  264. +    dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8,
  265. +        WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  266.          rename->FileName, rename->FileNameLength/sizeof(WCHAR),
  267.          dst_path.path, NFS41_MAX_PATH_LEN, NULL, NULL);
  268.      if (dst_path.len == 0) {
  269. -        eprintf("WideCharToMultiByte failed to convert destination "
  270. -            "filename %S.\n", rename->FileName);
  271. +        eprintf("handle_nfs41_rename(args->path='%s'): "
  272. +            "WideCharToMultiByte() failed to convert destination "
  273. +            "filename '%S', lasterr=%d.\n",
  274. +            args->path, rename->FileName, (int)GetLastError());
  275.          status = ERROR_INVALID_PARAMETER;
  276.          goto out;
  277.      }
  278. @@ -433,12 +436,15 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
  279.  
  280.      (void)memset(&info, 0, sizeof(info));
  281.  
  282. -    dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8, 0,
  283. +    dst_path.len = (unsigned short)WideCharToMultiByte(CP_UTF8,
  284. +        WC_ERR_INVALID_CHARS|WC_NO_BEST_FIT_CHARS,
  285.          link->FileName, link->FileNameLength/sizeof(WCHAR),
  286.          dst_path.path, NFS41_MAX_PATH_LEN, NULL, NULL);
  287.      if (dst_path.len == 0) {
  288. -        eprintf("WideCharToMultiByte failed to convert destination "
  289. -            "filename %S.\n", link->FileName);
  290. +        eprintf("handle_nfs41_link(args->path='%s'): "
  291. +            "WideCharToMultiByte() failed to convert destination "
  292. +            "filename '%S', lasterr=%d.\n",
  293. +            args->path, link->FileName, (int)GetLastError());
  294.          status = ERROR_INVALID_PARAMETER;
  295.          goto out;
  296.      }
  297. diff --git a/daemon/symlink.c b/daemon/symlink.c
  298. index d7ab9cd..d2ff834 100644
  299. --- a/daemon/symlink.c
  300. +++ b/daemon/symlink.c
  301. @@ -281,9 +281,18 @@ static int marshall_symlink(unsigned char *buffer, uint32_t *length, nfs41_upcal
  302.      status = safe_write(&buffer, length, &len, sizeof(len));
  303.      if (status) goto out;
  304.  
  305. -    if (*length <= len || !MultiByteToWideChar(CP_UTF8, 0,
  306. +    if (*length <= len) {
  307. +        status = ERROR_BUFFER_OVERFLOW;
  308. +        goto out;
  309. +    }
  310. +
  311. +    if (!MultiByteToWideChar(CP_UTF8,
  312. +            MB_ERR_INVALID_CHARS,
  313.              args->target_get.path, args->target_get.len,
  314.              (LPWSTR)buffer, len / sizeof(WCHAR))) {
  315. +        eprintf("marshall_symlink: "
  316. +            "MultiByteToWideChar() failed, lasterr=%d\n",
  317. +            (int)GetLastError());
  318.          status = ERROR_BUFFER_OVERFLOW;
  319.          goto out;
  320.      }
  321. --
  322. 2.45.1
  323.  
  324. From 9c746d3ccefefb28a4156abd80d57319075bad76 Mon Sep 17 00:00:00 2001
  325. From: Roland Mainz <roland.mainz@nrubsig.org>
  326. Date: Fri, 22 Nov 2024 16:25:15 +0100
  327. Subject: [PATCH 4/4] cygwin: nfsurlconv should urlencode POSIX
  328.  shell/bash/ksh93-specical characters
  329.  
  330. nfsurlconv should urlencode POSIX shell/bash/ksh93-specical characters,
  331. to avoid that if users do not use '"' or "'" to quote an
  332. URL get a nasty suprise.
  333.  
  334. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  335. ---
  336. cygwin/utils/nfsurlconv/nfsurlconv.ksh | 63 ++++++++++++++++++++------
  337.  1 file changed, 48 insertions(+), 15 deletions(-)
  338.  
  339. diff --git a/cygwin/utils/nfsurlconv/nfsurlconv.ksh b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  340. index e11c019..d7c2671 100644
  341. --- a/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  342. +++ b/cygwin/utils/nfsurlconv/nfsurlconv.ksh
  343. @@ -176,6 +176,7 @@ function urlencodestr
  344.  
  345.         nameref out_encodedstr=$1
  346.         typeset in_str="$2"
  347. +       integer posix_shell_safe=$3
  348.         typeset ch ch_hexval dummy
  349.         integer ch_num
  350.         typeset url=''
  351. @@ -222,10 +223,20 @@ function urlencodestr
  352.                 # Only alphanumerics, "$-_.+!*'()," and reserved characters
  353.                 # ("/" for nfs://-URLS) are allowed
  354.                 #
  355. -               if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/$-_.+!*\'(),[:alnum:]] ]] ; then
  356. -                       url+="%$ch_hexval"
  357. +               if (( posix_shell_safe != 0 )) ; then
  358. +                       # in POSIX shell safe mode we also encode '!', '*', '$'
  359. +                       if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/-_.+\'(),[:alnum:]] ]] ; then
  360. +                               url+="%$ch_hexval"
  361. +                       else
  362. +                               url+="$ch"
  363. +                       fi
  364. +
  365.                 else
  366. -                       url+="$ch"
  367. +                       if (( ch_num > 127 )) || [[ "$ch" != ~(Elr)[/$-_.+!*\'(),[:alnum:]] ]] ; then
  368. +                               url+="%$ch_hexval"
  369. +                       else
  370. +                               url+="$ch"
  371. +                       fi
  372.                 fi
  373.         done
  374.  
  375. @@ -238,16 +249,24 @@ function urlencodestr
  376.  function hostname_port_path_to_nfsurl
  377.  {
  378.         set -o nounset
  379. +       set -o errexit
  380.  
  381. -       typeset hostname="$1"
  382. -       integer port="$2"
  383. -       typeset path="$3"
  384. +       integer encode_posix_shell_safe=$1
  385. +       typeset hostname="$2"
  386. +
  387. +       integer port="$3"
  388. +       typeset path="$4"
  389.  
  390.         typeset enc_path
  391.         typeset enc_hostname
  392.  
  393. -       urlencodestr enc_hostname "$hostname"
  394. -       urlencodestr enc_path "$path"
  395. +       if [[ "$path" != /* ]] ; then
  396. +               print -u2 -f $"%s: Path must be absolute.\n" "$0"
  397. +               return 1
  398. +       fi
  399. +
  400. +       urlencodestr enc_hostname "$hostname" $encode_posix_shell_safe
  401. +       urlencodestr enc_path "$path" $encode_posix_shell_safe
  402.         if (( port == 2049 )) ; then
  403.                 printf 'url=nfs://%s/%s\n' "$enc_hostname" "$enc_path"
  404.         else
  405. @@ -260,13 +279,16 @@ function main
  406.  {
  407.         set -o nounset
  408.  
  409. +       integer encode_posix_shell_safe=1
  410. +
  411.         # fixme: Need better text layout for $ nfsurlconv --man #
  412.         typeset -r nfsurlconv_usage=$'+
  413. -       [-?\n@(#)\$Id: nfsurlconv (Roland Mainz) 2024-07-08 \$\n]
  414. +       [-?\n@(#)\$Id: nfsurlconv (Roland Mainz) 2024-11-22 \$\n]
  415.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  416.         [+NAME?nfsurlconv - convert hostname,port,path from/to a nfs://-URL]
  417.         [+DESCRIPTION?\bnfsurlconv\b convert { hostname, port, path } from/to a nfs://-URL.]
  418.         [D:debug?Enable debugging.]
  419. +       [S!:posixshellsafe?urlencode shell special characters.]
  420.  
  421.         hostnameportpath2nfsurl hostname port path
  422.         hostnamepath2nfsurl hostname path
  423. @@ -294,7 +316,13 @@ hostport=bbb
  424.  path=/a/b/c
  425.  ]
  426.  }
  427. -               [+?Example 4:][+?Convert URL nfs://bbb:12049//a/b/c?param1=pvalue1&param2=pvalue2 to ( hostport=, path=, urlparameter= )]{
  428. +               [+?Example 4:][+?Convert URL url=nfs://10.49.202.230//%e3%81%a0%e3%81%84%e3%81%99%e3%81%8d%21%e3%83%9e%e3%82%a6%e3%82%b9_2/ to ( hostport=, path= )]{
  429. +[+\n$ nfsurlconv.ksh url2hostportpath "nfs:://10.49.202.230//%e3%81%a0%e3%81%84%e3%81%99%e3%81%8d%21%e3%83%9e%e3%82%a6%e3%82%b9_2/"
  430. +hostport=10.49.202.230
  431. +path=/bigdisk/<japanese-characters>_2/
  432. +]
  433. +}
  434. +               [+?Example 5:][+?Convert URL nfs://bbb:12049//a/b/c?param1=pvalue1&param2=pvalue2 to ( hostport=, path=, urlparameter= )]{
  435.  [+\n$ nfsurlconv.ksh url2hostportpath "nfs:://bbb::12049//a/b/c??param1=pvalue1&param2=pvalue2"
  436.  hostport=bbb::12049
  437.  path=/a/b/c
  438. @@ -320,6 +348,9 @@ urlparameter=( name=param2 value=pvalue2 )
  439.                         'D')
  440.                                 # fixme: Implement debugging option
  441.                                 ;;
  442. +                       'S')
  443. +                               (( encode_posix_shell_safe=0 ))
  444. +                               ;;
  445.                         *)
  446.                                 usage "${progname}" "${nfsurlconv_usage}"
  447.                                 return $?
  448. @@ -342,23 +373,25 @@ urlparameter=( name=param2 value=pvalue2 )
  449.         #
  450.         c.args=( "${c.args[@]}" )
  451.  
  452. +       #printf 'c.args=%q\n' "${c.args[@]}"
  453. +
  454.         typeset mode="${c.args[0]-}"
  455.  
  456.         case "$mode" in
  457.                 # fixme: add "hostportpath2nfsurl"
  458.                 # fixme: add "etcexports2nfsurl"
  459.                 'hostnameportpath2nfsurl')
  460. -                       hostname_port_path_to_nfsurl "${@:2}"
  461. +                       hostname_port_path_to_nfsurl $encode_posix_shell_safe "${c.args[@]:1}"
  462.                         return $?
  463.                         ;;
  464.                 'hostnamepath2nfsurl')
  465. -                       hostname_port_path_to_nfsurl "${@:2:1}" 2049 "${@:3:1}"
  466. +                       hostname_port_path_to_nfsurl $encode_posix_shell_safe "${c.args[@]:1:1}" 2049 "${c.args[@]:2:1}"
  467.                         return $?
  468.                         ;;
  469.                 'url2hostnameportpath')
  470.                         compound urldata
  471.  
  472. -                       parse_sshnfs_url urldata "${@:2:1}" || return 1
  473. +                       parse_sshnfs_url urldata "${c.args[@]:1:1}" || return 1
  474.                         printf 'hostname=%s\n' "${urldata.host}"
  475.                         printf 'port=%s\n' "${urldata.port-2049}"
  476.                         printf 'path=%s\n' "${urldata.path-}"
  477. @@ -374,7 +407,7 @@ urlparameter=( name=param2 value=pvalue2 )
  478.                 'url2hostportpath')
  479.                         compound urldata
  480.  
  481. -                       parse_sshnfs_url urldata "${@:2:1}" || return 1
  482. +                       parse_sshnfs_url urldata "${c.args[@]:1:1}" || return 1
  483.                         printf 'hostport=%s\n' "${urldata.hostport}"
  484.                         printf 'path=%s\n' "${urldata.path-}"
  485.                         if [[ -v urldata.parameters ]] ; then
  486. @@ -389,7 +422,7 @@ urlparameter=( name=param2 value=pvalue2 )
  487.                 'url2compound')
  488.                         compound urldata
  489.  
  490. -                       parse_sshnfs_url urldata "${@:2:1}" || return 1
  491. +                       parse_sshnfs_url urldata "${c.args[@]:1:1}" || return 1
  492.                         print -v urldata
  493.                         return 0
  494.                         ;;
  495. --
  496. 2.45.1

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