From 47dfe299c8a5a64ade88d15ecf71f99800ea40cd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 26 Mar 2004 02:39:48 +0000 Subject: - moved some of the base tests into torture/basic/ - added a CHARSET set of tests, which determines how the server deals with some specific charset issues related to UTF-16 support. Interestingly, Samba3 already passes all but one of these tests, because our incorrect UCS-2 and UTF-8 implementations where we don't check the validity of characters actually matches what Windows does! This means that adding UTF-16 support to Samba is going to be _much_ easier than we expected. (This used to be commit c8497a42364d186f08102224d5062d176ee81f5b) --- source4/torture/basic/utable.c | 199 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 source4/torture/basic/utable.c (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c new file mode 100644 index 0000000000..ec37edab82 --- /dev/null +++ b/source4/torture/basic/utable.c @@ -0,0 +1,199 @@ +/* + Unix SMB/CIFS implementation. + SMB torture tester - unicode table dumper + Copyright (C) Andrew Tridgell 2001 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +BOOL torture_utable(int dummy) +{ + struct cli_state *cli; + fstring fname; + const char *alt_name; + int fnum; + smb_ucs2_t c2; + int c, len, fd; + int chars_allowed=0, alt_allowed=0; + uint8 valid[0x10000]; + + printf("starting utable\n"); + + printf("Generating valid character table\n"); + + if (!torture_open_connection(&cli)) { + return False; + } + + memset(valid, 0, sizeof(valid)); + + cli_mkdir(cli->tree, "\\utable"); + cli_unlink(cli->tree, "\\utable\\*"); + + for (c=1; c < 0x10000; c++) { + char *p; + + SSVAL(&c2, 0, c); + fstrcpy(fname, "\\utable\\x"); + p = fname+strlen(fname); + len = convert_string(CH_UCS2, CH_UNIX, + &c2, 2, + p, sizeof(fname)-strlen(fname)); + p[len] = 0; + fstrcat(fname,"_a_long_extension"); + + fnum = cli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC, + DENY_NONE); + if (fnum == -1) continue; + + chars_allowed++; + + cli_qpathinfo_alt_name(cli->tree, fname, &alt_name); + + 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); + } + + cli_close(cli->tree, fnum); + cli_unlink(cli->tree, fname); + + if (c % 100 == 0) { + printf("%d (%d/%d)\r", c, chars_allowed, alt_allowed); + } + } + printf("%d (%d/%d)\n", c, chars_allowed, alt_allowed); + + cli_rmdir(cli->tree, "\\utable"); + + 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; +} + + +static char *form_name(int c) +{ + static fstring fname; + smb_ucs2_t c2; + char *p; + int len; + + fstrcpy(fname, "\\utable\\"); + p = fname+strlen(fname); + SSVAL(&c2, 0, c); + + len = convert_string(CH_UCS2, CH_UNIX, + &c2, 2, + p, sizeof(fname)-strlen(fname)); + p[len] = 0; + return fname; +} + +BOOL torture_casetable(int dummy) +{ + static struct cli_state *cli; + char *fname; + int fnum; + int c, i; +#define MAX_EQUIVALENCE 8 + smb_ucs2_t equiv[0x10000][MAX_EQUIVALENCE]; + printf("starting casetable\n"); + + if (!torture_open_connection(&cli)) { + return False; + } + + printf("Determining upper/lower case table\n"); + + memset(equiv, 0, sizeof(equiv)); + + cli_deltree(cli->tree, "\\utable"); + if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, "\\utable"))) { + printf("Failed to create utable directory!\n"); + return False; + } + + for (c=1; c < 0x10000; c++) { + size_t size; + + if (c == '.' || c == '\\') continue; + + d_printf("%04x (%c)\n", c, isprint(c)?c:'.'); + + fname = form_name(c); + fnum = cli_nt_create_full(cli->tree, fname, 0, +#if 0 + SEC_RIGHT_MAXIMUM_ALLOWED, +#else + GENERIC_RIGHTS_FILE_ALL_ACCESS, +#endif + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_NONE, + NTCREATEX_DISP_OPEN_IF, 0, 0); + + if (fnum == -1) { + printf("Failed to create file with char %04x\n", c); + continue; + } + + size = 0; + + if (NT_STATUS_IS_ERR(cli_qfileinfo(cli->tree, fnum, NULL, &size, + NULL, NULL, NULL, NULL, NULL))) continue; + + if (size > 0) { + /* found a character equivalence! */ + int c2[MAX_EQUIVALENCE]; + + if (size/sizeof(int) >= MAX_EQUIVALENCE) { + printf("too many chars match?? size=%d c=0x%04x\n", + size, c); + cli_close(cli->tree, fnum); + return False; + } + + cli_read(cli->tree, fnum, (char *)c2, 0, size); + printf("%04x: ", c); + equiv[c][0] = c; + for (i=0; itree, fnum, 0, (char *)&c, size, sizeof(c)); + cli_close(cli->tree, fnum); + } + + cli_unlink(cli->tree, "\\utable\\*"); + cli_rmdir(cli->tree, "\\utable"); + + return True; +} -- cgit From fcd718c7d8a6850ae8719f23ed044b06b57501cd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 25 May 2004 17:50:17 +0000 Subject: r890: convert samba4 to use [u]int8_t instead of [u]int8 metze (This used to be commit 2986c5f08c8f0c26a2ea7b6ce20aae025183109f) --- source4/torture/basic/utable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index ec37edab82..08cc4bb9b0 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -29,7 +29,7 @@ BOOL torture_utable(int dummy) smb_ucs2_t c2; int c, len, fd; int chars_allowed=0, alt_allowed=0; - uint8 valid[0x10000]; + uint8_t valid[0x10000]; printf("starting utable\n"); -- cgit From c5fbb6f23c2d399c7510bc552cdb1a27b1ef66a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Aug 2004 13:23:35 +0000 Subject: r1654: rename cli_ -> smbcli_ rename CLI_ -> SMBCLI_ metze (This used to be commit 8441750fd9427dd6fe477f27e603821b4026f038) --- source4/torture/basic/utable.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 08cc4bb9b0..f98e1b1b4a 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -22,7 +22,7 @@ BOOL torture_utable(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; fstring fname; const char *alt_name; int fnum; @@ -41,8 +41,8 @@ BOOL torture_utable(int dummy) memset(valid, 0, sizeof(valid)); - cli_mkdir(cli->tree, "\\utable"); - cli_unlink(cli->tree, "\\utable\\*"); + smbcli_mkdir(cli->tree, "\\utable"); + smbcli_unlink(cli->tree, "\\utable\\*"); for (c=1; c < 0x10000; c++) { char *p; @@ -56,13 +56,13 @@ BOOL torture_utable(int dummy) p[len] = 0; fstrcat(fname,"_a_long_extension"); - fnum = cli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC, + fnum = smbcli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE); if (fnum == -1) continue; chars_allowed++; - cli_qpathinfo_alt_name(cli->tree, fname, &alt_name); + smbcli_qpathinfo_alt_name(cli->tree, fname, &alt_name); if (strncmp(alt_name, "X_A_L", 5) != 0) { alt_allowed++; @@ -70,8 +70,8 @@ BOOL torture_utable(int dummy) d_printf("fname=[%s] alt_name=[%s]\n", fname, alt_name); } - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); if (c % 100 == 0) { printf("%d (%d/%d)\r", c, chars_allowed, alt_allowed); @@ -79,7 +79,7 @@ BOOL torture_utable(int dummy) } printf("%d (%d/%d)\n", c, chars_allowed, alt_allowed); - cli_rmdir(cli->tree, "\\utable"); + smbcli_rmdir(cli->tree, "\\utable"); d_printf("%d chars allowed %d alt chars allowed\n", chars_allowed, alt_allowed); @@ -116,7 +116,7 @@ static char *form_name(int c) BOOL torture_casetable(int dummy) { - static struct cli_state *cli; + static struct smbcli_state *cli; char *fname; int fnum; int c, i; @@ -132,8 +132,8 @@ BOOL torture_casetable(int dummy) memset(equiv, 0, sizeof(equiv)); - cli_deltree(cli->tree, "\\utable"); - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, "\\utable"))) { + smbcli_deltree(cli->tree, "\\utable"); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, "\\utable"))) { printf("Failed to create utable directory!\n"); return False; } @@ -146,7 +146,7 @@ BOOL torture_casetable(int dummy) d_printf("%04x (%c)\n", c, isprint(c)?c:'.'); fname = form_name(c); - fnum = cli_nt_create_full(cli->tree, fname, 0, + fnum = smbcli_nt_create_full(cli->tree, fname, 0, #if 0 SEC_RIGHT_MAXIMUM_ALLOWED, #else @@ -163,7 +163,7 @@ BOOL torture_casetable(int dummy) size = 0; - if (NT_STATUS_IS_ERR(cli_qfileinfo(cli->tree, fnum, NULL, &size, + if (NT_STATUS_IS_ERR(smbcli_qfileinfo(cli->tree, fnum, NULL, &size, NULL, NULL, NULL, NULL, NULL))) continue; if (size > 0) { @@ -173,11 +173,11 @@ BOOL torture_casetable(int dummy) if (size/sizeof(int) >= MAX_EQUIVALENCE) { printf("too many chars match?? size=%d c=0x%04x\n", size, c); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); return False; } - cli_read(cli->tree, fnum, (char *)c2, 0, size); + smbcli_read(cli->tree, fnum, (char *)c2, 0, size); printf("%04x: ", c); equiv[c][0] = c; for (i=0; itree, fnum, 0, (char *)&c, size, sizeof(c)); - cli_close(cli->tree, fnum); + smbcli_write(cli->tree, fnum, 0, (char *)&c, size, sizeof(c)); + smbcli_close(cli->tree, fnum); } - cli_unlink(cli->tree, "\\utable\\*"); - cli_rmdir(cli->tree, "\\utable"); + smbcli_unlink(cli->tree, "\\utable\\*"); + smbcli_rmdir(cli->tree, "\\utable"); return True; } -- cgit From 31c1c7846f6b6e5848bc39a28a65118bfa98e35d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 1 Sep 2004 04:39:06 +0000 Subject: r2159: converted samba4 over to UTF-16. I had previously thought this was unnecessary, as windows doesn't use standards compliant UTF-16, and for filesystem operations treats bytes as UCS-2, but Bjoern Jacke has pointed out to me that this means we don't correctly store extended UTF-16 characters as UTF-8 on disk. This can be seen with (for example) the gothic characters with codepoints above 64k. This commit also adds a LOCAL-ICONV torture test that tests the first 1 million codepoints against the system iconv library, and tests 5 million random UTF-16LE buffers for identical error handling to the system iconv library. the lib/iconv.c changes need backporting to samba3 (This used to be commit 756f28ac95feaa84b42402723d5f7286865c78db) --- source4/torture/basic/utable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index f98e1b1b4a..6faf020ef9 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -50,7 +50,7 @@ BOOL torture_utable(int dummy) SSVAL(&c2, 0, c); fstrcpy(fname, "\\utable\\x"); p = fname+strlen(fname); - len = convert_string(CH_UCS2, CH_UNIX, + len = convert_string(CH_UTF16, CH_UNIX, &c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; @@ -107,7 +107,7 @@ static char *form_name(int c) p = fname+strlen(fname); SSVAL(&c2, 0, c); - len = convert_string(CH_UCS2, CH_UNIX, + len = convert_string(CH_UTF16, CH_UNIX, &c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; -- cgit From 7d32679e9683c81aca538f0267684332a28a286f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Oct 2004 08:13:00 +0000 Subject: r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions. The motivation for this change was to avoid having to convert to/from ucs2 strings for so many operations. Doing that was slow, used many static buffers, and was also incorrect as it didn't cope properly with unicode codepoints above 65536 (which could not be represented correctly as smb_ucs2_t chars) The two core functions that allowed this change are next_codepoint() and push_codepoint(). These functions allow you to correctly walk a arbitrary multi-byte string a character at a time without converting the whole string to ucs2. While doing this cleanup I also fixed several ucs2 string handling bugs. See the commit for details. The following code (which counts the number of occuraces of 'c' in a string) shows how to use the new interface: size_t count_chars(const char *s, char c) { size_t count = 0; while (*s) { size_t size; codepoint_t c2 = next_codepoint(s, &size); if (c2 == c) count++; s += size; } return count; } (This used to be commit 814881f0e50019196b3aa9fbe4aeadbb98172040) --- source4/torture/basic/utable.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 6faf020ef9..8047e5a468 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -26,7 +26,7 @@ BOOL torture_utable(int dummy) fstring fname; const char *alt_name; int fnum; - smb_ucs2_t c2; + char c2[4]; int c, len, fd; int chars_allowed=0, alt_allowed=0; uint8_t valid[0x10000]; @@ -47,11 +47,11 @@ BOOL torture_utable(int dummy) for (c=1; c < 0x10000; c++) { char *p; - SSVAL(&c2, 0, c); + SSVAL(c2, 0, c); fstrcpy(fname, "\\utable\\x"); p = fname+strlen(fname); len = convert_string(CH_UTF16, CH_UNIX, - &c2, 2, + c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; fstrcat(fname,"_a_long_extension"); @@ -99,16 +99,16 @@ BOOL torture_utable(int dummy) static char *form_name(int c) { static fstring fname; - smb_ucs2_t c2; + char c2[4]; char *p; int len; fstrcpy(fname, "\\utable\\"); p = fname+strlen(fname); - SSVAL(&c2, 0, c); + SSVAL(c2, 0, c); len = convert_string(CH_UTF16, CH_UNIX, - &c2, 2, + c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; return fname; @@ -121,7 +121,7 @@ BOOL torture_casetable(int dummy) int fnum; int c, i; #define MAX_EQUIVALENCE 8 - smb_ucs2_t equiv[0x10000][MAX_EQUIVALENCE]; + codepoint_t equiv[0x10000][MAX_EQUIVALENCE]; printf("starting casetable\n"); if (!torture_open_connection(&cli)) { -- cgit From ba6d5fcb97b9831dddf7dfe09fb02fbb23d864b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Oct 2004 13:40:50 +0000 Subject: r3324: made the smbtorture code completely warning free (This used to be commit 7067bb9b52223cafa28470f264f0b60646a07a01) --- source4/torture/basic/utable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 8047e5a468..900f0be830 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -20,7 +20,7 @@ #include "includes.h" -BOOL torture_utable(int dummy) +BOOL torture_utable(void) { struct smbcli_state *cli; fstring fname; @@ -114,7 +114,7 @@ static char *form_name(int c) return fname; } -BOOL torture_casetable(int dummy) +BOOL torture_casetable(void) { static struct smbcli_state *cli; char *fname; -- cgit From 26c6b4c70bd85d8030a96651f2a255a4d48fcda1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 01:42:45 +0000 Subject: r3449: more include file reduction the ldb part isn't ideal, I will have to think of a better solution (This used to be commit 6b1f86aea8427a8e957b1aeb0ec2f507297f07cb) --- source4/torture/basic/utable.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 900f0be830..c09ef576a5 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "system/iconv.h" BOOL torture_utable(void) { -- cgit From 0e255bb542b1f79c32e9295617199ea8d60753d4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Nov 2004 09:37:59 +0000 Subject: r3699: - split the delayed write testing out of RAW-WRITE, as it is not yet clear what the correct behaviour is for delayed stat info update. - use a common torture_setup_dir() function for setting up a test directory in torture tests. (This used to be commit f7fb34715b7d6ea3c35ddd684cfb27459a420339) --- source4/torture/basic/utable.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index c09ef576a5..30d389dd92 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -42,8 +42,9 @@ BOOL torture_utable(void) memset(valid, 0, sizeof(valid)); - smbcli_mkdir(cli->tree, "\\utable"); - smbcli_unlink(cli->tree, "\\utable\\*"); + if (!torture_setup_dir(cli, "\\utable")) { + return False; + } for (c=1; c < 0x10000; c++) { char *p; @@ -133,9 +134,7 @@ BOOL torture_casetable(void) memset(equiv, 0, sizeof(equiv)); - smbcli_deltree(cli->tree, "\\utable"); - if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, "\\utable"))) { - printf("Failed to create utable directory!\n"); + if (!torture_setup_dir(cli, "\\utable")) { return False; } -- cgit From fdc9f417d89fdf9dd6afbc22843d70585e195c9d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Nov 2004 04:33:27 +0000 Subject: r4011: get rid of rpc_secdes.h and replace it with a single sane set of definitions for security access masks, in security.idl The previous definitions were inconsistently named, and contained many duplicate and misleading entries. I kept finding myself tripping up while using them. (This used to be commit 01c0fa722f80ceeb3f81f01987de95f365a2ed3d) --- source4/torture/basic/utable.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 30d389dd92..dcd00b9fbb 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -20,6 +20,7 @@ #include "includes.h" #include "system/iconv.h" +#include "librpc/gen_ndr/ndr_security.h" BOOL torture_utable(void) { @@ -148,13 +149,13 @@ BOOL torture_casetable(void) fname = form_name(c); fnum = smbcli_nt_create_full(cli->tree, fname, 0, #if 0 - SEC_RIGHT_MAXIMUM_ALLOWED, + SEC_RIGHT_MAXIMUM_ALLOWED, #else - GENERIC_RIGHTS_FILE_ALL_ACCESS, + SEC_RIGHTS_FULL_CONTROL, #endif - FILE_ATTRIBUTE_NORMAL, - NTCREATEX_SHARE_ACCESS_NONE, - NTCREATEX_DISP_OPEN_IF, 0, 0); + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_NONE, + NTCREATEX_DISP_OPEN_IF, 0, 0); if (fnum == -1) { printf("Failed to create file with char %04x\n", c); -- cgit From cc8f4358cca2404895015e2351394f2f4a16e025 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Dec 2004 04:37:36 +0000 Subject: r4035: more effort on consistent naming of the access mask bits. This removes the duplicate named SEC_RIGHTS_MAXIMUM_ALLOWED and SEC_RIGHTS_FULL_CONTROL, which are just other names for SEC_FLAG_MAXIMUM_ALLOWED and SEC_RIGHTS_FILE_ALL. The latter names match the new naming conventions in security.idl Also added names for the generic->specific mappings for files are directories (This used to be commit 17a4e0b3aca227b40957ed1e0c57e498debc6ddf) --- source4/torture/basic/utable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index dcd00b9fbb..f9233595cf 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -151,7 +151,7 @@ BOOL torture_casetable(void) #if 0 SEC_RIGHT_MAXIMUM_ALLOWED, #else - SEC_RIGHTS_FULL_CONTROL, + SEC_RIGHTS_FILE_ALL, #endif FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_NONE, -- cgit From 9112a632f6791ffc3c3c1aadd214cbaba8fe816e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 4 Dec 2004 13:56:25 +0000 Subject: r4063: - change char * -> uint8_t in struct request_buffer - change smbcli_read/write to take void * for the buffers to match read(2)/write(2) all this fixes a lot of gcc-4 warnings metze (This used to be commit b94f92bc6637f748d6f7049f4f9a30b0b8d18a7a) --- source4/torture/basic/utable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index f9233595cf..01984077a3 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -28,7 +28,7 @@ BOOL torture_utable(void) fstring fname; const char *alt_name; int fnum; - char c2[4]; + uint8_t c2[4]; int c, len, fd; int chars_allowed=0, alt_allowed=0; uint8_t valid[0x10000]; @@ -102,7 +102,7 @@ BOOL torture_utable(void) static char *form_name(int c) { static fstring fname; - char c2[4]; + uint8_t c2[4]; char *p; int len; @@ -178,7 +178,7 @@ BOOL torture_casetable(void) return False; } - smbcli_read(cli->tree, fnum, (char *)c2, 0, size); + smbcli_read(cli->tree, fnum, c2, 0, size); printf("%04x: ", c); equiv[c][0] = c; for (i=0; itree, fnum, 0, (char *)&c, size, sizeof(c)); + smbcli_write(cli->tree, fnum, 0, &c, size, sizeof(c)); smbcli_close(cli->tree, fnum); } -- cgit From e82aad1ce39a6b7a2e51b9e2cb494d74ec70e158 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Feb 2005 05:09:35 +0000 Subject: r5298: - got rid of pstring.h from includes.h. This at least makes it a bit less likely that anyone will use pstring for new code - got rid of winbind_client.h from includes.h. This one triggered a huge change, as winbind_client.h was including system/filesys.h and defining the old uint32 and uint16 types, as well as its own pstring and fstring. (This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f) --- source4/torture/basic/utable.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 01984077a3..ea1bb76b8c 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -20,7 +20,9 @@ #include "includes.h" #include "system/iconv.h" +#include "system/filesys.h" #include "librpc/gen_ndr/ndr_security.h" +#include "pstring.h" BOOL torture_utable(void) { -- cgit From e835621799647ee70630b389fb53d15b15d68355 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Jul 2005 09:20:52 +0000 Subject: r8520: fixed a pile of warnings from the build farm gcc -Wall output on S390. This is an attempt to avoid the panic we're seeing in the automatic builds. The main fixes are: - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats - use of NULL format statements to perform dn searches. - assumption that sizeof() returns an int (This used to be commit a58ea6b3854973b694d2b1e22323ed7eb00e3a3f) --- source4/torture/basic/utable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index ea1bb76b8c..cf3b07886a 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -175,7 +175,7 @@ BOOL torture_casetable(void) if (size/sizeof(int) >= MAX_EQUIVALENCE) { printf("too many chars match?? size=%d c=0x%04x\n", - size, c); + (int)size, c); smbcli_close(cli->tree, fnum); return False; } -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/torture/basic/utable.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index cf3b07886a..ebe9cd9156 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -21,7 +21,6 @@ #include "includes.h" #include "system/iconv.h" #include "system/filesys.h" -#include "librpc/gen_ndr/ndr_security.h" #include "pstring.h" BOOL torture_utable(void) -- cgit From 25bb00fbcd409572e1c19c05fdc42c883936780b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 13:41:17 +0000 Subject: r12693: Move core data structures out of smb.h into core.h torture prototypes in seperate header (This used to be commit 73610639b23ca3743077193fa0b1de7c7f65944d) --- source4/torture/basic/utable.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index ebe9cd9156..f3f7429021 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "torture/torture.h" #include "system/iconv.h" #include "system/filesys.h" #include "pstring.h" -- cgit From 78c50015bb8bd5a1d831a6e7ec796b3367c73145 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 15:40:05 +0000 Subject: r12694: Move some headers to the directory of the subsystem they belong to. (This used to be commit c722f665c90103f3ed57621c460e32ad33e7a8a3) --- source4/torture/basic/utable.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index f3f7429021..e76627fb03 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -22,6 +22,7 @@ #include "torture/torture.h" #include "system/iconv.h" #include "system/filesys.h" +#include "libcli/libcli.h" #include "pstring.h" BOOL torture_utable(void) -- cgit From d09b70c98b8222eb293bc9d8713ec071188ed01d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 17 Mar 2006 17:59:58 +0000 Subject: r14527: Fix build problems. (This used to be commit 863ca4014d9b821706ee90f58ab5d5cf3899a4c7) --- source4/torture/basic/utable.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index e76627fb03..dfff6f168d 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -23,6 +23,7 @@ #include "system/iconv.h" #include "system/filesys.h" #include "libcli/libcli.h" +#include "torture/util.h" #include "pstring.h" BOOL torture_utable(void) -- cgit From 909b111f587705a45f63540b39968f1af58a9b5d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 25 Mar 2006 16:01:28 +0000 Subject: r14720: Add torture_context argument to all torture tests (This used to be commit 3c7a5ce29108dd82210dc3e1f00414f545949e1d) --- source4/torture/basic/utable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index dfff6f168d..9e8ee6ced8 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -26,7 +26,7 @@ #include "torture/util.h" #include "pstring.h" -BOOL torture_utable(void) +BOOL torture_utable(struct torture_context *torture) { struct smbcli_state *cli; fstring fname; @@ -121,7 +121,7 @@ static char *form_name(int c) return fname; } -BOOL torture_casetable(void) +BOOL torture_casetable(struct torture_context *torture) { static struct smbcli_state *cli; char *fname; -- cgit From 172a83d72491f90f6191be1040ef8b2e1789bd2e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 13 May 2006 19:14:12 +0000 Subject: r15573: Fix build of systems that have iconv headers in non-standard locations Split of system/locale.h header from system/iconv.h Previously, iconv wasn't being used on these systems (This used to be commit aa6d66fda69779d1c2948a1aca85dbd5208f1cba) --- source4/torture/basic/utable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 9e8ee6ced8..7a2b3874e0 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -20,8 +20,8 @@ #include "includes.h" #include "torture/torture.h" -#include "system/iconv.h" #include "system/filesys.h" +#include "system/locale.h" #include "libcli/libcli.h" #include "torture/util.h" #include "pstring.h" -- cgit From b7c5bc522b286e8e478b6f74a68bc68829e64c3c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 Jul 2006 08:00:06 +0000 Subject: r16907: Add an index parameter to torture_open_connection. Next step is to enable the unclist parameter for all tests that do two connections, to enable cluster testing. Volker (This used to be commit a5d6db09244d444986f8fded3fc6e72c74c8ca1f) --- source4/torture/basic/utable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 7a2b3874e0..8e13babd0a 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -41,7 +41,7 @@ BOOL torture_utable(struct torture_context *torture) printf("Generating valid character table\n"); - if (!torture_open_connection(&cli)) { + if (!torture_open_connection(&cli, 0)) { return False; } @@ -131,7 +131,7 @@ BOOL torture_casetable(struct torture_context *torture) codepoint_t equiv[0x10000][MAX_EQUIVALENCE]; printf("starting casetable\n"); - if (!torture_open_connection(&cli)) { + if (!torture_open_connection(&cli, 0)) { return False; } -- cgit From 8773e743c518578584d07d35ffdafdd598af88b0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 16 Oct 2006 13:06:41 +0000 Subject: r19339: Merge my 4.0-unittest branch. This adds an API for more fine-grained output in the testsuite rather than just True or False for a set of tests. The aim is to use this for: * known failure lists (run all tests and detect tests that started working or started failing). This would allow us to get rid of the RPC-SAMBA3-* tests * nicer torture output * simplification of the testsuite system * compatibility with other unit testing systems * easier usage of smbtorture (being able to run one test and automatically set up the environment for that) This is still a work-in-progress; expect more updates over the next couple of days. (This used to be commit 0eb6097305776325c75081356309115f445a7218) --- source4/torture/basic/utable.c | 72 ++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 44 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 8e13babd0a..28122da214 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -26,9 +26,9 @@ #include "torture/util.h" #include "pstring.h" -BOOL torture_utable(struct torture_context *torture) +bool torture_utable(struct torture_context *tctx, + struct smbcli_state *cli) { - struct smbcli_state *cli; fstring fname; const char *alt_name; int fnum; @@ -37,19 +37,12 @@ BOOL torture_utable(struct torture_context *torture) int chars_allowed=0, alt_allowed=0; uint8_t valid[0x10000]; - printf("starting utable\n"); - - printf("Generating valid character table\n"); - - if (!torture_open_connection(&cli, 0)) { - return False; - } + torture_comment(tctx, "Generating valid character table\n"); memset(valid, 0, sizeof(valid)); - if (!torture_setup_dir(cli, "\\utable")) { - return False; - } + torture_assert(tctx, torture_setup_dir(cli, "\\utable"), + "Setting up dir \\utable failed"); for (c=1; c < 0x10000; c++) { char *p; @@ -74,32 +67,31 @@ BOOL torture_utable(struct torture_context *torture) 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); + torture_comment(tctx, "fname=[%s] alt_name=[%s]\n", fname, alt_name); } smbcli_close(cli->tree, fnum); smbcli_unlink(cli->tree, fname); if (c % 100 == 0) { - printf("%d (%d/%d)\r", c, chars_allowed, alt_allowed); + torture_comment(tctx, "%d (%d/%d)\r", c, chars_allowed, alt_allowed); } } - printf("%d (%d/%d)\n", c, chars_allowed, alt_allowed); + torture_comment(tctx, "%d (%d/%d)\n", c, chars_allowed, alt_allowed); smbcli_rmdir(cli->tree, "\\utable"); - d_printf("%d chars allowed %d alt chars allowed\n", chars_allowed, alt_allowed); + torture_comment(tctx, "%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; - } + torture_assert(tctx, fd != -1, + talloc_asprintf(tctx, + "Failed to create valid.dat - %s", strerror(errno))); write(fd, valid, 0x10000); close(fd); - d_printf("wrote valid.dat\n"); + torture_comment(tctx, "wrote valid.dat\n"); - return True; + return true; } @@ -121,34 +113,28 @@ static char *form_name(int c) return fname; } -BOOL torture_casetable(struct torture_context *torture) +bool torture_casetable(struct torture_context *tctx, + struct smbcli_state *cli) { - static struct smbcli_state *cli; char *fname; int fnum; int c, i; #define MAX_EQUIVALENCE 8 codepoint_t equiv[0x10000][MAX_EQUIVALENCE]; - printf("starting casetable\n"); - if (!torture_open_connection(&cli, 0)) { - return False; - } - - printf("Determining upper/lower case table\n"); + torture_comment(tctx, "Determining upper/lower case table\n"); memset(equiv, 0, sizeof(equiv)); - if (!torture_setup_dir(cli, "\\utable")) { - return False; - } + torture_assert(tctx, torture_setup_dir(cli, "\\utable"), + "Error setting up dir \\utable"); for (c=1; c < 0x10000; c++) { size_t size; if (c == '.' || c == '\\') continue; - d_printf("%04x (%c)\n", c, isprint(c)?c:'.'); + torture_comment(tctx, "%04x (%c)\n", c, isprint(c)?c:'.'); fname = form_name(c); fnum = smbcli_nt_create_full(cli->tree, fname, 0, @@ -161,10 +147,9 @@ BOOL torture_casetable(struct torture_context *torture) NTCREATEX_SHARE_ACCESS_NONE, NTCREATEX_DISP_OPEN_IF, 0, 0); - if (fnum == -1) { - printf("Failed to create file with char %04x\n", c); - continue; - } + torture_assert(tctx, fnum != -1, + talloc_asprintf(tctx, + "Failed to create file with char %04x\n", c)); size = 0; @@ -176,21 +161,20 @@ BOOL torture_casetable(struct torture_context *torture) int c2[MAX_EQUIVALENCE]; if (size/sizeof(int) >= MAX_EQUIVALENCE) { - printf("too many chars match?? size=%d c=0x%04x\n", + torture_comment(tctx, "too many chars match?? size=%d c=0x%04x\n", (int)size, c); smbcli_close(cli->tree, fnum); return False; } smbcli_read(cli->tree, fnum, c2, 0, size); - printf("%04x: ", c); + torture_comment(tctx, "%04x: ", c); equiv[c][0] = c; for (i=0; itree, fnum, 0, &c, size, sizeof(c)); @@ -200,5 +184,5 @@ BOOL torture_casetable(struct torture_context *torture) smbcli_unlink(cli->tree, "\\utable\\*"); smbcli_rmdir(cli->tree, "\\utable"); - return True; + return true; } -- cgit From 628ff1bea3e167e2d45dffbffb3c4fffaa3d1916 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 29 Apr 2007 21:37:29 +0000 Subject: r22579: disable progress printing in the build-farm metze (This used to be commit 93089ad5e8b6e20c4fa92bf13b0137765aeac689) --- source4/torture/basic/utable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 28122da214..363288658e 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -74,7 +74,10 @@ bool torture_utable(struct torture_context *tctx, smbcli_unlink(cli->tree, fname); if (c % 100 == 0) { - torture_comment(tctx, "%d (%d/%d)\r", c, chars_allowed, alt_allowed); + if (torture_setting_bool(tctx, "progress", true)) { + torture_comment(tctx, "%d (%d/%d)\r", c, chars_allowed, alt_allowed); + fflush(stdout); + } } } torture_comment(tctx, "%d (%d/%d)\n", c, chars_allowed, alt_allowed); -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/torture/basic/utable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 363288658e..52babe4d53 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/torture/basic/utable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 52babe4d53..82511aa8f9 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -166,7 +166,7 @@ bool torture_casetable(struct torture_context *tctx, torture_comment(tctx, "too many chars match?? size=%d c=0x%04x\n", (int)size, c); smbcli_close(cli->tree, fnum); - return False; + return false; } smbcli_read(cli->tree, fnum, c2, 0, size); -- cgit From 39ee38d9c1aabf4db065b433d067d0da053d7d61 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 6 Dec 2007 17:52:23 +0100 Subject: r26316: Use contexts for conversion functions. (This used to be commit f6420d933b5b011d428974f3a2a57edf19e6f482) --- source4/torture/basic/utable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 82511aa8f9..244378dbc9 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -49,7 +49,7 @@ bool torture_utable(struct torture_context *tctx, SSVAL(c2, 0, c); fstrcpy(fname, "\\utable\\x"); p = fname+strlen(fname); - len = convert_string(CH_UTF16, CH_UNIX, + len = convert_string(global_smb_iconv_convenience, CH_UTF16, CH_UNIX, c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; @@ -108,7 +108,7 @@ static char *form_name(int c) p = fname+strlen(fname); SSVAL(c2, 0, c); - len = convert_string(CH_UTF16, CH_UNIX, + len = convert_string(global_smb_iconv_convenience, CH_UTF16, CH_UNIX, c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; -- cgit From d891c0c74a03d797aed1c5ac0329fd9d1d78da63 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 13 Dec 2007 22:46:09 +0100 Subject: r26429: Avoid use of global_smb_iconv_convenience. (This used to be commit d37136b7abfbba75ef2e5ab855eb3382b9648b8c) --- source4/torture/basic/utable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 244378dbc9..51b7b39309 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -24,6 +24,7 @@ #include "libcli/libcli.h" #include "torture/util.h" #include "pstring.h" +#include "param/param.h" bool torture_utable(struct torture_context *tctx, struct smbcli_state *cli) @@ -49,7 +50,7 @@ bool torture_utable(struct torture_context *tctx, SSVAL(c2, 0, c); fstrcpy(fname, "\\utable\\x"); p = fname+strlen(fname); - len = convert_string(global_smb_iconv_convenience, CH_UTF16, CH_UNIX, + len = convert_string(lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; @@ -108,7 +109,7 @@ static char *form_name(int c) p = fname+strlen(fname); SSVAL(c2, 0, c); - len = convert_string(global_smb_iconv_convenience, CH_UTF16, CH_UNIX, + len = convert_string(lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; -- cgit From 5e00673a4063c9a51580a36ba1f824bd8ea0de66 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 13 Dec 2007 22:46:47 +0100 Subject: r26438: Store iconv convenience in tdr push contexts. (This used to be commit dffef3162778aebe2f8d77e2da60b22adb7d60ef) --- source4/torture/basic/utable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 51b7b39309..112cf323a1 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -50,7 +50,7 @@ bool torture_utable(struct torture_context *tctx, SSVAL(c2, 0, c); fstrcpy(fname, "\\utable\\x"); p = fname+strlen(fname); - len = convert_string(lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, + len = convert_string(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; -- cgit From d9f8232c34a695df04a5240e270dd7ffc3101c0e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 15:21:45 +0100 Subject: Remove more uses of global_loadparm. (This used to be commit 230355d2e6e27918dff40823eb238904c7a1870e) --- source4/torture/basic/utable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/basic/utable.c') diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 112cf323a1..2b222d7c6e 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -98,7 +98,7 @@ bool torture_utable(struct torture_context *tctx, } -static char *form_name(int c) +static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c) { static fstring fname; uint8_t c2[4]; @@ -109,7 +109,7 @@ static char *form_name(int c) p = fname+strlen(fname); SSVAL(c2, 0, c); - len = convert_string(lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, + len = convert_string(iconv_convenience, CH_UTF16, CH_UNIX, c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; @@ -139,7 +139,7 @@ bool torture_casetable(struct torture_context *tctx, torture_comment(tctx, "%04x (%c)\n", c, isprint(c)?c:'.'); - fname = form_name(c); + fname = form_name(lp_iconv_convenience(tctx->lp_ctx), c); fnum = smbcli_nt_create_full(cli->tree, fname, 0, #if 0 SEC_RIGHT_MAXIMUM_ALLOWED, -- cgit