diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-08-11 21:11:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:57:52 -0500 |
commit | ae274c84d734165f6af8356a15d38c56b7d07406 (patch) | |
tree | 04ada5f44db8b9a7daa6887a5c4b4a0580c83027 /source4/torture/torture_util.c | |
parent | 44e04cdb11a87ae78cabd76c61e11ae1f283dfaa (diff) | |
download | samba-ae274c84d734165f6af8356a15d38c56b7d07406.tar.gz samba-ae274c84d734165f6af8356a15d38c56b7d07406.tar.bz2 samba-ae274c84d734165f6af8356a15d38c56b7d07406.zip |
r1740: fixed the torture suite for ASCII-only servers
(This used to be commit c3bce90be745db3e7cbf8273c1c8496920332f5e)
Diffstat (limited to 'source4/torture/torture_util.c')
-rw-r--r-- | source4/torture/torture_util.c | 11 |
1 files changed, 9 insertions, 2 deletions
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++; |