Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP and SMB

Status
Not open for further replies.

Nosferatu

Programmer
Jun 9, 2000
412
RO
First of all, I was not sure in which forum should I post this, so here I am.

My question is related to the HTTP and SMB protocols and it is very simple:

Do the protocols communicate? That is, do SMB shares are avaiable over the HTTP? If yes, how and at which level? Is a SMB share transformed into an URL by the OS and accessible that way?
This does not sound right to me but some people seem to indicate that's what's happening.

Can anybody enlight me on this? [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
nosferatu,

To answer your questions exactly,
The protocols don't communicate.
SMB shares aren't available over HTTP (unless someone has created an HTTP server that can serve up smb shares).
SMB is not transformed into a URL, in some implementations it is actually the other way around. The following paragraph alludes to the fact that a browsing application of some sort (Konqueror, for example) may make the difference between SMB and HTTP transparent by allowing the use of some SMB URL like:
smb://<server>/<share>
That URL would be parsed by the SMB engine, separate from HTTP.
Code:
&quot;There is, in fact, such a thing as an SMB URL. It fits into the general URI syntax and can be used to specify files, directories, and other SMB-shared stuff. It is intended as a more portable, and more complete way to specify SMB paths at the application level. 
As of this writing, the SMB URL is only documented in an IETF Internet Draft, and is not yet any kind of standard. That hasn't stopped folks from implementing it, though. The SMB URL is supported in a wide variety of products including the KDE and GNOME desktop GUI environments, web browsers such as Galeon and Konqueror, and Open Source CIFS projects like jCIFS and libsmbclient (the latter is included with Samba). Thursby Software and Apple Computer also make use of the SMB URL in their commercial CIFS implementations. &quot; ([URL unfurl="true"]http://ubiqx.org/cifs/implementing[/URL] cifs smb.htm)
The above reference is excellent (and is one part of several pages). It goes into great detail about the SMB (CIFS) protocol and how to use it (examples in C for *nix).
SMB runs directly over TCP/IP, or over NBT (session layer, for legacy apps).
If you are looking for ideas for your own implementation of SMB, a nice starting place is the file nbtscan.c (google for it). It only deals with SMB names but gives you a good idea of what you are dealing with. (or you could sort through the Samba source code, but I'm not sure you have several years of free time ;)

Hope that helps.
-Mike
&quot;But Gandalf laughed, and replied: 'You would not wonder, if you used this herb yourself. You might find that smoke blown out cleared your mind of shadows within. Anyway, it gives patience, to listen to error without anger.'&quot;
-Unfinished Tales, J.R.R. Tolkien
 
Hey, thanks Mike... I've posted this question a few days ago and since, I got myself several answers as well.

Speaking of references, contains an excellent CIFS book written by Christpher Hertel - due to be hardcopied in March 2003 (!)
Indeed, I do have some spare years in my life, but I am considering them for retirement, about 35-40 years from now :).

I got into another area now - the security over SMB - and people cannot stop telling me how major security issues affect this protocol (middle man attack, downgrading and hijacking) and I am begining to wonder if using SMB over the Internet ot serve possible sensitive data is a good idea afterall.

But again, is there ANY protocol out there that doesn't have security flaws? [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top