diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/bind.c | 32 | ||||
-rw-r--r-- | source4/torture/shell.c | 11 |
2 files changed, 33 insertions, 10 deletions
diff --git a/source4/torture/rpc/bind.c b/source4/torture/rpc/bind.c index b36e54cac0..f6470595e3 100644 --- a/source4/torture/rpc/bind.c +++ b/source4/torture/rpc/bind.c @@ -52,6 +52,7 @@ static bool test_bind(struct torture_context *tctx, torture_rpc_binding(tctx, &binding), "failed to parse binding string"); + binding->flags &= ~DCERPC_AUTH_OPTIONS; binding->flags |= *flags; torture_assert_ntstatus_ok(tctx, @@ -86,11 +87,32 @@ static void test_bind_op(struct torture_suite *suite, struct torture_suite *torture_rpc_bind(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "BIND"); - - test_bind_op(suite, "ntlm,sign", DCERPC_AUTH_NTLM | DCERPC_SIGN); - test_bind_op(suite, "ntlm,sign,seal", DCERPC_AUTH_NTLM | DCERPC_SIGN | DCERPC_SEAL); - test_bind_op(suite, "spnego,sign", DCERPC_AUTH_SPNEGO | DCERPC_SIGN); - test_bind_op(suite, "spnego,sign,seal", DCERPC_AUTH_SPNEGO | DCERPC_SIGN | DCERPC_SEAL); + struct { + const char *test_name; + uint32_t flags; + } tests[] = { + { + .test_name = "ntlm,sign", + .flags = DCERPC_AUTH_NTLM | DCERPC_SIGN + },{ + .test_name = "ntlm,sign,seal", + .flags = DCERPC_AUTH_NTLM | DCERPC_SIGN | DCERPC_SEAL + },{ + .test_name = "spnego,sign", + .flags = DCERPC_AUTH_SPNEGO | DCERPC_SIGN + },{ + .test_name = "spnego,sign,seal", + .flags = DCERPC_AUTH_SPNEGO | DCERPC_SIGN | DCERPC_SEAL + } + }; + int i; + + for (i=0; i < ARRAY_SIZE(tests); i++) { + test_bind_op(suite, tests[i].test_name, tests[i].flags); + } + for (i=0; i < ARRAY_SIZE(tests); i++) { + test_bind_op(suite, talloc_asprintf(suite, "bigendian,%s", tests[i].test_name), tests[i].flags | DCERPC_PUSH_BIGENDIAN); + } return suite; } diff --git a/source4/torture/shell.c b/source4/torture/shell.c index 7c313af178..03c670a902 100644 --- a/source4/torture/shell.c +++ b/source4/torture/shell.c @@ -175,8 +175,6 @@ static void shell_help(const struct shell_command * command, static void shell_set(const struct shell_command *command, struct torture_context *tctx, int argc, const char **argv) { - char * name; - switch (argc) { case 0: lpcfg_dump(tctx->lp_ctx, stdout, @@ -185,9 +183,12 @@ static void shell_set(const struct shell_command *command, break; case 2: - name = talloc_asprintf(NULL, "torture:%s", argv[0]); - lpcfg_set_cmdline(tctx->lp_ctx, name, argv[1]); - talloc_free(name); + /* We want to allow users to set any config option. Top level + * options will get checked against their static definition, but + * parametric options can't be checked and will just get stashed + * as they are provided. + */ + lpcfg_set_cmdline(tctx->lp_ctx, argv[0], argv[1]); break; default: |