SAMBA V2.0.6-VMS0 for OpenVMS	 (VAX and Alpha)	04-Jun-2000

	Ported by John Malmberg <wb8tyw@qsl.net>

	based as an extension of previous ports by
	Eckart Meyer <meyer@ifn.ing.tu-bs.de>

	This is the V2.0.6-VMS0 release of Samba for VMS.

	Samba 2.0.6 for VMS should compile with DEC-C V6.0 and later,
	and possibly earlier versions.

	I expect that should run on all VMS systems from V5.5-2 on
	(VAX and Alpha).  Testing has been limited so far to OpenVMS Alpha 7.2.

	For the current status see:

	ftp://ftp.qsl.net/pub/wb8tyw/

========================= CAUTION =======================
This is the second release of Samba V2. The VMS port has
been almost startet from scratch again. Thus it may contain
new bugs... Using of this release for production systems
is not recommended.
=========================================================

========================= CAUTION 2 =============================
This port was done mostly independent of the previous 2.0.3 port
So it does not currently have feature parity.  Some 2.0.3 specific
options do not work.

However this release is basically feature and bug compatible with
the UNIX SAMBA 2.0.6 code.

I have only done testing with COMPAQ's TCPIP product, so the notes
on using Process Technology's TCP/IP stack are copied from the
2.0.3 release notes.
==================================================================
STATUS

	Supports UCX or UCX emulation of other TCP/IP packages.
	Tested with UCX. MultiNet, TCPware and Pathway are supported in command
	procedures. CMU/IP does not have UCX emulation and is therefor
	not supported.

	Developed on Alpha VMS V7.2 with DEC-C V6.0.

	Compiled on VAX VMS V 7.2 with DEC-C V6.0

	This release of Samba V2 the compiled objects will are linked against
	the FRONTPORT C runtime library shared image.  It is maintained as a
	separate distribution kit.

	The FRONTPORT C runtime library shared image can be used with the
	DEC C backport library or the DEC C shared image.  This is documented
	with the FRONTPORT C library documentation.

	While the AACRTL060 library is probably no longer needed on VMS 5.5-2
	I would still recommend using it.

	Samba for VMS can be downloaded in two flavours: The binary kit
	and the full source kit.

	Binary means object libraries, so they can be linked to the
	target system libraries (e.g. LIBRTL, LIBOTS).

USING BINARY DISTRIBUTION

	At this time, I can only provide binaries that have been tested on
	OpenVMS Alpha 7.2 and VAX 7.1 / 7.2.

	Using earlier versions may require building from sources.

	Executables are not provided, only the objects. Extract the archive
	to a temporary directory.

	$ @LINK_SAMBA_VMS

	Proceed with ...

INSTALLATION

	What /usr/local/samba is for UNIX, that's the logical SAMBA_ROOT
	in VMS. The value of this logical will be asked in

	$ @INSTALL_SAMBA

	(@[.VMS]INSTALL for the source distribution)

	and then all neccesary files will be copied to that directory tree.
	The source directory may be removed then.

	Edit SAMBA_ROOT:[LIB]SMB.CONF to your needs.
	Note that all paths must be written in UNIX syntax, i.e.
	DUA0:[MY.DIRECTORY]MY.FILE becomes /dua0/my/directory/my.file.

	NMBD is started by SAMBA_ROOT:[BIN]NMBD_STARTUP.COM. You may
	change some options.

	Broadcast address and net mask are now correctly determined.

	Note that uppercase options must be enclosed in quotes! The
	C runtime library will convert parameters to lowercase if no
	quotes are present.

	If you don't already have a time zone logical SYS$TIME_ZONERULE
	(or POSIX$DEFAULT_TZ), you must do so now. See the file
	TIME_ZONERULE.TXT for the format of that logical. Add the definition
	of the logical to SYS$MANAGER:SYSTARTUP_VMS.COM
	(or SYS$MANAGER:SYSTARTUP_V5.COM for older VMS versions).

	A file SYS$STARTUP:SAMBA_STARTUP.COM is generated. Executing this
	file defines the logical SAMBA_ROOT, starts the NMBD process and
	setup SMBD as an UCX service. Also, a logical SAMBA_EXE is defined
	to point to both, the architecture dependent directory and to
	the common directory. The procedure should be included
	in SYS$MANAGER:SYSTARTUP_VMS.COM (or SYS$MANAGER:SYSTARTUP_V5.COM
	for older VMS versions).

	With this release SMBD is no longer linked against the system
	symbol table.  That is handled by the FRONTPORT library.  The
	installation for the FRONTPORT library makes sure that the executable
	is relinked automatically when the version of OpenVMS is upgraded.


MULTINET SUPPORT (Copied from previous versions)

	Samba seemed to work fine on a MultiNet V4.0 Rev A system.
	It is expected to work ok on a V3.5 Rev A or Rev B
	system; not necessarily on earlier MultiNet versions.

	No source changes are required for MultiNet support. The
	command procedures will automatically detect a MultiNet system.

	Make sure that UCX emulation is enabled:

	$ SHOW LOGICAL/SYSTEM UCX$DEVICE
		"UCX$DEVICE" = "BG:" (LNM$SYSTEM_TABLE)

	If this logical is not defined, then enable UCX emulation:

	$ MULTINET CONFIGURE
	NET-CONFIG> SET LOAD-UCX-DRIVER TRUE
	NET-CONFIG> EXIT
	(reboot)

	If you have questions on MultiNet, please ask Aaron Leonard
	of TGV <aaron@tgv.com>.

TCPWARE SUPPORT

	No source changes are required for TCPware support. The
	command procedures will automatically detect a TCPware system.

	If you have questions on TCPware, please ask Bernie Volz of
	Process Software Corporation <VOLZ@PROCESS.COM>.

PATHWAY SUPPORT

	No source changes are required for Pathway support. The
	command procedures will automatically detect a Pathway system
	(this package was formerly known as "Wollongong TCP/IP").

	If you have questions on Pathway, please ask Charles Don Hall of
	Attachmate <chall@eco.twg.com>.

USING THE CLIENT PROGRAMS

	SMBCLIENT	- Seems to work ok. Ignore some error messages
			  concerning "ioctl" for now...

	NMBLOOKUP	- Since it will send broadcast messages to the net,
			  this program must be installed with privileges if
			  unprivileged user should use it.

	SMBSTATUS	- shows a hexadecimal UID which is the complete
			  32-bit VMS UIC. The GID is the VMS UIC group number.
			  If an identifier exists for the UIC, the identifier
			  name is displayed instead.

	SMBPASSWD	- Works

	SWAT		- Untested.

	You may want to define some global symbol like

	SMBCL*IENT :== $SAMBA_EXE:SMBCLIENT

BUILDING FROM SOURCES  (Will need to be rewritten.)

	There are two source trees.  The first is the unmodified UNIX code as
	distributed.  The second is the VMS specific patches.

	Extract the files to an empty directory tree and go to the
	SOURCE directory. Now extract the Samba C RTL from
	SAMBA-CRTL-nnn_arch.ZIP into that directory. Then type

	$MMS/DESCRIP=SAMBA

	or

	$MMK/DESCRIP=SAMBA

	Since MMK is freeware from MadGoat Software and available on the VMS
	Freeware CD-ROM and other locations, no DCL based compile and link
	procedures will be maintained.

COMPILE AND LINK WITH MMS/MMK

	Extract the files to an empty directory tree and go to the
	SOURCE directory. Now extract the Samba C RTL from
	SAMBA-CRTL-nnn_arch.ZIP into that directory.

	If MMS or MMK is present (I have MMK, MMS is not tested):

	$ @[.VMS]SETUP		! Must be called once at the beginning
	$ MMS

	MMS/MMK can be used to build only part of the package
	(e.g. MMS SMBD) or changed modules. Object modules must be
	specified as module.OBJ_arch (arch = VAX or ALPHA).


WHY SAMBA FOR VMS
[This chapter is now more than 3 years old. It may not reflect current status]

	There is Digital's Pathworks. It's not that expensive.
	Cost was not the reason to get SAMBA on VMS.
	In short, SAMBA has what is missing in Pathworks for VMS
	V4 and it is easier to handle than Pathworks for VMS
	V5. So it's somewhere between V4 and V5.

	Meanwhile Pathworks for VMS V6 has been released. I haven't seen
	it so far and thus don't know it's advantages and disadvantages.

	Advantages of SAMBA over Pathworks V4:

	- Implements LANmanager V2.
	- Long filenames for Win95 and WinNT.
	- Same LANmanager implementation on all hosts in a mixed environment.
	- Public domain, no license cost.

	Advantages of SAMBA over Pathworks V5:

	- Uses VMS security instead of it's own like PW5.
	- Less resources (well, if lots of clients are connected,
	  SAMBA creates lots of processes...).
	- Easier to manage.
	- Same LANmanager implementation on all hosts in a mixed environment.
	- No license cost.

	Advantages of SAMBA over Pathworks V6:

	- Pathworks V6 will (as far as I know)
	  support *only* Alpha VMS V7.1 in the first place. There
	  will be one last VAX version later.

	Disadvantages:

	- May be slower (not really tested until now).
	- TCP/IP only. No DECnet, no NETBEUI.
	- Can't be primary domain controller (but will be later...)
	- No guarranteed support.
	- I'm sure, there are more...

PROCESSES and SECURITY

	SAMBA generally creates one process per SMB session. In VMS the process
	is created by the auxilliary server of the TCP/IP package (so called
	in UCX, this may differ for other packages - it's the same
	mechanism than UNIX' inetd). Each session can handle many
	connections and each connection can be established for another
	user (only if samba's security setting is not 'user'). The process
	"becomes" the process of the actual user by changing it's own
	username, UIC, privilege mask and identifiers for the time of
	the access (when idle, the process belongs to SYSTEM). This way
	the process has exactly the rights of the connected user. If a service
	allows for public access, the guest account may be used. The process
	name is changed to reflect the (netbios-) name of the connecting client.

	Generally SAMBA always uses the host's security mechanisms. SAMBA
	does not implement it's own security checking.

PARAMETERS

	Some recommendation for parameters:

	printcap name = /sys$manager/ucx$printcap.dat

		For UCX it's printcap file is o.k. For other
		TCP/IP packages I don't know. If it not present,
		create one (see smb.conf).

	print command = print %f/queue=%p/delete/passall/name="""""%f"""""

		Use VMS DCL PRINT command. Note that you must use "%f"
		as the file name, %s has UNIX file spec syntax.

	[Change this, it does not work]
	lprm command = delete/entry=%j

		You may also specify a command procedure to also delete the
		temp file.

	lpq command

		is ignored. Samba for VMS obtains queue information
		directly using the $GETQUI system service.

	smbrun = smbrun

		When using the supplied SMBD_STARTUP.COM this parameter
		must be specified exactly as stated here. Samba uses
		the string for testing the existance of a file and then
		to run it. For VMS, we define the string as a logical
		pointing to the file and as a symbol which runs that file.

	read prediction = yes

		Transfer from server is slightly faster for stream and
		fixed files. For variable record files this may slow down
		the transfer since the "prediction read" reads from
		1024 byte boundaries which causes seek calls. The seek
		routine for record files will have to rewind and re-read
		the files.

	socket options = TCP_NODELAY

		If it is really used by UCX there seem no difference.

	read raw = yes

		Is 'yes' by default. Setting to 'no' slows down
		the transfer.

LOGICALS

	Some VMS specific parameters can be set with systemwide logical
	names. These logicals are normally set in SYS$STARTUP:SAMBA_STARTUP.COM
	(this file is created when @INSTALL is executed).

	SAMBA_SWAP_FILE_TIMES

		If present, swap VMS Creation Time and VMS Modification Time
		when presenting them to the client.

	SAMBA_ALTERNATE_DIRECTORY_PROTECTION

		If present, ignore VMS directory protection policy and
		unconditionally use samba specific settings from SMB.CONF
		This allows directories created with Delete-bit set.

	SAMBA_FILESPEC_ENCODE

		Controls encoding of file specification:

		0 or CHECK	- no encoding if EFS is present (ODS5)
				  not possible on VAX or VMS before V7.2
				  default on Alpha
		1 or ALWAYS	- always use encoding
				  default on VAX
		2 or NEVER	- never use encoding (disks must be ODS5)

	SAMBA_CASE_ENCODE

		If present, case is encoded in the filespec so that it is
		preserved as seen by the client.

	SAMBA_SMBD_OPTIONS

		Option to any SMBD process (in UNIX format, so enclose in
		double quotes).

FILE FORMATS - Also needs rewriting.

	Files sent to VMS will always have STREAM format (except for
	print files).

	When reading files from VMS:

	Variable Record, implied carriage return (standard VMS text file):

		The file is read record by record and a CR/LF pair is
		appended. The file appears correctly as a text file at
		the client and is padded with CTRL/Z at the end to fill the file
		up to the size reported by VMS (a VAR file is always
		bigger or same size than a Stream file). When using this
		format, performance may be poor since file seek operations
		may cause the file to be read from the beginning.

	For all other formats the file contents is sent unchanged:

	Stream:

		Client's "native" format. Valid for all types of files.
		Textfiles have a CR/LF pair as line terminator.
		The file's size will be reported correctly.

	Stream_Linefeed:

		The UNIX format. Binary files will appear correctly.
		On text files, each line is terminated by only one LF.
		Some programs may work, other may not (e.g. Windows' notepad).

	Fixed:

		Since the file does not contain any format information, this
		file format should be o.k. for binary files.

	Other formats:

		These are VMS specific and does not make much sense
		at the client.

	Print files are created fixed length record, 512 bytes, null padded.
	This is the only format the symbiont can use for ASCII-Text,
	PostScript and binary (e.g.P PCL). It simply means RAW format.
	Always specify /passall in the print command in smb.conf. This
	means, formatting of ASCII-Text files does not work (but who wants
	to print simple ASCII text today ;-)

FILE NAMES

	File names which contain characters not possible for VMS are converted
	using the same scheme that Digital's Pathworks uses: The character
	is converted to two underlines followed by the two character
	hex ascii code (this means that non-ASCII letters like german
	umlauts are NOT converted to lowercase).

	If the VMS disk uses the ODS5 file system, encoding is not needed.
	See logicals names.

PRINT QUEUES

	This version of SAMBA follows the UNIX code for spawning a subprocess
	to execute print commands.  Work is currently being done in the main
	UNIX distribution to make it more like NT.

	It is not as efficient as previous versions of SAMBA-VMS but it does
	allow users to customize the command files for special items like
	TCP/IP relay queues.


BUGS
	ODS-5 and Case Preserving are not currently implemented in the
	FRONTPORT library.


	Probably still many unknown bugs...

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            