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

Thiago Macieira noreply at phabricator.kde.org
Tue Mar 3 16:13:05 GMT 2020


thiago added a comment.


  Looks good, but testing should be extended. I suggest:
  
  1. A workgroup with non-US-ASCII characters in the name, if that's permitted
  2. A workgroup with % in the name: the URL should have "%25"
  3. Roundtrip checking. The test only does toSmbcUrl(), so please test the reverse.
  4. Error-checking the conversion from query to hostname: things like %00 (a NUL byte), URL delimiters (':', '/', '?' and '#'), byte sequences that do not encode UTF-8 (like %FF).
  
  I think that you'll find that % works in one direction only. I have no idea what you'll find for #4.

INLINE COMMENTS

> smburl.cpp:134
> +    QUrlQuery query(sambaUrl);
> +    const QString workgroup = query.queryItemValue("kio-workgroup");
> +    if (workgroup.isEmpty()) {

For the % issue, you may want to pass `QUrl::FullyDecoded` as the second argument to queryItemValue.

REPOSITORY
  R320 KIO Extras

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

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: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200303/787ce7eb/attachment.html>


More information about the Kde-frameworks-devel mailing list