summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-02-14 13:35:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:15 -0500
commit93690e31c358322e53e4110610476016d1b6f88c (patch)
tree1cde655643dce0d899c80c20c4c3896fbff0a998 /source4/torture
parent6496fab3b6a6bd6b53d8c4c9b4151c6d81dd2f85 (diff)
downloadsamba-93690e31c358322e53e4110610476016d1b6f88c.tar.gz
samba-93690e31c358322e53e4110610476016d1b6f88c.tar.bz2
samba-93690e31c358322e53e4110610476016d1b6f88c.zip
r21335: add dssync:save_pwd_blobs_dir=path/ option to store the password blobs
in files for inspection with ndrdump metze (This used to be commit 54748ef5860ee59b5f84855965c84aa8787fb4b6)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/dssync.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index c601b08248..eb90871c0e 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -417,10 +417,15 @@ static void test_analyse_objects(struct DsSyncTest *ctx,
const DATA_BLOB *gensec_skey,
struct drsuapi_DsReplicaObjectListItemEx *cur)
{
- if (!lp_parm_bool(-1,"dssync","print_pwd_blobs",False)) {
+ static uint32_t object_id;
+ const char *save_values_dir;
+
+ if (!lp_parm_bool(-1,"dssync","print_pwd_blobs", false)) {
return;
}
+ save_values_dir = lp_parm_string(-1,"dssync","save_pwd_blobs_dir");
+
for (; cur; cur = cur->next_object) {
const char *dn;
struct dom_sid *sid = NULL;
@@ -497,13 +502,28 @@ static void test_analyse_objects(struct DsSyncTest *ctx,
cur->object.identifier, rid,
enc_data);
if (!dn_printed) {
- DEBUG(0,("DN: %s\n", dn));
+ object_id++;
+ DEBUG(0,("DN[%u] %s\n", object_id, dn));
dn_printed = True;
}
DEBUGADD(0,("ATTR: %s enc.length=%lu plain.length=%lu\n",
name, (long)enc_data->length, (long)plain_data.length));
if (plain_data.length) {
dump_data(0, plain_data.data, plain_data.length);
+ if (save_values_dir) {
+ char *fname;
+ fname = talloc_asprintf(ctx, "%s/%s%02d",
+ save_values_dir,
+ name, object_id);
+ if (fname) {
+ bool ok;
+ ok = file_save(fname, plain_data.data, plain_data.length);
+ if (!ok) {
+ DEBUGADD(0,("Failed to save '%s'\n", fname));
+ }
+ }
+ talloc_free(fname);
+ }
} else {
dump_data(0, enc_data->data, enc_data->length);
}