summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-10-03 12:18:20 +0000
committerAndrew Tridgell <tridge@samba.org>2001-10-03 12:18:20 +0000
commit9bcd133e9e7b0cfe974f273fb23409d660af8358 (patch)
treeaed9e919a60602c2a7d9826038a990e51be949cf /source3/torture
parent5b24e783dd60b01e2cef1e47cc4b181e7cf2bc38 (diff)
downloadsamba-9bcd133e9e7b0cfe974f273fb23409d660af8358.tar.gz
samba-9bcd133e9e7b0cfe974f273fb23409d660af8358.tar.bz2
samba-9bcd133e9e7b0cfe974f273fb23409d660af8358.zip
switched over to a new method of handling uppercase/lowercase mappings
for unicode strings. The new method relies on 3 files that are mmap'd at startup to provide the mapping tables. The upcase.dat and lowcase.dat tables should be the same on all systems. The valid.dat table says what characters are valid in 8.3 names, and differs between systems. I'm committing the japanese valid.dat here, in future we need some way of automatically installing and choosing a appropriate table. This commit also adds my mini tdb based gettext replacement in intl/lang_tdb.c. I have not enabled this yet and have not removed the old gettext code as the new code is still being looked at by Monyo. Right now the code assumes that the upcase.dat, lowcase.dat and valid.dat files are installed in the Samba lib directory. That is not a good choice, but I'll leave them there until we work out the new install directory structure for Samba 3.0. simo - please look at the isvalid_w() function and think about using it in your new mangling code. That should be the final step to correctly passing the chargen test code from monyo. (This used to be commit 1c221994f118dd542a158b2db51e07d04d0e9314)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/utable.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/torture/utable.c b/source3/torture/utable.c
index daf9bd49d6..fb262f91b5 100644
--- a/source3/torture/utable.c
+++ b/source3/torture/utable.c
@@ -29,8 +29,9 @@ BOOL torture_utable(int dummy)
fstring fname, alt_name;
int fnum;
smb_ucs2_t c2;
- int c, len;
+ int c, len, fd;
int chars_allowed=0, alt_allowed=0;
+ uint8 valid[0x10000];
printf("starting utable\n");
@@ -38,7 +39,10 @@ BOOL torture_utable(int dummy)
return False;
}
+ memset(valid, 0, sizeof(valid));
+
cli_mkdir(&cli, "\\utable");
+ cli_unlink(&cli, "\\utable\\*");
for (c=1; c < 0x10000; c++) {
char *p;
@@ -62,6 +66,7 @@ BOOL torture_utable(int dummy)
if (strncmp(alt_name, "X_A_L", 5) != 0) {
alt_allowed++;
+ valid[c] = 1;
/* d_printf("fname=[%s] alt_name=[%s]\n", fname, alt_name); */
}
@@ -78,6 +83,15 @@ BOOL torture_utable(int dummy)
d_printf("%d chars allowed %d alt chars allowed\n", chars_allowed, alt_allowed);
+ fd = open("valid.dat", O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ if (fd == -1) {
+ d_printf("Failed to create valid.dat - %s", strerror(errno));
+ return False;
+ }
+ write(fd, valid, 0x10000);
+ close(fd);
+ d_printf("wrote valid.dat\n");
+
return True;
}
@@ -122,7 +136,9 @@ BOOL torture_casetable(int dummy)
for (c=1; c < 0x10000; c++) {
size_t size;
- if (c == '.') continue;
+ if (c == '.' || c == '\\') continue;
+
+ printf("%04x\n", c);
fname = form_name(c);
fnum = cli_nt_create_full(&cli, fname,