#!/usr/bin/python print "import start" from samba.dcerpc import drsblobs print "import 2" from samba.ndr import ndr_unpack, ndr_pack, ndr_print print "import done" import talloc def test1(): i=0 talloc.enable_null_tracking() talloc.report_full() saltstr = "salt" print "here: %s" % (i) talloc.report_full() print "here: %s" % (i) i=i+1 krb = drsblobs.package_PrimaryKerberosBlob() print "here: %s" % (i) talloc.report_full() print "here: %s" % (i) i=i+1 krb.version = 3 print "here: %s" % (i) talloc.report_full() print "here: %s" % (i) i=i+1 print ndr_print(krb) print "here: %s" % (i) talloc.report_full() print "here: %s" % (i) i=i+1 # this seems to generate temporary python objects for ctr and ctr.salt # but they're gone in the following # talloc.report_full() # # adding talloc_report_full(NULL, stdout); # add the end of # py_package_PrimaryKerberosString_set_string() # demonstrates that. # # you need this: # rm bin/default/librpc/gen_ndr/py_drsblobs*.o # rm bin/default/source4/librpc/python-dcerpc-drsblobs.so # krb.ctr.salt.string = saltstr print "here: %s" % (i) talloc.report_full() print "here: %s" % (i) i=i+1 # this generates valgrind errors, as we have # references to the deallocated ctr and ctr.salt and ctr.salt.string # objects print ndr_print(krb) print "here: %s" % (i) talloc.report_full() print "here: %s" % (i) i=i+1 return if __name__ == '__main__': test1()