diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-02-11 07:54:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:42 -0500 |
commit | dd689afdc807b9ff057ee7e917e12b6597fe319c (patch) | |
tree | 6a3249cbe4834ccbe29973d07abbf5fa8f5ad7e9 /source4/torture/nbt | |
parent | f3d1fa124bafde1842c09fa6d408a52f99b5d984 (diff) | |
download | samba-dd689afdc807b9ff057ee7e917e12b6597fe319c.tar.gz samba-dd689afdc807b9ff057ee7e917e12b6597fe319c.tar.bz2 samba-dd689afdc807b9ff057ee7e917e12b6597fe319c.zip |
r5328: - allow case sensitive nbt name lookups
- added --case-sensitive option to nmblookup
- added case sensitivity tests to the NBT-WINS test
(This used to be commit 80a95d5688e055b36727e5c043cb36322d719763)
Diffstat (limited to 'source4/torture/nbt')
-rw-r--r-- | source4/torture/nbt/wins.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index fdd5a1094d..27b50dd204 100644 --- a/source4/torture/nbt/wins.c +++ b/source4/torture/nbt/wins.c @@ -114,6 +114,42 @@ static BOOL nbt_test_wins_name(TALLOC_CTX *mem_ctx, const char *address, CHECK_VALUE(query.out.num_addrs, 1); CHECK_STRING(query.out.reply_addrs[0], myaddress); + + query.in.name.name = strupper_talloc(mem_ctx, name->name); + if (query.in.name.name && + strcmp(query.in.name.name, name->name) != 0) { + printf("check case sensitivity\n"); + status = nbt_name_query(nbtsock, mem_ctx, &query); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name query\n", address); + return False; + } + if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { + printf("Bad response from %s for name query - %s\n", + address, nt_errstr(status)); + return False; + } + } + + query.in.name = *name; + if (name->scope) { + query.in.name.scope = strupper_talloc(mem_ctx, name->scope); + } + if (query.in.name.scope && + strcmp(query.in.name.scope, name->scope) != 0) { + printf("check case sensitivity on scope\n"); + status = nbt_name_query(nbtsock, mem_ctx, &query); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name query\n", address); + return False; + } + if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { + printf("Bad response from %s for name query - %s\n", + address, nt_errstr(status)); + return False; + } + } + printf("refresh the name\n"); refresh.in.name = *name; refresh.in.wins_servers = str_list_make(mem_ctx, address, NULL); @@ -176,6 +212,7 @@ static BOOL nbt_test_wins_name(TALLOC_CTX *mem_ctx, const char *address, printf("query the name to make sure its gone\n"); + query.in.name = *name; status = nbt_name_query(nbtsock, mem_ctx, &query); if (NT_STATUS_IS_OK(status)) { printf("ERROR: Name query success after release\n"); @@ -222,6 +259,9 @@ static BOOL nbt_test_wins(TALLOC_CTX *mem_ctx, const char *address) name.name = talloc_asprintf(mem_ctx, "."); ret &= nbt_test_wins_name(mem_ctx, address, &name); + name.name = talloc_asprintf(mem_ctx, "%5u-\377\200\300FOO", r); + ret &= nbt_test_wins_name(mem_ctx, address, &name); + return ret; } |