def save_uptodate_vectors(self, samdb, partitions): """Ensures the UTDV used by DRS is correct after an offline backup""" for nc in partitions: # load the replUpToDateVector we *should* have utdv = _dsdb_load_udv_v2(samdb, nc) # convert it to NDR format and write it into the DB utdv_blob = drsblobs.replUpToDateVectorBlob() utdv_blob.version = 2 utdv_blob.ctr.cursors = utdv utdv_blob.ctr.count = len(utdv) new_value = ndr_pack(utdv_blob) m = ldb.Message() m.dn = ldb.Dn(samdb, nc) m["replUpToDateVector"] = ldb.MessageElement(new_value, ldb.FLAG_MOD_REPLACE, "replUpToDateVector") samdb.modify(m)
if krb5_new_hex is not None: krb5_new_raw = binascii.a2b_hex(krb5_new_hex) krb5_new = ndr_unpack(drsblobs.package_PrimaryKerberosBlob, krb5_new_raw, allow_remaining=True) #print '%s' % ndr_print(krb5_new) obj_item = obj_item.next_object gls.print_all() if ctr.more_data == 0: store_hwm = ctr.new_highwatermark store_utdv = drsblobs.replUpToDateVectorBlob() store_utdv.version = ctr.uptodateness_vector.version store_utdv_ctr = store_utdv.ctr store_utdv_ctr.count = ctr.uptodateness_vector.count store_utdv_ctr.cursors = ctr.uptodateness_vector.cursors store_utdv.ctr = store_utdv_ctr #print "%s" % ndr_print(store_hwm) #print "%s" % ndr_print(store_utdv) store_hwm_blob = ndr_pack(store_hwm) store_utdv_blob = ndr_pack(store_utdv) # # uint32_t version '1' # uint32_t dn_str_len
krb5_new_hex = pkg.data if krb5_new_hex is not None: krb5_new_raw = binascii.a2b_hex(krb5_new_hex) krb5_new = ndr_unpack(drsblobs.package_PrimaryKerberosBlob, krb5_new_raw, allow_remaining=True) #print '%s' % ndr_print(krb5_new) obj_item = obj_item.next_object gls.print_all() if ctr.more_data == 0: store_hwm = ctr.new_highwatermark store_utdv = drsblobs.replUpToDateVectorBlob() store_utdv.version = ctr.uptodateness_vector.version store_utdv_ctr = store_utdv.ctr store_utdv_ctr.count = ctr.uptodateness_vector.count store_utdv_ctr.cursors = ctr.uptodateness_vector.cursors store_utdv.ctr = store_utdv_ctr #print "%s" % ndr_print(store_hwm) #print "%s" % ndr_print(store_utdv) store_hwm_blob = ndr_pack(store_hwm) store_utdv_blob = ndr_pack(store_utdv) # # uint32_t version '1' # uint32_t dn_str_len