SMB2WWW Gateway software

SMB2WWW is a gateway between WWW and the MS Windows (WfW,95,NT), OS/2 and Lan Manager networks, using the session message blocks (SMB) protocol. This means that you can browse these networks and download files using a single executable in the "cgi-bin" directory of a WWW server.

How it works

When you issue a request to the WWW server like "/cgi-bin/smb2/lanserver/", the gateway program "smb2" is executed with "lanserver/" as it's parameter. The first thing that has to be determined is the IP address of "lanserver". This is done by sending a broadcast (the address of this broadcast is currently hardcoded) to all computers on the local net. The server with the name "lanserver" should respond and the IP address is determined.

Once the IP address is known, a connection using the SMB protocol is made to this server and three lists are requested. The first one is a list of all the shares (drives) on this server. The second one is a browse list of all the server within the same workgroup as "lanserver". Thirdly a workgroup list is returned; this is a list of all known workgroups and their master server/ browser.

Each server, either in the browse list or a master browser can be contacted in exactly the same way. A master browser can have other servers in it's workgroup not known to "lanserver".

By selecting a share of a server, a directory of list is obtained. This directory list contains references to files and other directories. Each of these files can be downloaded; for all known extensions a correct mime type is supplied, so the appropriate application may be launched.

To download a whole directory and all of it's subdirectories, just click on the attribute of this directory or on "TAR current directory" on top of the directory list. Save this file with "tar" as extension and use tar or for instance WinZip to extract this archive.

Error messages

One of the most common error is Error connecting to host. This means that there isn't any computer responding to the name supplied in the request. Most likely this computer is just turned off, while the master browser hasn't noticed this (yet).

Furthermore the gateway can only browse shares that are not protected by passwords. When you access a share which requires a password, you get the following message: Error connecting to share.

Finally, you may get the following message: Access denied. This is a message of the gateway self. The administrator of the server can restrict access to this gateway to local users (based on their IP address). Since every time a request is made to the gateway a process is started, the load of this gateway on the server can become quite high.

Technical details

This gateway software was not constructed from scratch. It is in fact an adaptation of the smbclient implementation as supplied in the SAMBA package. This SAMBA package is the unix implementation of client and server software of the SMB network environment. This package is free software under the terms of the GNU General Public License (GPL) and is copyrighted by Andrew Tridgell. This means that the SMB2WWW gateway should also be free software under the terms of (GPL).

It is currently under development; there needs to be some (a lot) of code cleaning be done. Maybe this software will be included in the SAMBA package some day. But until that day has come, please don't bother Andrew Tridgell with any problems about this gateway.

For 'configuration' (hack it yourself) see also these notes.

Where to get it

The latest version can downloaded here. It is in fact an adaptated version of the SAMBA package (I said there needed to be some code cleaning). To compile it, untar it and do a "make smb2". Copy smb2 to you "cgi-bin" directory of your http server and y're up and running.

Disclaimer

The author of this gateway software can not be held responsible for any copyright infringes when using this gateway. The files accessed by this gateway were already accessable over the internet, but this gateway just makes it a bit easier.
Frank Cremer, last updated March 27th 1997.