diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/dssync.c | 28 | ||||
-rw-r--r-- | source4/torture/smbtorture.c | 14 |
2 files changed, 38 insertions, 4 deletions
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 053f78e99b..2930a9b1f9 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -23,6 +23,7 @@ #include "includes.h" #include "lib/cmdline/popt_common.h" #include "librpc/gen_ndr/ndr_drsuapi_c.h" +#include "librpc/gen_ndr/ndr_drsblobs.h" #include "libcli/cldap/cldap.h" #include "libcli/ldap/ldap_client.h" #include "torture/torture.h" @@ -104,7 +105,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx) our_bind_info28->supported_extensions = 0xFFFFFFFF; our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3; our_bind_info28->site_guid = GUID_zero(); - our_bind_info28->u1 = 0; + our_bind_info28->pid = 0; our_bind_info28->repl_epoch = 1; our_bind_info_ctr = &ctx->admin.drsuapi.our_bind_info_ctr; @@ -153,7 +154,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx) our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS; } our_bind_info28->site_guid = GUID_zero(); - our_bind_info28->u1 = 508; + our_bind_info28->pid = 0; our_bind_info28->repl_epoch = 0; our_bind_info_ctr = &ctx->new_dc.drsuapi.our_bind_info_ctr; @@ -210,13 +211,25 @@ static bool _test_DsBind(struct torture_context *tctx, info24 = &b->req.out.bind_info->info.info24; b->peer_bind_info28.supported_extensions= info24->supported_extensions; b->peer_bind_info28.site_guid = info24->site_guid; - b->peer_bind_info28.u1 = info24->u1; + b->peer_bind_info28.pid = info24->pid; b->peer_bind_info28.repl_epoch = 0; break; } + case 48: { + struct drsuapi_DsBindInfo48 *info48; + info48 = &b->req.out.bind_info->info.info48; + b->peer_bind_info28.supported_extensions= info48->supported_extensions; + b->peer_bind_info28.site_guid = info48->site_guid; + b->peer_bind_info28.pid = info48->pid; + b->peer_bind_info28.repl_epoch = info48->repl_epoch; + break; + } case 28: b->peer_bind_info28 = b->req.out.bind_info->info.info28; break; + default: + printf("DsBind - warning: unknown BindInfo length: %u\n", + b->req.out.bind_info->length); } } @@ -514,6 +527,8 @@ static void test_analyse_objects(struct torture_context *tctx, DEBUGADD(0,("ATTR: %s enc.length=%lu plain.length=%lu\n", name, (long)enc_data->length, (long)plain_data.length)); if (plain_data.length) { + enum ndr_err_code ndr_err; + struct supplementalCredentialsBlob scb; dump_data(0, plain_data.data, plain_data.length); if (save_values_dir) { char *fname; @@ -529,6 +544,13 @@ static void test_analyse_objects(struct torture_context *tctx, } talloc_free(fname); } + + ndr_err = ndr_pull_struct_blob_all(&plain_data, tctx, + lp_iconv_convenience(tctx->lp_ctx), &scb, + (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob); + if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + NDR_PRINT_DEBUG(supplementalCredentialsBlob, &scb); + } } else { dump_data(0, enc_data->data, enc_data->length); } diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 37d7d171ca..1329f03b04 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -540,8 +540,9 @@ int main(int argc,char *argv[]) const char *basedir = NULL; const char *extra_module = NULL; static int list_tests = 0; + int num_extra_users = 0; enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST, - OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS}; + OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS,OPT_EXTRA_USER}; struct poptOption long_options[] = { POPT_AUTOHELP @@ -569,6 +570,8 @@ int main(int argc,char *argv[]) "number of simultaneous async requests", NULL}, {"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, 0, "set maximum time for smbtorture to live", "seconds"}, + {"extra-user", 0, POPT_ARG_STRING, NULL, OPT_EXTRA_USER, + "extra user credentials", NULL}, POPT_COMMON_SAMBA POPT_COMMON_CONNECTION POPT_COMMON_CREDENTIALS @@ -612,6 +615,15 @@ int main(int argc,char *argv[]) case OPT_SMB_PORTS: lp_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc)); break; + case OPT_EXTRA_USER: + { + char *option = talloc_asprintf(NULL, "torture:extra_user%u", + ++num_extra_users); + char *value = poptGetOptArg(pc); + lp_set_cmdline(cmdline_lp_ctx, option, value); + talloc_free(option); + } + break; } } |