Bug 327295 - "cifs:" can and should be interchangeable with "smb:"
Summary: "cifs:" can and should be interchangeable with "smb:"
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Samba (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 23:58 UTC by Orion Poplawski
Modified: 2020-02-13 11:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Orion Poplawski 2013-11-07 23:58:29 UTC
Entering a cifs:// url in dolphin results in "Invalid protocol".  We should support this.

Reproducible: Always
Comment 1 Orion Poplawski 2013-11-08 16:34:50 UTC
According to Implementing CIFS http://ubiqx.org/cifs/Appendix-D.html

One of the fiddly bits that had to be handled when designing the SMB URL was whether the scheme identifier should be "SMB" or "CIFS". There wasn't a lot of argument over this. People just started using whichever they liked, so both were declared acceptable. In other words, "smb://" and "cifs://" both mean the same thing (and implementations should support both).

We're seeing cifs: used a lot on OS X.
Comment 2 Christoph Feck 2013-11-17 20:42:49 UTC
If cifs:// and smb:// are interchangeable, it should be easy to fix.
Comment 3 Christoph Feck 2013-11-17 20:52:30 UTC
Well, not a junior-job. "smb" is scattered all over KDE code, so there is no single place to simply add the protocol alias.
Comment 4 Harald Sitter 2020-02-05 13:25:21 UTC
Don't we simply need a kservice protocol definition file?
All we need to do is accept cifs:// as an entry point into the smb plugin, which should be as simply as defining a dummy protocol same as smb.protocol but with protocol=cifs. That would technically still mean we have two protocols, but given they'd be backed by the same plugin I am not sure that technical difference will matter all that much in practice.
Comment 5 David Faure 2020-02-05 15:23:18 UTC
Sounds right.
Comment 6 Harald Sitter 2020-02-10 15:43:58 UTC
https://phabricator.kde.org/D27291
Comment 7 Harald Sitter 2020-02-13 11:39:27 UTC
Git commit a5f51238fab75c407c53dd6ec348937c08b6022d by Harald Sitter.
Committed on 13/02/2020 at 11:19.
Pushed by sitter into branch 'master'.

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

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

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

Reviewers: dfaure, ngraham

Reviewed By: ngraham

Subscribers: meven, feverfew, kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D27291

M  +4    -1    smb/CMakeLists.txt
M  +17   -3    smb/kio_smb_browse.cpp
M  +8    -0    smb/kio_smb_internal.cpp
R  +1    -1    smb/smb.protocol.cmake [from: smb/smb.protocol - 093% similarity]

https://commits.kde.org/kio-extras/a5f51238fab75c407c53dd6ec348937c08b6022d