A SMB file system wrapper for AmigaOS, using the AmiTCP V3 API

1. What is it?

This document briefly describes the smbfs program, which implements an SMB file system for AmigaOS. This file system can be used to access files made available by file servers which implement the SMB protocol, such as Microsoft Windows or any other platform which supports the free Samba product. These files can be accessed using shell commands such as List, the Workbench or utilities such as Directory Opus as if the file server were a local disk drive.

2. What do you need to get started?

You need a TCP/IP stack that supports the AmiTCP V3 API, such as Miami, the original free AmiTCP 3.0 release, AmiTCP 4.x, Miami Deluxe, AmiTCP Genesis or Roadshow and the obligatory networking gear. All these items need to be in good shape and properly configured.

Most important, you need a computer which exports file sharing services using the SMB protocol.

It often helps to have Samba installed on your Amiga, too, as this can aid in tracking down bugs and obtaining information which smbfs cannot obtain all by itself.

Last but not least, you need to be proficient in configuring and using the TCP/IP stack; networking knowledge is definitely assumed.

smbfs requires AmigaOS 2.04 or higher to work.

3. Preparations

You need to know which computer's files you want to share using the smbfs file system. That computer must be known by name, it is not sufficient just to know its IP address. If you know the IP address but cannot refer to the host by its name then smbfs will not work. In that case, make sure that you add a host name entry referring to the IP address to your TCP/IP stack's host database (e.g. the AmiTCP:bin/hosts file or the corresponding page in the stack's configuration user interface).

The name of the computer to connect to must not be too long. If it is longer than 16 characters, smbfs will not work properly.

You need to know which service you want to connect to on the target computer. You can find out which services are available on a certain computer by using the Samba smbclient program. For example, if you were to query the services offered by a machine called sourcery you could enter the following:

samba:bin/smbclient -L sourcery

And you might get the following information:

added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Password: Domain=[ARBEITSGRUPPE] OS=[AmigaOS] Server=[Samba 2.0.7]

        Sharename      Type      Comment
        ---------      ----      -------
        All            Disk      All volumes in the system
        IPC$           IPC       IPC Service (Amiga 3000UX)
        olsen          Disk      Home Directories

        Server               Comment
        ---------            -------
        SOURCERY             Amiga 3000UX

        Workgroup            Master
        ---------            -------
        ARBEITSGRUPPE        SOURCERY

The share name to connect to would be ALL in this case.

You need to know which login name and which password are required to connect to the shared resource, and you need to know the name of the workgroup or domain the file server is a member of.

4. Starting and stopping the file system

smbfs is an uncommon kind of file system in that you do not use the Mount command to mount it. In fact, smbfs is a shell program which can be launched from the shell, using command line parameters to tell it which resources should be used. But you can also start it from Workbench: in this case you would have to put the program's command line options into icon tool types.

By now you should have assembled the following information:

That's basically everything you need to know to continue -- unless something goes wrong, but more on that lateron.

Now you can start the file system. For example, to connect to the file server called sourcery and the shared all resource it exports, with that computer being a member of the workgroup Arbeitsgruppe, using the login name PCGuest and not providing any password you would enter the following:

Run >NIL: SMBFS Workgroup=Arbeitsgruppe User=PCGuest Service=//sourcery/all

This would cause a new device by the name of SMBFS: to be mounted, showing all files and directories the sourcery server makes available for sharing.

How do you 'unmount' the file system? That's very easy, just check the output of the Status shell command. You might get the following output:

Process 1: Loaded as command: TURBOTEXT
Process 2: Loaded as command: Work:Tools/Blowup
Process 3: Loaded as command: Work:Tools/Sashimi
Process 4: Loaded as command: Work:CyberTools/CyberGuard
Process 5: Loaded as command: Work:Tools/OpenDevicePatch
Process 6: Loaded as command: CED
Process 7: Loaded as command: Workbench
Process 8: Loaded as command: Status
Process 9: No command loaded
Process 10: Loaded as command: SMBFS '//sourcery/all'

Look at the last line describing process number 10: it shows the name of the file system program smbfs and the name of the SMB share it is connected to. To stop this file system and effectively unmount it, use the shell Break command; in this case you would enter Break 10 to stop the file system. Note that the program may not terminate immediately; it may have to wait until the last client has released all resources referring to the file system. You may have to send more than one Break command to stop the program.

5. Startup options

The smbfs program supports a number of command line options, as will be described below. The command template looks like this:

DOMAIN=WORKGROUP/K,USER=USERNAME/K,PASSWORD/K,CHANGECASE/S,
CASE=CASESENSITIVE/S,OMITHIDDEN/S,QUIET/S,CLIENT=CLIENTNAME/K,
SERVER=SERVERNAME/K,DEVICE=DEVICENAME/K,VOLUME=VOLUMENAME/K,
CACHE=CACHESIZE/N/K,DEBUGLEVEL=DEBUG/N/K,TZ=TIMEZONEOFFSET/N/K,
DST=DSTOFFSET/N/K,TRANSLATE=TRANSLATIONFILE/K,SERVICE/A

The individual options serve the following purposes:

6. Known problems

The design of smbfs follows the original file system concept behind the code which the Sharity-Light file system is based upon. And that is a Unix file system which differs from Amiga specific file systems in many ways which can lead to problems which are discussed briefly below:

While there are no easy solutions for any of these problems, it does not mean that smbfs is unusable. You just have to be more careful when you use the file system. For example, if a directory's contents cannot be deleted due to one of the problems mentioned above, you might want to retry later.

It should be noted that the problems described above are not inherent to the original file system design. It's just that transferring that design to an Amiga file system created the problems.

7. Credits

This file system is based upon prior work by Paal-Kr. Engstad, Volker Lendecke, Mark A. Shand, Donald J. Becker, Rick Sladkey, Fred N. van Kempen, Eric Kasten and Rudolf Koenig. It is a direct descendant of the Sharity-Light file system written by Christian Starkjohann.

The password encryption code was lifted from the Samba package. It was written by Andrew Tridgell and the Samba Team.

8. Author

The Sharity-Light source code was adapted and wrapped into an AmigaOS layer by Olaf `Olsen' Barthel. If you wish to contact me, please send e-mail to the following address:

obarthel -at- gmx -dot- net

Or, alternatively, you might want to contact me via my postal address:

Olaf Barthel
Gneisenaustr. 43
D-31275 Lehrte
Federal Republic of Germany

If you want to submit a bug report or an enhancement request, please enclose sufficient information to allow me to make sense of the problem. That includes debugging logs produced using the DEBUG option.

If possible, use the facilities for bug reporting and tracking on the sourceforge.net web site, which is the new home for this file system.

9. Source code

smbfs is distributed under the terms of the GNU General Public License (version 2). The source code should have accompanied this program; if it hasn't, please contact the author for a copy.

The program was compiled using the SAS/C 6.58 compiler, with the Roadshow SDK providing for the TCP/IP stack API header files.