diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-07 23:57:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:48 -0500 |
commit | a848b0e3e26a3c572bb32475352d460d247d85ee (patch) | |
tree | 94eb228ecd16e5d894119d4012f57ab96f731726 | |
parent | 62e910608614387dc694bed2baaaeddc3d71b1f0 (diff) | |
download | samba-a848b0e3e26a3c572bb32475352d460d247d85ee.tar.gz samba-a848b0e3e26a3c572bb32475352d460d247d85ee.tar.bz2 samba-a848b0e3e26a3c572bb32475352d460d247d85ee.zip |
r577: extended the LookupNames test to check for correct handling of unmapped names
(This used to be commit e3b31625f476cb1b8a4d5003dee2c574582c9b46)
-rw-r--r-- | source4/torture/rpc/samr.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index c7d55ad828..d6dcc3de02 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -636,16 +636,33 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_LookupNames n; - struct samr_Name sname; + struct samr_Name sname[2]; - init_samr_Name(&sname, name); + init_samr_Name(&sname[0], name); n.in.handle = domain_handle; n.in.num_names = 1; - n.in.names = &sname; + n.in.names = sname; status = dcerpc_samr_LookupNames(p, mem_ctx, &n); if (NT_STATUS_IS_OK(status)) { *rid = n.out.rids.ids[0]; + } else { + return status; + } + + init_samr_Name(&sname[1], "xxNONAMExx"); + n.in.num_names = 2; + status = dcerpc_samr_LookupNames(p, mem_ctx, &n); + if (!NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) { + printf("LookupNames[2] failed - %s\n", nt_errstr(status)); + return status; + } + + init_samr_Name(&sname[1], "xxNONAMExx"); + n.in.num_names = 0; + status = dcerpc_samr_LookupNames(p, mem_ctx, &n); + if (!NT_STATUS_IS_OK(status)) { + printf("LookupNames[0] failed - %s\n", nt_errstr(status)); } return status; @@ -842,7 +859,7 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_CryptPassword nt_pass, lm_pass; struct samr_Hash nt_verifier, lm_verifier; char *oldpass = *password; - char *newpass = samr_rand_pass(mem_ctx); + char *newpass = samr_rand_pass(mem_ctx); uint8 old_nt_hash[16], new_nt_hash[16]; uint8 old_lm_hash[16], new_lm_hash[16]; @@ -1332,7 +1349,6 @@ static BOOL test_CreateUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } - q.in.handle = user_handle; q.in.level = 16; |