Note: All files in this directory are DOS formatted (CRLF line terminator).

!!! VIRUS WARNING !!! I do not know if VALIDCHR.COM is virus free !!!
I think that my system is virus free here because I do not run any games
or other copied software. I only run Shareware/Freeware etc. from CD-ROMs
or from registered disks, however I do not use viral scanners because
I have not registered any (I consider `having no sex' is better than
`testing for AIDS on a regular basis', if you know what I mean).

This is VALIDCHR, a little DOS program I wrote to create
an apropriate `valid chars =' config parameter.
It is freeware and is thought to be distributed freely with Samba.

WARNING:
	Your SMB driver may use another character map as the one VALIDCHR
	sees. The only way you can tell this is that some file names fail.
	Under Win95 everything is fine, though.

Usage:
	c:
	mkdir junk_dir
	cd junk_dir
	a:validchr > a:output.log
	cd ..
	rmdir junk_dir

Siedeffects:
	Files named *.TST may be deleted.

Verification:
	For diagnostic purpose you can run VALIDCHR on a Samba mounted drive.
	Then you can use unix diff to compare the output of the network and
	the hard drive. These two outputs usually differ! However there
	should be few differences. I get following on Win95 (c: visa e:)
	104c104
	< 152: length 0
	---
	> 152: 95
	(diff line for `valid chars =' deleted because it's uninteresting)
	You can see, `y diaresis' can be mapped on the network drive while
	it cannot be mapped on the hard drive. Everything else is identical.
	However this gives a hint that one can improve the mapping.

Bugs:
	Yes, probably some.


VALIDCHR must be run on the system which character mapping should be probed.
It must be run on the hard drive for this. VALIDCHR ALTERS THE CURRENT
DIRECTORY AND REMOVES SOME FILES, SO ALWAYS RUN IT IN A junk DIRECTORY !!!
You should redirect the output of VALIDCHR. At the end of the output is a
line like
   valid chars = x:y y:x x:x ... a:b c ...
which is suitable for your smb.conf file. (you should remove the DOS CR
character, because DOS uses CRLF while Unix uses LF only.)

Note that some mappings at the beginning of the `valid chars =' line like
A:B B:A B:B
might look a little bit strange to you, however sometimes character A
has to be mapped to character B independently of a default mapping
to uppercase or lowercase while character B must not be touched. I found
this out the hard way ... Consider it a crude workaround, because Samba
lacks the possibility to map characters in one direction only!

VALIDCHR usually issues one warning for character 32.
You may ignore these and any other warnings.

VALIDCHR does not test for character NUL (this is the directory end marker).

validchr.c is the source code to validchr.com
	You may do anything with the source code (copy, change, sell, burn)
validchr.com is a Borland C compiled binary.
	Beware, it may contain a virus (if my system contains one).
nwdos70.out is the output of an VALIDCHR-run under Novell DOS 7.0
	while no codepage (no display.sys) was active.
msdos70.out is the output of an VALIDCHR-run under MS-DOS 7.0 (Win95 DOS)
	while codepage 850 was active.

I have no other MS-DOS systems at home currently.
(I have access to MS-DOS 3.0, 3.2, 3.3, 5.0 and 6.22, however I have no time
 to run VALIDCHR there)

Some words to the output
(for people not fammiliar with programming language C):

probed_char:	[text] mapped_char

probed_char	is the character probed to be written to disk
text		may be empty or contain:
		open	File could not be opened.
		close	File could not be closed (should not happen)
		length	File name was shortened (usually occurs on SPC) 
		unlink	File cannot be unlinked (usually when open fails)
mapped_char	is the character which is used by MS-DOS in the directory
		This is usually the uppercase character.
		The mapped character is 0 if something failed (you may say
		that the character is not supported)

The last line in the output is documented in the smb.conf manual page ;)

tino@augsburg.net
