1 A SMB file system wrapper for AmigaOS, using the AmiTCP V3 API
2 ==============================================================
6 This document briefly describes the SMBFS program, which implements an SMB
7 file system for AmigaOS. This file system can be used to access files made
8 available by file servers which implement the SMB protocol, such as 'Microsoft
9 Windows' or any other platform which supports the free 'Samba' product. These
10 files can be accessed using shell commands such as 'List', the Workbench or
11 utilities such as 'Directory Opus' as if the file server were a local disk
15 2. What do you need to get started?
17 You need a TCP/IP stack that supports the AmiTCP V3 API, such as 'Miami', the
18 original free 'AmiTCP 3.0' release, 'AmiTCP 4.x', 'Miami Deluxe', 'AmiTCP
19 Genesis' or 'Roadshow' and the obligatory networking gear. All these items
20 need to be in good shape and properly configured.
22 Most important, you need a computer which exports file sharing services using
25 It often helps to have 'Samba' installed on your Amiga, too, as this can aid
26 in tracking down bugs and obtaining information which SMBFS cannot obtain all
29 Last but not least, you need to be proficient in configuring and using the
30 TCP/IP stack; networking knowledge is definitely assumed.
32 SMBFS requires AmigaOS 2.04 or higher to work.
37 You need to know which computer's files you want to share using the SMBFS file
38 system. That computer must be known by name, it is not sufficient just to know
39 its IP address. If you know the IP address but cannot refer to the host by its
40 name then SMBFS will not work. In that case, make sure that you add a host
41 name entry referring to the IP address to your TCP/IP stack's host database
42 (e.g. the "AmiTCP:bin/hosts" file or the corresponding page in the stack's
43 configuration user interface).
45 The name of the computer to connect to must not be too long. If it is longer
46 than 16 characters, SMBFS will not work properly.
48 You need to know which service you want to connect to on the target computer.
49 You can find out which services are available on a certain computer by using
50 the Samba 'smbclient' program. For example, if you were to query the services
51 offered by a machine called 'sourcery' you could enter the following:
53 samba:bin/smbclient -L sourcery
55 And you might get the following information:
57 added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
58 Password: Domain=[ARBEITSGRUPPE] OS=[AmigaOS] Server=[Samba 2.0.7]
60 Sharename Type Comment
61 --------- ---- -------
62 All Disk All volumes in the system
63 IPC$ IPC IPC Service (Amiga 3000UX)
64 olsen Disk Home Directories
72 ARBEITSGRUPPE SOURCERY
74 The share name to connect to would be "ALL" in this case.
76 You need to know which login name and which password are required to connect
77 to the shared resource, and you need to know the name of the workgroup or
78 domain the file server is a member of.
81 4. Starting and stopping the file system
83 SMBFS is an uncommon kind of file system in that you do not use the 'Mount'
84 command to mount it. In fact, SMBFS is a shell program which can be launched
85 from the shell, using command line parameters to tell it which resources
86 should be used. But you can also start it from Workbench: in this case you
87 would have to put the program's command line options into icon tool types.
89 By now you should have assembled the following information:
91 - Name of the computer to connect to; this would be the
93 - Name of the shared SMB resource to connect to
94 - Login name and password
96 That's basically everything you need to know to continue -- unless something
97 goes wrong, but more on that lateron.
99 Now you can start the file system. For example, to connect to the file server
100 called 'sourcery' and the shared 'all' resource it exports, with that computer
101 being a member of the workgroup 'Arbeitsgruppe', using the login name
102 'PCGuest' and not providing any password you would enter the following:
104 Run >NIL: SMBFS Workgroup=Arbeitsgruppe User=PCGuest Service=//sourcery/all
106 This would cause a new device by the name of "SMBFS:" to be mounted, showing
107 all files and directories the 'sourcery' server makes available for sharing.
109 How do you 'unmount' the file system? That's very easy, just check the output
110 of the 'Status' shell command. You might get the following output:
112 Process 1: Loaded as command: TURBOTEXT
113 Process 2: Loaded as command: Work:Tools/Blowup
114 Process 3: Loaded as command: Work:Tools/Sashimi
115 Process 4: Loaded as command: Work:CyberTools/CyberGuard
116 Process 5: Loaded as command: Work:Tools/OpenDevicePatch
117 Process 6: Loaded as command: CED
118 Process 7: Loaded as command: Workbench
119 Process 8: Loaded as command: Status
120 Process 9: No command loaded
121 Process 10: Loaded as command: SMBFS '//sourcery/all'
123 Look at the last line describing process number 10: it shows the name of the
124 file system program SMBFS and the name of the SMB share it is connected to. To
125 stop this file system and effectively unmount it, use the shell 'Break'
126 command; in this case you would enter "Break 10" to stop the file system. Note
127 that the program may not terminate immediately; it may have to wait until the
128 last client has released all resources referring to the file system. You may
129 have to send more than one "Break" command to stop the program.
134 The SMBFS program supports a number of command line options, as will be
135 described below. The command template looks like this:
137 DOMAIN=WORKGROUP/K,USER=USERNAME/K,PASSWORD/K,CHANGECASE/S,
138 CASE=CASESENSITIVE/S,OMITHIDDEN/S,QUIET/S,CLIENT=CLIENTNAME/K,
139 SERVER=SERVERNAME/K,DEVICE=DEVICENAME/K,VOLUME=VOLUMENAME/K,
140 CACHE=CACHESIZE/N/K,DEBUGLEVEL=DEBUG/N/K,TZ=TIMEZONEOFFSET/N/K,
141 DST=DSTOFFSET/N/K,TRANSLATE=TRANSLATIONFILE/K,SERVICE/A
143 The individual options serve the following purposes:
147 You must specify the name of the work group or domain which the file server
148 to connect to is a member of. The name of this workgroup or domain must not
149 be longer than 16 characters. The name you provide will be translated to
150 all upper case characters.
152 You need not provide for a work group or domain name on the command line.
153 Alternatively, you may configure an environment variable whose contents
154 will be used instead. The variable could be set up like this:
156 SetEnv smbfs_workgroup <name of domain or workgroup>
157 Copy ENV:smbfs_workgroup ENVARC:
159 You may also use the 'smbfs_domain' environment varilable in place of the
160 'smbfs_workgroup' variable. The two are aliases for one another, but
161 smbfs will read only one of the two.
165 To connect to an SMB share you must authenticate yourself by providing a
166 user name. With this program the user name is optional; if you do not
167 provide one, SMBFS will use the default, which is "GUEST". The user name
168 must not be longer than 64 characters. The name you provide will be
169 translated to all upper case characters.
171 You need not provide for a user name on the command line. Alternatively,
172 you may configure an environment variable whose contents will be used
173 instead. The variable could be set up like this:
175 SetEnv smbfs_username <your user name>
176 Copy ENV:smbfs_username ENVARC:
178 You may also use the 'smbfs_user' environment varilable in place of the
179 'smbfs_username' variable. The two are aliases for one another, but
180 smbfs will read only one of the two.
184 As part of the authentication process required to make the connection to
185 an SMB share, you must provide for a user name and a password. The
186 password is optional; if you do not provide one, an empty password will
187 be transmitted. The password must not be longer than 64 characters.
189 You need not provide for a password on the command line. Alternatively,
190 you may configure an environment variable whose contents will be used
191 instead. The variable could be set up like this:
193 SetEnv smbfs_password <your password>
194 Copy ENV:smbfs_password ENVARC:
196 Keep in mind that passwords like these really should not be exposed by
197 storing them in environment variables. But then the protocol smbfs uses
198 is almost as insecure as it gets anyway.
200 The authentication process only works if the machine you are connecting
201 to knows about the user name and password you want to use. As of this
202 writing, smbfs cannot be used for authenticating against a password
203 server that is not the same machine as the one from which you wish to
208 By default the password will not be changed to all upper case characters.
209 If this is required, you should either provide the password in this
210 form or resort to this option, which will cause it to be translated
211 to all upper case characters.
215 Some file servers treat file and directory names differently which
216 differ only in whether they are written using upper/lower case
217 characters. For these servers you should activate the CASESENSITIVE
218 switch to treat those files properly. There is a catch though: the
219 AmigaDOS file naming scheme does not follow this model and you may
220 run into problems when you are trying to use it. By default, the
221 file system does not treat file and directory names differently
222 which only differ with respect to the case of letters.
226 When requesting a directory listing, the server may return some files
227 and directories tagged as being hidden. By default this file system
228 will report these 'hidden' entries anyway, but you can request
229 specifically that what is intended to be hidden should be omitted
230 from directory listings, too. Note that even though a file may be
231 hidden you should still be able to open and examine it.
235 When started from Shell, SMBFS will print a message as soon as the
236 connection to the file server has been established. If you do not
237 want to see that message displayed, use the QUIET parameter. Also,
238 no such message will appear if the program has been started to run
243 SMBFS will attempt to connect to the file server by providing the name
244 of the computer you connect from. In some cases this may be undesirable
245 as the computer's name differs from what the file server expects. You
246 can use the CLIENT parameter to tell SMBFS under which name it should
247 announce itself to the server. This parameter is optional and will be
248 translated to all upper case characters; it cannot be longer than 16
253 SMBFS will attempt to connect to the file server by providing the name
254 you specified using the SERVICE command line parameter. In some cases
255 this may be undesirable as the server's name differs from what you
256 specified as the share name. You can use the SERVER parameter to tell
257 SMBFS under which name it should contact the server. This parameter is
258 optional and will be translated to all upper case characters; it cannot
259 be longer than 16 characters.
264 The SMBFS program can announce itself as an AmigaDOS file system by
265 using one of two different methods.
267 The first method involves announcing itself only as a file system
268 device. This should be sufficient in most cases but has a drawback in
269 that the device will not be usable from Workbench since the file system
270 will not appear as a disk icon. You tell SMBFS to use a specific device
271 name by using the DEVICE command line parameter, e.g. "DEVICE=SMBFS:".
272 Note that device names must be unique, i.e. there must be no other
273 device by the same name in the system; SMBFS will report an error and
274 exit if it finds one.
276 The second method involves announcing itself as a volume. This has the
277 benefit of making the file system usable from Workbench since a disk
278 icon will appear for it. You tell SMBFS to use a specific volume name by
279 using the VOLUME command line parameter, e.g. "VOLUME=Sourcery:".
281 Both methods have advantages and drawbacks. The drawback of the VOLUME
282 method is that it may deadlock the native Amiga Samba port as soon as
283 the file system is mounted. The drawback of the DEVICE method is that
284 the file system will not be usable from Workbench.
286 If you wish, you can combine both methods; this is the approach most
287 other file systems use. And in fact, when you tell SMBFS to add a
288 volume it will also add a device to go along with it.
290 The VOLUME and DEVICE keywords are optional; if you omit both, SMBFS
291 will pretend that you had used the "DEVICE=SMBFS:" parameter.
295 The file system attempts to optimize accesses to the file server when
296 directory contents are being scanned. These contents are buffered in
297 a directory cache which by default will hold 170 entries. Since each
298 entry will require about 255 bytes of storage, the entire 170 entry
299 cache will occupy more than 40K bytes of memory. You may want to change
300 this requirement, by making the cache smaller or larger using the
301 CACHESIZE parameter. The size of the directory cache cannot be smaller
306 By default SMBFS operates in silent mode. It does not report what it is
307 doing, it just tries to respond to file system requests. To obtain
308 debugging output you may want to use the DEBUG option and specify a
309 debug level greater than 0. The larger the number you specify the more
310 debugging output will be created. Note that all debugging output will be
311 produced using the operating system's debug output functionality which
312 requires that you have a capturing program like 'Sashimi' running in the
315 TZ=TIMEZONEOFFSET/N/K
317 By default the file system will use the current Locale settings to
318 translate between the local time and the time used by the SMB
319 server. For some configurations, however, this is impractical since
320 the server's time zone is not configured properly. For these
321 rare cases you may want to hard code a certain time zone offset
322 using the 'TIMEZONEOFFSET' options. The number you provide must
323 be the number of minutes to add to the local time in order to
324 translate it into the corresponding GMT value. For example, in
325 central Europe using CET, you would use "TZ=-60" since CET is
326 one hour ahead of GMT.
330 This option can be used to adjust the file date stamps to take
331 local daylight savings time into account. The number to specify here
332 is by how many minutes local time has been moved ahead, which is
333 typically 60. Note that smbfs does not know when daylight savings
334 time begins and ends. It is up to you to select the correct value
337 TRANSLATE=TRANSLATIONFILE/K
339 The Amiga and the file server SMBFS connects to may not share the same
340 character set. International characters used in file names on either
341 side may not come out correctly on the other side. To remedy this
342 problem, you can resort to file name translation. How the individual
343 names are to be translated is determined by the contents of a file
344 name translation table file such as the ones that ship with Workbench
345 in the "L:FileSystem_Trans" drawer. The first 256 bytes of each such
346 file must consist of the mapping of Amiga characters to the different
347 character set, and the second 256 characters must describe a mapping
348 back from the different character set to the Amiga. In most cases the
349 "L:FileSystem_Trans/INTL.crossdos" translation table file should be
350 sufficient. To specify which file contains the translation tables to
351 use you would use the TRANSLATIONFILE parameter.
355 This is the last parameter to be specified on the command line. It
356 should refer to the file server you want to connect to and the resource
357 it exports, e.g. a file system. This parameter must start with two
358 slashes which must be immediately followed by the file server's name,
359 which must be followed by the resource to connect to.
361 For now no special characters are allowed in the name of the service
362 as no translation is performed like would be the case for file names
365 The same parameters are also used when starting SMBFS from Workbench. SMBFS
366 will examine its icon tool types and use these in place of the shell command
372 The design of smbfs follows the original file system concept behind the
373 code which the 'Sharity-Light' file system is based upon. And that is a
374 Unix file system which differs from Amiga specific file systems in many
375 ways which can lead to problems which are discussed briefly below:
377 - Single threaded design
379 This means that it is not possible for several programs to fairly
380 share the use of the file system. For example, a program that posts
381 a long read request can tie up the file system almost exclusively
382 for itself, and while it is busy all other clients will have to
383 wait. Same goes for directory scanning.
387 This is associated with the single threaded design. When several
388 programs are accessing the file system at the same time, overhead
389 and unfair sharing of resources will drastically reduce the
390 performance of the file system.
392 - Separation of file data and metadata
394 This means that the core of the file system treats the contents of
395 a directory and the data attached to each file inside that
396 directory as something different. This is a common concept with
397 Unix file systems, but it is very different with Amiga file systems.
398 In smbfs this data separation can cause problems when deleting
399 files from a directory while that directory is being scanned,
400 such as how this is being done by the 'Delete' shell command. The
401 effects of these problems are that a directory may not be deleted
402 even though it is empty or that for the same directory the same
403 file may be reported twice in the listing.
405 While there are no easy solutions for any of these problems, it does not
406 mean that smbfs is unusable. You just have to be more careful when you
407 use the file system. For example, if a directory's contents cannot be
408 deleted due to one of the problems mentioned above, you might want to
411 It should be noted that the problems described above are not inherent
412 to the original file system design. It's just that transferring that
413 design to an Amiga file system created the problems.
418 This file system is based upon prior work by Paal-Kr. Engstad, Volker
419 Lendecke, Mark A. Shand, Donald J. Becker, Rick Sladkey, Fred N. van Kempen,
420 Eric Kasten and Rudolf Koenig. It is a direct descendant of the
421 'Sharity-Light' file system written by Christian Starkjohann.
423 The password encryption code was lifted from the Samba package. It was
424 written by Andrew Tridgell and the Samba Team.
429 The 'Sharity-Light' source code was adapted and wrapped into an AmigaOS layer
430 by Olaf `Olsen' Barthel. If you wish to contact me, please send e-mail to the
433 obarthel -at- gmx -dot- net
435 Or, alternatively, you might want to contact me via my postal address:
440 Federal Republic of Germany
442 If you want to submit a bug report or an enhancement request, please enclose
443 sufficient information to allow me to make sense of the problem. That includes
444 debugging logs produced using the DEBUG option. If possible, use the
445 facilities for bug reporting and tracking on the sourceforge.net web site
446 at <http://sourceforge.net/projects/amiga-smbfs>, which is the new home for
452 SMBFS is distributed under the terms of the GNU General Public License
453 (version 2). The source code should have accompanied this program; if it
454 hasn't, please contact the author for a copy.
456 The program was compiled using the SAS/C 6.58 compiler, with the Roadshow SDK
457 providing for the TCP/IP stack API header files.