smb: fix ipv6 support
ClosedPublic

Authored by sitter on Mar 3 2020, 10:49 AM.

Details

Summary

libsmbc doesn't presently support smb://[ABCD::DCBA]/ uris because it
has very opinionated colon parsing. as a workaround we convert hosts
that are ipv6 addresses to their windows ipv6 literal representation.
that is basically s/:/-/g and s/%/s/g and appending .ipv6-literal.net.

BUG: 417682
FIXED-IN: 20.04

Test Plan

builds, test passes, 'smb://[::1]/foo' works as expected

Diff Detail

Repository
R320 KIO Extras
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Mar 3 2020, 10:49 AM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptMar 3 2020, 10:49 AM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
sitter requested review of this revision.Mar 3 2020, 10:49 AM
thiago added a subscriber: thiago.Mar 3 2020, 4:16 PM

STD3 also forbids domain labels ending in dash, so can you add a test for smb://[fe80::]/ too? You'll need to adjust your code

sitter updated this revision to Diff 76915.Mar 4 2020, 10:30 AM

guard against ending in dash

also move to front() and back() for ease of reading

thiago added a comment.Mar 4 2020, 3:33 PM

looks good to me.

ngraham accepted this revision.Mar 4 2020, 9:23 PM
This revision is now accepted and ready to land.Mar 4 2020, 9:23 PM
cfeck added a subscriber: cfeck.Mar 4 2020, 9:38 PM

Should this be in 19.12 branch? I am doing a respin of kio-extras anyway.

cfeck added a comment.Mar 5 2020, 9:50 AM

Well, cannot delay the release any longer.

sitter added a comment.Mar 5 2020, 3:01 PM

Ah sorry for the unnecessary wait. I wasn't planning on 19.12. Thanks for asking though :)

This revision was automatically updated to reflect the committed changes.