D27804: smb: add hack to support spaces in workgroup names

Harald Sitter noreply at phabricator.kde.org
Tue Mar 3 13:13:14 GMT 2020


sitter created this revision.
sitter added a reviewer: ngraham.
Herald added projects: Dolphin, Frameworks.
Herald added subscribers: kfm-devel, kde-frameworks-devel.
sitter requested review of this revision.

REVISION SUMMARY
  workgroup names are as best I can tell always still netbios names which
  means they can contain a bunch of characters ordinarily not found in valid
  host names. e.g. spaces
  this causes trouble with the IANA SMB URI draft, as used by libsmbc,
  since the workgroup would be the host field of the RI when browsing
  a workgroup (i.e. filtering hosts that are member of a given workgroup)
  because QUrl does not allow invalid hostnames in the host field.
  
  to bypass this problem we now put the workgroup name into the query of the
  url as `kio-workgroup`, should it cause trouble in the host field. SMBUrl
  takes this query into account when constructing the url for smbc.
  since the latter has uniquely exciting potential for breakage this entire
  dance is only done when absolutely necessary and otherwise we continue with
  all the same code and behavior as without this commit.
  
  on a side note: the awkward name flexibility seems to not extend to
  computer names anymore (supposedly because of LLMNR) so this entire
  use case is already very niche as we (and libsmbclient) currently only
  support workgroup browsing for NT1 networks, and NT1 is by default not
  supported on windows10 or samba.
  
  FIXED-IN: 20.04
  BUG: 204423

TEST PLAN
  builds, test passes, can browse workgroup with space in name

REPOSITORY
  R320 KIO Extras

BRANCH
  smb-smburl-static-autotest-ipv6-spaces

REVISION DETAIL
  https://phabricator.kde.org/D27804

AFFECTED FILES
  smb/autotests/smburltest.cpp
  smb/kio_smb_browse.cpp
  smb/smburl.cpp

To: sitter, ngraham
Cc: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200303/f16b3b2e/attachment.htm>


More information about the kfm-devel mailing list