| 1 | Note: All files in this directory are DOS formatted (CRLF line terminator). | 
|---|
| 2 |  | 
|---|
| 3 | !!! VIRUS WARNING !!! I do not know if VALIDCHR.COM is virus free !!! | 
|---|
| 4 | I think that my system is virus free here because I do not run any games | 
|---|
| 5 | or other copied software. I only run Shareware/Freeware etc. from CD-ROMs | 
|---|
| 6 | or from registered disks, however I do not use viral scanners because | 
|---|
| 7 | I have not registered any (I consider `having no sex' is better than | 
|---|
| 8 | `testing for AIDS on a regular basis', if you know what I mean). | 
|---|
| 9 |  | 
|---|
| 10 | This is VALIDCHR, a little DOS program I wrote to create | 
|---|
| 11 | an apropriate `valid chars =' config parameter. | 
|---|
| 12 | It is freeware and is thought to be distributed freely with Samba. | 
|---|
| 13 |  | 
|---|
| 14 | WARNING: | 
|---|
| 15 | Your SMB driver may use another character map as the one VALIDCHR | 
|---|
| 16 | sees. The only way you can tell this is that some file names fail. | 
|---|
| 17 | Under Win95 everything is fine, though. | 
|---|
| 18 |  | 
|---|
| 19 | Usage: | 
|---|
| 20 | c: | 
|---|
| 21 | mkdir junk_dir | 
|---|
| 22 | cd junk_dir | 
|---|
| 23 | a:validchr > a:output.log | 
|---|
| 24 | cd .. | 
|---|
| 25 | rmdir junk_dir | 
|---|
| 26 |  | 
|---|
| 27 | Siedeffects: | 
|---|
| 28 | Files named *.TST may be deleted. | 
|---|
| 29 |  | 
|---|
| 30 | Verification: | 
|---|
| 31 | For diagnostic purpose you can run VALIDCHR on a Samba mounted drive. | 
|---|
| 32 | Then you can use unix diff to compare the output of the network and | 
|---|
| 33 | the hard drive. These two outputs usually differ! However there | 
|---|
| 34 | should be few differences. I get following on Win95 (c: visa e:) | 
|---|
| 35 | 104c104 | 
|---|
| 36 | < 152: length 0 | 
|---|
| 37 | --- | 
|---|
| 38 | > 152: 95 | 
|---|
| 39 | (diff line for `valid chars =' deleted because it's uninteresting) | 
|---|
| 40 | You can see, `y diaresis' can be mapped on the network drive while | 
|---|
| 41 | it cannot be mapped on the hard drive. Everything else is identical. | 
|---|
| 42 | However this gives a hint that one can improve the mapping. | 
|---|
| 43 |  | 
|---|
| 44 | Bugs: | 
|---|
| 45 | Yes, probably some. | 
|---|
| 46 |  | 
|---|
| 47 |  | 
|---|
| 48 | VALIDCHR must be run on the system which character mapping should be probed. | 
|---|
| 49 | It must be run on the hard drive for this. VALIDCHR ALTERS THE CURRENT | 
|---|
| 50 | DIRECTORY AND REMOVES SOME FILES, SO ALWAYS RUN IT IN A junk DIRECTORY !!! | 
|---|
| 51 | You should redirect the output of VALIDCHR. At the end of the output is a | 
|---|
| 52 | line like | 
|---|
| 53 | valid chars = x:y y:x x:x ... a:b c ... | 
|---|
| 54 | which is suitable for your smb.conf file. (you should remove the DOS CR | 
|---|
| 55 | character, because DOS uses CRLF while Unix uses LF only.) | 
|---|
| 56 |  | 
|---|
| 57 | Note that some mappings at the beginning of the `valid chars =' line like | 
|---|
| 58 | A:B B:A B:B | 
|---|
| 59 | might look a little bit strange to you, however sometimes character A | 
|---|
| 60 | has to be mapped to character B independently of a default mapping | 
|---|
| 61 | to uppercase or lowercase while character B must not be touched. I found | 
|---|
| 62 | this out the hard way ... Consider it a crude workaround, because Samba | 
|---|
| 63 | lacks the possibility to map characters in one direction only! | 
|---|
| 64 |  | 
|---|
| 65 | VALIDCHR usually issues one warning for character 32. | 
|---|
| 66 | You may ignore these and any other warnings. | 
|---|
| 67 |  | 
|---|
| 68 | VALIDCHR does not test for character NUL (this is the directory end marker). | 
|---|
| 69 |  | 
|---|
| 70 | validchr.c is the source code to validchr.com | 
|---|
| 71 | You may do anything with the source code (copy, change, sell, burn) | 
|---|
| 72 | validchr.com is a Borland C compiled binary. | 
|---|
| 73 | Beware, it may contain a virus (if my system contains one). | 
|---|
| 74 | nwdos70.out is the output of an VALIDCHR-run under Novell DOS 7.0 | 
|---|
| 75 | while no codepage (no display.sys) was active. | 
|---|
| 76 | msdos70.out is the output of an VALIDCHR-run under MS-DOS 7.0 (Win95 DOS) | 
|---|
| 77 | while codepage 850 was active. | 
|---|
| 78 |  | 
|---|
| 79 | I have no other MS-DOS systems at home currently. | 
|---|
| 80 | (I have access to MS-DOS 3.0, 3.2, 3.3, 5.0 and 6.22, however I have no time | 
|---|
| 81 | to run VALIDCHR there) | 
|---|
| 82 |  | 
|---|
| 83 | Some words to the output | 
|---|
| 84 | (for people not fammiliar with programming language C): | 
|---|
| 85 |  | 
|---|
| 86 | probed_char:    [text] mapped_char | 
|---|
| 87 |  | 
|---|
| 88 | probed_char     is the character probed to be written to disk | 
|---|
| 89 | text            may be empty or contain: | 
|---|
| 90 | open    File could not be opened. | 
|---|
| 91 | close   File could not be closed (should not happen) | 
|---|
| 92 | length  File name was shortened (usually occurs on SPC) | 
|---|
| 93 | unlink  File cannot be unlinked (usually when open fails) | 
|---|
| 94 | mapped_char     is the character which is used by MS-DOS in the directory | 
|---|
| 95 | This is usually the uppercase character. | 
|---|
| 96 | The mapped character is 0 if something failed (you may say | 
|---|
| 97 | that the character is not supported) | 
|---|
| 98 |  | 
|---|
| 99 | The last line in the output is documented in the smb.conf manual page ;) | 
|---|
| 100 |  | 
|---|
| 101 | tino@augsburg.net | 
|---|