From ae274c84d734165f6af8356a15d38c56b7d07406 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 11 Aug 2004 21:11:37 +0000 Subject: r1740: fixed the torture suite for ASCII-only servers (This used to be commit c3bce90be745db3e7cbf8273c1c8496920332f5e) --- source4/torture/torture_util.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/torture/torture_util.c') diff --git a/source4/torture/torture_util.c b/source4/torture/torture_util.c index bb7f6eb4c2..c39aa0ad5e 100644 --- a/source4/torture/torture_util.c +++ b/source4/torture/torture_util.c @@ -193,13 +193,20 @@ void *shm_setup(int size) check that a wire string matches the flags specified not 100% accurate, but close enough for testing */ -BOOL wire_bad_flags(WIRE_STRING *str, int flags) +BOOL wire_bad_flags(WIRE_STRING *str, int flags, struct smbcli_state *cli) { + BOOL server_unicode; int len; if (!str || !str->s) return True; len = strlen(str->s); if (flags & STR_TERMINATE) len++; - if ((flags & STR_UNICODE) || !getenv("CLI_FORCE_ASCII")) { + + server_unicode = (cli->transport->negotiate.capabilities&CAP_UNICODE)?True:False; + if (getenv("CLI_FORCE_ASCII") || !lp_unicode()) { + server_unicode = False; + } + + if ((flags & STR_UNICODE) || server_unicode) { len *= 2; } else if (flags & STR_TERMINATE_ASCII) { len++; -- cgit