[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1006911: thunar: Cannot use IPv6 addresses in remote URLs



On Mon Mar 07 2022 21:55:40 GMT-0800 (Pacific Standard Time), Philip Chung wrote:
Package: thunar
Version: 4.16.10-1
Severity: normal
Tags: ipv6

Dear Maintainer,

It seems that Thunar does not properly handle URLs to remote resources that use an IPv6 address for the host.

When I try to enter an FTP address like ftp://[2001:db8::1234]/ for the location, I get an error saying, 'Error resolving "[2001": Name or service not known.'

Similarly, when I enter an SMB address with a username like smb://example@[2001:db8::1234]/ I get an authentication prompt saying, 'Enter password for "[2001".'

Both of these suggest that the URLs are not being parsed correctly.

A workaround is to mount such resources using the "gio mount" command and browse them in Thunar as normal. This suggests that the wrong URL parsing is happening in Thunar and not GIO or GVFS.

I also get generic "connection failed" and similar errors with other kinds of URLs, like smb: without a username, but I suspect the cause is the same.

This appears to be caused by the fact Thunar performs some URL escaping before attempting to load the URL:

/* try to parse the URI text */
escaped_text = g_uri_escape_string (text, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE);
file_path = g_file_new_for_uri (escaped_text);
The second argument to g_uri_escape_string is a string of characters that should not be escaped, but this does not include [ or ]. As a result, the actual URL that Thunar attempts to load would be something like ftp://%5B2001:db8::1234%5D/ which does not work.

One solution could be to include [ and ] in that second argument although this may cause issues when these characters occur in other parts of the URL (such as the path).

Philip Chung


Reply to: