install smb as both smb:// and cifs://
ClosedPublic

Authored by sitter on Feb 10 2020, 3:42 PM.

Details

Summary

the latter while not IANA registered is apparently used in places. to
cheaply support it we now configure the protocol file for both protocol
'smb' and 'cifs' and installing two protocol files. they are still both
backed by the same plugin and otherwise the same.
code-wise this also required adjustments to the URL validation tech as
it has hardcoded checks for smb schemes.

FIXED-IN: 19.12.3
BUG: 327295

Test Plan
  • cifs://host/share
  • cifs://host
  • cifs://

all open correctly. they do get translated to smb because of the checkUrl code.

checkUrl seems entirely pointless, SMBUrl does a bit of validation/fixing as part of
updateCache. It occurs to me checkUrl should simply be incorporated into SMBUrl
and we should construct an SMBUrl where we previously called checkUrl. before doing
anything of value we construct SMBUrls anyway, so the isolated logic does absolutely
nothing SMBUrl couldn't do just as well. also needs a unit test -.- ... too much
refactoring for a bugfix though

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.Feb 10 2020, 3:42 PM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptFeb 10 2020, 3:42 PM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
sitter requested review of this revision.Feb 10 2020, 3:42 PM
ngraham accepted this revision.Feb 10 2020, 4:10 PM
This revision is now accepted and ready to land.Feb 10 2020, 4:10 PM

I'm a bit confused here, isn't the protocol file now a JSON file? I'm looking at the repo and it appears to be the case, so I'm not seeing how this diff is seeing this as a rename?

Both are supported, but indeed json is preferred over installed .protocol files.

You can use protocoltojson (from kio) to do the conversion.
This is all technically unrelated to this commit, except that the nice cmake hack to generate two files isn't even needed with json, you can just bundle up both protocols into the same json file (see kio/src/ioslaves/http/http.json for an example).

feverfew: you're probably looking at master while this is a patch for the 19.12 branch.
See https://phabricator.kde.org/D26358 which happened in master.

I guess that makes this commit ok for 19.12, but it has to be redone differently in master.

feverfew: you're probably looking at master while this is a patch for the 19.12 branch.
See https://phabricator.kde.org/D26358 which happened in master.

I guess that makes this commit ok for 19.12, but it has to be redone differently in master.

That's exactly what I did, ignore me :)

meven added a subscriber: meven.Feb 11 2020, 8:34 AM
This comment was removed by meven.

Easy merge for master, just needs some ctrl-c magic. Thanks for the heads up though :)

This revision was automatically updated to reflect the committed changes.