r10988: print out the password blobs, with
authorStefan Metzmacher <metze@samba.org>
Fri, 14 Oct 2005 06:58:39 +0000 (06:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:51 +0000 (13:39 -0500)
--option="dssync:print_pwd_blobs=yes"

metze

source/torture/rpc/dssync.c

index 77551998c3e8610af4669799a6cfc24698259a5c..3aa2f43e6b1802820481b809d09e4018818727f6 100644 (file)
@@ -269,6 +269,61 @@ static BOOL test_GetInfo(struct DsSyncTest *ctx)
        return ret;
 }
 
+static void test_analyse_objects(struct DsSyncTest *ctx,
+                                struct drsuapi_DsReplicaObjectListItemEx *cur)
+{
+       if (!lp_parm_bool(-1,"dssync","print_pwd_blobs",False)) {
+               return; 
+       }
+
+       for (; cur; cur = cur->next_object) {
+               const char *dn;
+               BOOL dn_printed = False;
+               uint32_t i;
+
+               if (!cur->object.identifier) continue;
+
+               dn = cur->object.identifier->dn;
+
+               for (i=0; i < cur->object.attribute_ctr.num_attributes; i++) {
+                       const char *name = NULL;
+                       DATA_BLOB *data = NULL;
+                       struct drsuapi_DsReplicaAttribute *attr;
+                       attr = &cur->object.attribute_ctr.attributes[i];
+
+                       switch (attr->attid) {
+                       case DRSUAPI_ATTRIBUTE_dBCSPwd:
+                               name    = "dBCSPwd";
+                               break;
+                       case DRSUAPI_ATTRIBUTE_unicodePwd:
+                               name    = "unicodePwd";
+                               break;
+                       case DRSUAPI_ATTRIBUTE_ntPwdHistory:
+                               name    = "ntPwdHistory";
+                               break;
+                       case DRSUAPI_ATTRIBUTE_lmPwdHistory:
+                               name    = "lmPwdHistory";
+                               break;
+                       default:
+                               continue;
+                       }
+
+                       if (attr->value_ctr.data_blob.num_values != 1) continue;
+
+                       if (!attr->value_ctr.data_blob.values[0].data) continue;
+
+                       data = attr->value_ctr.data_blob.values[0].data;
+
+                       if (!dn_printed) {
+                               DEBUG(0,("DN: %s\n", dn));
+                               dn_printed = True;
+                       }
+                       DEBUGADD(0,("ATTR: %s data_blob.length=%u\n",
+                                   name, data->length));
+                       dump_data(0,data->data, data->length);
+               }
+       }
+}
 
 static BOOL test_FetchData(struct DsSyncTest *ctx)
 {
@@ -419,6 +474,8 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
                                        ctr6->new_highwatermark.tmp_highest_usn,
                                        ctr6->new_highwatermark.highest_usn));
 
+                               test_analyse_objects(ctx, ctr6->first_object);
+
                                if (ctr6->new_highwatermark.tmp_highest_usn > ctr6->new_highwatermark.highest_usn) {
                                        r.in.req.req8.highwatermark = ctr6->new_highwatermark;
                                        continue;