Bug 83064

Summary: SMB URI syntax error
Product: [Unmaintained] kio Reporter: Christopher R. Hertel <crh>
Component: generalAssignee: Dawit Alemayehu <adawit>
Status: RESOLVED FIXED    
Severity: major CC: coolo
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Christopher R. Hertel 2004-06-08 23:42:19 UTC
Version:           Konqueror 3.2.1 (using KDE KDE 3.2.1)
Installed from:    SuSE RPMs
OS:                Linux

I am the author of the IETF SMB URI Internet Draft.
The syntax of the SMB URI (smb://), as implemented in Konqueror 3.2.1, is incorrect.

- The strings "smb:" and "smb:/" have no defined meaning in the draft
  specification.

- The string "smb://" is supposed to provide the list of known workgroups.
  Konqueror uses "smb:/" for this, but the single slash is incorrect.  Two
  slashes should be used.

The URI draft is here:
  http://www.ietf.org/internet-drafts/draft-crhertel-smb-url-06.txt

A description of the proper workings of the SMB URI can be found here:
  http://ubiqx.org/cifs/Appendix-D.html

Please let me know if I can provide any further help.

Chris Hertel
Samba Team
Comment 1 Stephan Kulow 2004-06-09 10:16:42 UTC
there is a bug in the filtering code that redirects smb:// to http:/ - which is even more nonsense :)
Comment 2 patato07 2004-06-19 23:34:30 UTC
Also:

* smb://a_workgroup stalls, but smb://a_workgroup/ works
* smb://the_host stalls, but smb://the_host/ works
* smb:/a_workgroup/the_host (syntax from the help page) doesn't work, and neither does smb:/a_workgroup/the_host/.
Comment 3 Stephan Kulow 2004-06-20 13:55:29 UTC
the comments in #2 are unrelated. The first two redirections are fixed  and the third point is no valid URL.
Comment 4 Stephan Kulow 2004-07-27 17:18:17 UTC
Dawit: there are similiar bugs around short kuris - can you have a look at it, while David isn't looking? :)
Comment 5 Dawit Alemayehu 2004-07-28 00:19:51 UTC
There should be no issues related to smb:// protocol in the short uri plugin 
because the hack that used to be in there was removed a long time ago...

On Tuesday 27 July 2004 11:18, Stephan Kulow wrote:
> Dawit: there are similiar bugs around short kuris - can you have a look at
> it, while David isn't looking? :)

Comment 6 Stephan Kulow 2004-07-28 11:55:17 UTC
Am Mittwoch 28 Juli 2004 00:19 schrieb Dawit A.:
> There should be no issues related to smb:// protocol in the short uri
> plugin because the hack that used to be in there was removed a long time
> ago...
>
Type smb: and you'll find yourself confronted with http://smb not found - 
never asked for that.

The same is true for any no-argument short URI. Try gg: - it won't google for
nothing - it will redirect to file:/, etc.

Greetings, Stephan

Comment 7 Christopher R. Hertel 2004-07-28 19:18:31 UTC
On Wed, Jul 28, 2004 at 09:55:18AM -0000, Stephan Kulow wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>       
> http://bugs.kde.org/show_bug.cgi?id=83064      
> 
> 
> 
> 
> ------- Additional Comments From coolo kde org  2004-07-28 11:55 -------
> Am Mittwoch 28 Juli 2004 00:19 schrieb Dawit A.:
> > There should be no issues related to smb:// protocol in the short uri
> > plugin because the hack that used to be in there was removed a long time
> > ago...
> >
> Type smb: and you'll find yourself confronted with http://smb not found - 
> never asked for that.

What happens if you type in 'ftp:' or 'garble:'?

There is no "meaning" assigned to 'smb:' by itself.  You *may* choose to 
interpret it as 'smb://' if you like, but if you do that then you should 
rewrite it so that it says 'smb://'.

> The same is true for any no-argument short URI. Try gg: - it won't google for
> nothing - it will redirect to file:/, etc.

I've noticed that KDE is fairly quick to add new URI scheme names without
going through the standards process.  This is a problem.  Sure, something
like 'gg://' is cool... but what happens if someone comes along and writes 
an Internet Draft for the Gopher Gateway protocol or somesuch.  If they 
make an official claim to 'gg://' then you'll have a conflict.

Ouch.

By the way, the latest draft for the SMB URI has been posted by the IETF:

  http://www.ietf.org/internet-drafts/draft-crhertel-smb-url-07.txt

Chris -)-----

Comment 8 Stephan Kulow 2004-07-29 12:08:47 UTC
We do not have gg:// but gg: - that's part of the problem here (as it conflits with the semantic of short protocols as smb:). And we do not claim gg: is a URI of any kind. 

If someone makes an official claim to gg://, then we have a conflict, yes. But I'm quite certain, what will happen if we ask users if they prever a Gopher Gateway protocol over the google shortcut ;)
Comment 9 Dawit Alemayehu 2004-07-30 03:00:40 UTC
On Wednesday 28 July 2004 13:18, Christopher R.Hertel wrote:
> > Am Mittwoch 28 Juli 2004 00:19 schrieb Dawit A.:
> > > There should be no issues related to smb:// protocol in the short uri
> > > plugin because the hack that used to be in there was removed a long
> > > time ago...
> >
> > Type smb: and you'll find yourself confronted with http://smb not found -
> > never asked for that.

This is caused by bugs that exist in all the URI filter plugins. When I fix 
one, the other plugin does crazy things. The above bug though currently
caused by the shorturifilter plugin would have been caused by the localdomain 
filter plugin if the shorturifilter plugin was not used. Anyways, I was 
forced to inspect all the plugins and fix real/potential problems in each of 
plugins. Once I am satisfied that the fixes pass the unit tests correctly, I 
will commit them.

> What happens if you type in 'ftp:' or 'garble:'?

Same as above.

> I've noticed that KDE is fairly quick to add new URI scheme names without
> going through the standards process.  This is a problem.  Sure, something
> like 'gg://' is cool... but what happens if someone comes along and writes
> an Internet Draft for the Gopher Gateway protocol or somesuch.  If they
> make an official claim to 'gg://' then you'll have a conflict.

That is why it has already been addressed. :) It was an implementation mistake 
when the "Web shortcuts" feature was first implemented in KDE 2.0. You can 
change the keyword delimiter from 'colon' to 'space' to avoid the issue you 
mention here. You can do that in the "Web Shortcuts" dialog. Simply select 
'Space' as in the "Keyword Delimiter" selection box. In KDE 4.x we will 
switch to 'Space' as the default delimiter.

Comment 10 Christopher R. Hertel 2004-07-31 02:16:50 UTC
On Fri, Jul 30, 2004 at 01:00:42AM -0000, Dawit Alemayehu wrote:
:
> > > Type smb: and you'll find yourself confronted with http://smb not found -
> > > never asked for that.
> 
> This is caused by bugs that exist in all the URI filter plugins. When I fix 
> one, the other plugin does crazy things. The above bug though currently
> caused by the shorturifilter plugin would have been caused by the localdomain 
> filter plugin if the shorturifilter plugin was not used. Anyways, I was 
> forced to inspect all the plugins and fix real/potential problems in each of 
> plugins. Once I am satisfied that the fixes pass the unit tests correctly, I 
> will commit them.

Kewl.

Sorry to start the avalance.  :)

> > What happens if you type in 'ftp:' or 'garble:'?
> 
> Same as above.
>
> > I've noticed that KDE is fairly quick to add new URI scheme names without
> > going through the standards process.  This is a problem.  Sure, something
> > like 'gg://' is cool... but what happens if someone comes along and writes
> > an Internet Draft for the Gopher Gateway protocol or somesuch.  If they
> > make an official claim to 'gg://' then you'll have a conflict.
> 
> That is why it has already been addressed. :)

Good news, thanks.

> It was an implementation mistake 
> when the "Web shortcuts" feature was first implemented in KDE 2.0. You can 
> change the keyword delimiter from 'colon' to 'space' to avoid the issue you 
> mention here. You can do that in the "Web Shortcuts" dialog. Simply select 
> 'Space' as in the "Keyword Delimiter" selection box. In KDE 4.x we will 
> switch to 'Space' as the default delimiter.

Thanks very much for the explanation (and fix).

I've been working on the SMB URI draft for a long while, talking with the
authors of the current URI RFCs and others doing URI work.  I kinda care 
about this stuff now, having worked on it for so long.

So, again, thanks!

Chris -)-----

Comment 11 Dawit Alemayehu 2004-07-31 03:18:52 UTC
CVS commit by adawit: 

- Fix for the problems related to incorrect filtering of URLs such as "smb:" by
  the uri filter plugins. For details read http://bugs.kde.org/show_bug.cgi?id=83064.
  Validated by the uri filter regression tests.

ShortURI filter:
================
- Make isValidShortURL check for what it considers to be a valid short URL
  instead of what should not be. This prevents most if not all incorrect 
  identification of short URLs.

- Improve the mailto: regexp so that user@127.0.0.1 or user@kde.org:8080 is 
  not translated as a mail URL. Now only things of the form user@foo.com are
  considered to be email address. If this is a problem, simply remove the
  rule from $KDEDIRS/share/config/kshorturifilterrc or define your own in
  $KDEHOME/share/config/kshorturifilterrc.

- Removed the "localhost" match since that is the territory of the localdomain
  filter plugin. The entry for ^www was removed because it is now correctly
  handled by the improved isValidShortURIFilter check.

LocalDomain filter:
===================
- Removed all the unnecessary checks copied from short URI filter and replaced it 
  with a simply regexp check that actually matches what it is supposed to match. 

Webshortcut filters:
====================
- Make sure invalid formats of know protocols are not filtered, e.g. "smb:" or 
  "http:". That means now entering things of the form "blah:" will result in a
  search using the default search engine.

CCMAIL:83064@bugs.kde.org


  M +6 -2      ikws/kuriikwsfilter.cpp   1.33
  M +19 -10    ikws/kuriikwsfiltereng.cpp   1.40
  M +1 -1      ikws/kuriikwsfiltereng.h   1.17
  M +8 -0      ikws/kurisearchfilter.cpp   1.15
  M +13 -14    localdomain/localdomainurifilter.cpp   1.19
  M +78 -47    shorturi/kshorturifilter.cpp   1.82
  M +1 -13     shorturi/kshorturifilter.h   1.21
  M +3 -5      shorturi/kshorturifilterrc   1.6



Comment 12 Dawit Alemayehu 2004-10-26 03:14:26 UTC
I am closing this report. If there are anymore issues pretending to the original problem reported here, please feel free to open this ticket again. Thanks for your report.