-*- Indented-Text -*-

This is ALPHA code, known not to work completely. Expecially, I know
that copying to a file on a smbmount-mounted file system doesn't work.
The problem has something to do with the fact that the UNIX kernel
first creates the file, then tries to read the last (not completely
filled) block of the file, then starts writing the blocks.

Unfortunately I haven't lately been able to put any time into this at
all. I hope somebody will have the time to make it work better...
Please send patches back to me. If somebody wants to "adopt" this code
totally, contact me.

Smbmount is program that mounts itself as a user-mode NFS server, and
translates NFS requests from user processes (coming in via the local
kernel) into SMB calls to an SMB server (Lan Manager, Windows NT,
WfWG, etc).

I wouldn't have been able to write this without looking at, and
copying parts of:

  - The "unfsd" user-level NFS daemon, by Mark Shand, posted to
    comp.sources.unix Volume 15 Issues 1 and 2 in May 88.

  - The 4.3BSD Net2 "mount.c" program.

  - smbclient in Samba.

  - afpmount, a corresponding program for AFP (AppleTalk Filing
    Protocol) I wrote a couple of years ago.

Installing should be obvious, ie:

* unpack the archive

* edit Makefile as needed

* make depend, if you have makedepend

* make

I have compiled and run it on HP-UX 9.01. It should work on most
systems having "normal" NFS implementations, but you will have to
tweak the details of how to mount a NFS file system a bit. Look in
smbmount.c for the MOUNT_SYSCALL, UMOUNT_SYSCALL and NFS_MOUNT_TYPE
#defines. Please send me any bug fixes, enhancements, and changes
necessary to build and run it on other systems (context diffs). If
possible, don't use "#ifdef sun" etc, but use more specific
identifiers to pinpoint what feature needs the ifdef (#ifdef
HAVE_SOMETHING, #ifdef NEED_SOMETHING). I am not going to apply
patches that sprinkle the code with ifdefs just to change strchr to
index, memcpy to bcopy etc. Instead, if your system really don't have
the ANSI C functions in any library, get them.

Afpmount was written to compile both with K&R and ANSI C using
prototypes on the latter. As a consequence, smbmount also for many
functions has parameter defs in both styles. However, I guess by now
it's OK to write just pure ANSI code (like Samba), and I could rip out
the K&R stuff.

Cheers,

tml@hemuli.tte.vtt.fi

Tor Lillqvist
Technical Research Centre of Finland
Information Technology
