<table><tr><td style="">sitter created this revision.<br />sitter added a reviewer: ngraham.<br />Herald added projects: Dolphin, Frameworks.<br />Herald added subscribers: kfm-devel, kde-frameworks-devel.<br />sitter requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27804">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>workgroup names are as best I can tell always still netbios names which<br />
means they can contain a bunch of characters ordinarily not found in valid<br />
host names. e.g. spaces<br />
this causes trouble with the IANA SMB URI draft, as used by libsmbc,<br />
since the workgroup would be the host field of the RI when browsing<br />
a workgroup (i.e. filtering hosts that are member of a given workgroup)<br />
because QUrl does not allow invalid hostnames in the host field.</p>

<p>to bypass this problem we now put the workgroup name into the query of the<br />
url as <tt style="background: #ebebeb; font-size: 13px;">kio-workgroup</tt>, should it cause trouble in the host field. SMBUrl<br />
takes this query into account when constructing the url for smbc.<br />
since the latter has uniquely exciting potential for breakage this entire<br />
dance is only done when absolutely necessary and otherwise we continue with<br />
all the same code and behavior as without this commit.</p>

<p>on a side note: the awkward name flexibility seems to not extend to<br />
computer names anymore (supposedly because of LLMNR) so this entire<br />
use case is already very niche as we (and libsmbclient) currently only<br />
support workgroup browsing for NT1 networks, and NT1 is by default not<br />
supported on windows10 or samba.</p>

<p>FIXED-IN: 20.04<br />
BUG: 204423</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>builds, test passes, can browse workgroup with space in name</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R320 KIO Extras</div></div></div><br /><div><strong>BRANCH</strong><div><div>smb-smburl-static-autotest-ipv6-spaces</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27804">https://phabricator.kde.org/D27804</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>smb/autotests/smburltest.cpp<br />
smb/kio_smb_browse.cpp<br />
smb/smburl.cpp</div></div></div><br /><div><strong>To: </strong>sitter, ngraham<br /><strong>Cc: </strong>kde-frameworks-devel, kfm-devel, thiago, pberestov, iasensio, fprice, LeGast00n, cblack, MrPepe, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov<br /></div>