From efc29ecc21a57e83ac43b875f612e4f6fd20117d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 May 2004 07:33:05 +0000 Subject: r902: added torture tests for sending rubbish in the domain name field of GetDomPwInfo (This used to be commit 00096609978e829b5da36040c15afa087e71eaa5) --- source4/torture/rpc/samr.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/samr.c') diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 49faaa886c..9d90a8b136 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -600,9 +600,17 @@ static BOOL test_GetDomPwInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_GetDomPwInfo r; BOOL ret = True; - printf("Testing GetDomPwInfo\n"); - r.in.name = domain_name; + printf("Testing GetDomPwInfo with name %s\n", r.in.name->name); + + status = dcerpc_samr_GetDomPwInfo(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("GetDomPwInfo failed - %s\n", nt_errstr(status)); + ret = False; + } + + r.in.name->name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); + printf("Testing GetDomPwInfo with name %s\n", r.in.name->name); status = dcerpc_samr_GetDomPwInfo(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -610,6 +618,25 @@ static BOOL test_GetDomPwInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + r.in.name->name = "\\\\__NONAME__"; + printf("Testing GetDomPwInfo with name %s\n", r.in.name->name); + + status = dcerpc_samr_GetDomPwInfo(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("GetDomPwInfo failed - %s\n", nt_errstr(status)); + ret = False; + } + + r.in.name->name = "\\\\Builtin"; + printf("Testing GetDomPwInfo with name %s\n", r.in.name->name); + + status = dcerpc_samr_GetDomPwInfo(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("GetDomPwInfo failed - %s\n", nt_errstr(status)); + ret = False; + } + + return ret; } -- cgit