sttid fixes (Re: [SCM] Samba Shared Repository - branch master updated)

Stefan Metzmacher metze at samba.org
Tue Mar 8 21:42:40 UTC 2016


Hi Andrew,

I just got this failure while trying to push the security patches to master.

[1897(19151)/1898 at 2h51m55s] samba4.blackbox.dbcheck(vampire_dc)
UNEXPECTED(failure):
samba4.blackbox.dbcheck(vampire_dc).dbcheck(vampire_dc:local)
REASON: Exception: Exception: Checking 7367 objects
ERROR: attributeID 0X5C000D is not known in our schema, not fixing
replPropertyMetaData on
CN=DrsReplSchema-1457451558-3-cls-B,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com

Please use --fix to fix these errors
Checked 7367 objects (1 errors)

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)

A summary with detailed information can be found in:
  ./bin/ab/summary
TOP 10 slowest tests

Please have a look.

Thanks!
metze

Am 08.03.2016 um 05:15 schrieb Andrew Bartlett:
> The branch, master has been updated
>        via  2041794 pytalloc: Correct description of pytalloc_Get{Base,}ObjectType behaviour
>        via  c79c1e4 dbcheck: Check for and remove duplicate values in attributes
>        via  13e62b2 selftest: Allow 4 hours for the test to run (ouch!)
>        via  8440dda pysmb: Use pytalloc_BaseObject_PyType_Ready()
>        via  c763253 pysmb: Do not use pytalloc_Object directly
>        via  05b99be pysmb: Rework py_smb_new() to use pytalloc_steal()
>        via  9a34a15 pysmb: Use pytalloc_get_mem_ctx()
>        via  a2013c3 pysmb: Use pytalloc_get_ptr()
>        via  6d348c4 pyregistry: Use pytalloc_BaseObject_PyType_Ready()
>        via  ffc7536 pyauth: Use pytalloc_BaseObject_PyType_Ready()
>        via  0f35167 pygensec: Use pytalloc_BaseObject_PyType_Ready()
>        via  ec5d63f pygensec: Use pytalloc_steal() in gensec_start_{client,server}()
>        via  43af190 pyparam: Use pytalloc_BaseObject_PyType_Ready()
>        via  0705aee py_passdb: Use pytalloc_BaseObject_PyType_Ready()
>        via  fc74753 pycredentials: Use pytalloc_BaseObject_PyType_Ready()
>        via  d850991 pytalloc: Add pytalloc_BaseObject_PyType_Ready() wrapper
>        via  d82b11b pyparam: Do not use pytalloc_Object directly
>        via  e622411 pypassdb: Do not use pytalloc_Object directly
>        via  7506321 pycredentials: Remove PyCredentialCacheContainerObject
>        via  fe4b990 pycredentials: Do not use pytalloc_Object directly
>        via  a7b242a selftest: dbcheck should not be marked flapping
>        via  c36b2d7 dbcheck: Avoid spurious warnings in dbcheck due to objectclass sorting
>        via  5fb98a3 dbcheck: Fix incorrect/duplicate attrid in replPropertMetaData
>        via  ac83f72 selftest: Update release-4-1-0rc3 with more test records
>        via  7397aa4 rpc_server/drsuapi: Block replication of incorrect/duplicate attrid in replPropertMetaData
>        via  ecf0dd4 repl_meta_data: Correctly use msDS-IntId for custom schema, not the prefixMap value
>        via  90bf114 pidl: Use a tmp_ctx helper variable
>        via  dffa2db pidl: Use the $mem_ctx helper variable
>        via  9e07f3a pidl: Fix our python reference handling
>        via  627fdf0 pyrpc: Clarify failure mode after pytalloc_reference_ex() improvements
>        via  d7bbcbc talloc: Bump version number
>        via  80f2b36 pytalloc: Add new BaseObject
>        via  528dce1 pytalloc: add a _pytalloc_get_type() helper function and generate PyExc_TypeError on mismatch
>        via  42eae4d talloc: add _pytalloc_get_ptr/_pytalloc_get_mem_ctx helper functions
>        via  cd8d930 talloc: Improve testsuite by avoiding path issues
>        via  623bf42 pyrpc: Add warning about abuse of py_return_ndr_struct()
>        via  b96b1e8 pydsdb: Fix returning of ldb.MessageElement.
>        via  02de793 pyldb: Add warning about pyldb_MessageElement_AsMessageElement()
>       from  0dbab0e libnet: make Kerberos domain join site-aware
> 
> https://git.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -----------------------------------------------------------------
> commit 20417945fed17a8f6ca2b0fc66c20890dc1f48b8
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 8 13:46:16 2016 +1300
> 
>     pytalloc: Correct description of pytalloc_Get{Base,}ObjectType behaviour
>     
>     Thanks to Jelmer for spotting the static variable that causes this odd behaviour
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
>     
>     Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
>     Autobuild-Date(master): Tue Mar  8 05:14:15 CET 2016 on sn-devel-144
> 
> commit c79c1e405d52c5dc54b8f03cd891e47f7ea04497
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Feb 23 14:57:04 2016 +1300
> 
>     dbcheck: Check for and remove duplicate values in attributes
>     
>     This can happen with three DCs and custom schema, but we test
>     it by just forcing the values directly into the backing tdb.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 13e62b2e350a21beefe871de64900fb78c5385f7
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Wed Mar 2 08:54:42 2016 +1300
> 
>     selftest: Allow 4 hours for the test to run (ouch!)
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 8440dda3cbc747f18148e52e6875055148438267
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 15:17:44 2016 +1300
> 
>     pysmb: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes pysmb to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit c763253f05aa07afc84bc27d2d8387f454edbded
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 15:08:26 2016 +1300
> 
>     pysmb: Do not use pytalloc_Object directly
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 05b99bed8cb4bf98de06fbbe19347efc049245c6
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 14:53:00 2016 +1300
> 
>     pysmb: Rework py_smb_new() to use pytalloc_steal()
>     
>     This avoids casting to pytalloc_Object directly
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 9a34a1567bb9b9f4f5dc3f28d05845ed13cf31a9
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 15:05:28 2016 +1300
> 
>     pysmb: Use pytalloc_get_mem_ctx()
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit a2013c3a5ab80283a4b95004e4d1606e0003a4a8
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 14:55:59 2016 +1300
> 
>     pysmb: Use pytalloc_get_ptr()
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 6d348c443a92dfe9bdad73d36c0303a765468870
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:33:48 2016 +1300
> 
>     pyregistry: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes pyregistry to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit ffc75363307a25c27dbdd52eb08bd54964416650
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:32:56 2016 +1300
> 
>     pyauth: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes pyauth to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 0f35167d767e4ace2295f3025110470504f160d3
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:32:06 2016 +1300
> 
>     pygensec: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes pygensec to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit ec5d63f9edcf311b581df4f37a702a54d659d443
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 14:19:33 2016 +1300
> 
>     pygensec: Use pytalloc_steal() in gensec_start_{client,server}()
>     
>     This is better than casting to get to the pytalloc_Object structure directly
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 43af1905d578ec6f374f1f67f72c37428ecd361f
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:31:00 2016 +1300
> 
>     pyparam: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes pyparam to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 0705aee099aa4961ad521c55f8c344f4e3a338ee
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:30:03 2016 +1300
> 
>     py_passdb: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes py_passdb to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit fc747539dc1219135face7d6f77c7174a9c978cd
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:27:11 2016 +1300
> 
>     pycredentials: Use pytalloc_BaseObject_PyType_Ready()
>     
>     This changes pycredentials to use talloc.BaseObject() just like the PIDL output
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit d850991ee2284050916761ea2f0ccac45df4eb4f
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 1 09:26:29 2016 +1300
> 
>     pytalloc: Add pytalloc_BaseObject_PyType_Ready() wrapper
>     
>     This avoids the need for the caller to set tp_base and tp_basicsize and
>     so removes those as possible errors.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit d82b11b21cb3905b112fc49956c98beb1cb79ed9
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Mon Feb 29 16:27:31 2016 +1300
> 
>     pyparam: Do not use pytalloc_Object directly
>     
>     This type should not be used directly, it should have been made private
>     to pytalloc.  This then allows removal of the (PyCFunction) cast
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit e622411c488772fd20e94d3e13aff2a0db0ecf13
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Mon Feb 29 16:27:12 2016 +1300
> 
>     pypassdb: Do not use pytalloc_Object directly
>     
>     This type should not be used directly, it should have been made private
>     to pytalloc.  This then allows removal of the (PyCFunction) cast
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 750632199641ff437585bc3a6835e282ce1d5395
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Mon Feb 29 16:26:08 2016 +1300
> 
>     pycredentials: Remove PyCredentialCacheContainerObject
>     
>     We can call pytalloc_reference() and avoid having this in the header file
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit fe4b990cbaf4c6b204c2d206f2a04ff5cd273f9f
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Mon Feb 22 14:10:23 2016 +1300
> 
>     pycredentials: Do not use pytalloc_Object directly
>     
>     This type should not be used directly, it should have been made private
>     to pytalloc
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit a7b242aa61429fc41449d2d8f3f96d3b76ff12a1
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Dec 22 19:49:54 2015 +1300
> 
>     selftest: dbcheck should not be marked flapping
>     
>     The primary cause of the flapping was due to the objectclass
>     sort routine being non-deterministic.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit c36b2d7fb8f10ec229bb8e6be3999ab83a26dc36
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Thu Dec 24 09:43:36 2015 +1300
> 
>     dbcheck: Avoid spurious warnings in dbcheck due to objectclass sorting
>     
>     BUG: https://bugzilla.samba.org/show_bug.cgi?id=11433
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 5fb98a3534a806331307a425d9469164e27d7ee7
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Dec 22 19:48:38 2015 +1300
> 
>     dbcheck: Fix incorrect/duplicate attrid in replPropertMetaData
>     
>     If custom schema is used in a replicated DC environment, these are created as soon as
>     an attribute is modified on more than one DC.  We have to remove these.
>     
>     BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit ac83f729bc80d02f042a337d9a06dfc4ef0632ac
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Wed Dec 23 13:16:57 2015 +1300
> 
>     selftest: Update release-4-1-0rc3 with more test records
>     
>     CN=ops_run_anything2,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp
>     
>     This will be modified during the dbcheck to show that new
>     versions of Samba will reset the attid correctly
>     
>     CN=ops_run_anything3,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp
>     
>     This will not be modified, and shows how a 4.1 DC without
>     replication would record custom schema objects.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 7397aa47fddca43b3b4931a961e6d8e742fdf181
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Dec 22 19:39:31 2015 +1300
> 
>     rpc_server/drsuapi: Block replication of incorrect/duplicate attrid in replPropertMetaData
>     
>     If custom schema is used in a replicated DC environment, these are created as soon as
>     an attribute is modified on more than one DC.  We have to prevent replication
>     as otherwise we will corrupt the client replica state.
>     
>     BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit ecf0dd49e07e2c7fad5adf0a82abbc3e301a4e5a
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Dec 22 19:33:39 2015 +1300
> 
>     repl_meta_data: Correctly use msDS-IntId for custom schema, not the prefixMap value
>     
>     We must, when dealing with custom schema, respect the msDC-IntId value recorded
>     in the schema.  If we do not, then we will create multiple replPropertyMetaData
>     records for the one attribute.  This may cause confusion during replication.
>     
>     This fixes the issue by always calling dsdb_attribute_get_attid() to obtain
>     the correct local (32 bit integer) attribute ID
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
>     BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
> 
> commit 90bf114f6370ee837d97e36eb25f38f8234dcd39
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Thu Feb 25 13:57:37 2016 +1300
> 
>     pidl: Use a tmp_ctx helper variable
>     
>     This is so we free the ndr_push_struct_blob() return value after
>     we make it into a string
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit dffa2dbfabca14f07af12663fc93c8dc3bc837cf
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Thu Feb 25 13:57:00 2016 +1300
> 
>     pidl: Use the $mem_ctx helper variable
>     
>     This is already set to pytalloc_get_mem_ctx(py_obj)
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 9e07f3a13b41be1f019887581b2a2bd049039a3d
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Feb 16 14:06:28 2016 +1300
> 
>     pidl: Fix our python reference handling
>     
>     The new talloc.BaseObject allow us to hold a talloc context per
>     python object (there may be many referring to the same C object)
>     and the talloc context that the actual object pointer is under.
>     
>     Another advantage is that talloc.BaseObject(), has less of
>     an ABI surface.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 627fdf0468e9f575ea1a5de1fd57a87a239a4b96
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 8 11:18:56 2016 +1300
> 
>     pyrpc: Clarify failure mode after pytalloc_reference_ex() improvements
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit d7bbcbc510c6ecfcd9db47c15203bbdd13d1c06e
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Feb 16 16:15:53 2016 +1300
> 
>     talloc: Bump version number
>     
>     The removal of the macros and replacement with proper functions
>     is a API, but not ABI break.  Only code that incorrectly
>     used the structure either in function signatures or
>     to access the members directly will need to be modified
>     before being built against this version of talloc.
>     
>     Andrew Bartlett
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 80f2b36efb6380defb646f7612f23c431acf8e1a
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Mon Feb 22 14:02:28 2016 +1300
> 
>     pytalloc: Add new BaseObject
>     
>     This new object not only avoids the ABI issues of talloc.Object
>     it stores one more pointer, being the start of the array, and
>     so can be used to fix the PIDL bindings/talloc refcount issue.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 528dce1b5326e00446f5fe233b8af52bcb1990a9
> Author: Stefan Metzmacher <metze at samba.org>
> Date:   Mon Feb 22 08:47:07 2016 +0100
> 
>     pytalloc: add a _pytalloc_get_type() helper function and generate PyExc_TypeError on mismatch
>     
>     Signed-off-by: Stefan Metzmacher <metze at samba.org>
>     Reviewed-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 42eae4dec6209aa5cae0d48f17f33c1ab67b6f03
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Mon Feb 22 14:29:15 2016 +1300
> 
>     talloc: add _pytalloc_get_ptr/_pytalloc_get_mem_ctx helper functions
>     
>     This allows us to check which type is involved, and dereference
>     that type correctly
>     
>     Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Signed-off-by: Stefan Metzmacher <metze at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit cd8d9300213dcdeb5bdfbbb7a71ae4b82e042470
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Feb 23 11:04:51 2016 +1300
> 
>     talloc: Improve testsuite by avoiding path issues
>     
>     We now rely on waf to tell us where the helper binary is.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 623bf4230c3458a266de7759d0ead07d986d6951
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 8 11:16:27 2016 +1300
> 
>     pyrpc: Add warning about abuse of py_return_ndr_struct()
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit b96b1e88f760c92c7d9bb7e732f72d7e73a68907
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Feb 16 15:15:44 2016 +1300
> 
>     pydsdb: Fix returning of ldb.MessageElement.
>     
>     This object is not based on pytalloc_Object and so this causes
>     a segfault (later a failure) when the struct definitions diverge.
>     We must also not reuse the incoming ldb_message_element as a talloc
>     context and overwrite the values, instead we should create a new
>     object and return that.
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> commit 02de793e013c1905cccc0c760bb64f45d37e3051
> Author: Andrew Bartlett <abartlet at samba.org>
> Date:   Tue Mar 8 10:39:24 2016 +1300
> 
>     pyldb: Add warning about pyldb_MessageElement_AsMessageElement()
>     
>     Signed-off-by: Andrew Bartlett <abartlet at samba.org>
>     Reviewed-by: Garming Sam <garming at catalyst.net.nz>
> 
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  auth/credentials/pycredentials.c                   |   164 +-
>  auth/credentials/pycredentials.h                   |     5 -
>  lib/ldb/pyldb.h                                    |     7 +
>  lib/talloc/ABI/pytalloc-util-2.1.6.sigs            |    13 +
>  lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs        |    12 +
>  .../ABI/{talloc-2.1.4.sigs => talloc-2.1.6.sigs}   |     0
>  lib/talloc/pytalloc.c                              |    86 +
>  lib/talloc/pytalloc.h                              |    23 +-
>  lib/talloc/pytalloc_guide.txt                      |    40 +-
>  .../auth/pyauth.h => lib/talloc/pytalloc_private.h |    25 +-
>  lib/talloc/pytalloc_util.c                         |   199 +-
>  lib/talloc/test_magic_differs.sh                   |    10 +-
>  lib/talloc/test_pytalloc.c                         |    83 +-
>  lib/talloc/test_pytalloc.py                        |    73 +-
>  lib/talloc/wscript                                 |     7 +-
>  pidl/lib/Parse/Pidl/Samba4/Python.pm               |    29 +-
>  python/samba/dbchecker.py                          |   160 +-
>  python/samba/tests/dcerpc/array.py                 |   171 +
>  python/samba/tests/dcerpc/rpc_talloc.py            |    14 +-
>  selftest/flapping                                  |     1 -
>  selftest/selftest.pl                               |     4 +-
>  source3/passdb/py_passdb.c                         |   232 +-
>  source4/auth/gensec/pygensec.c                     |    79 +-
>  source4/auth/pyauth.c                              |     7 +-
>  source4/dsdb/pydsdb.c                              |    49 +-
>  source4/dsdb/samdb/ldb_modules/repl_meta_data.c    |    55 +-
>  source4/dsdb/tests/python/ldap_schema.py           |    31 +-
>  source4/lib/registry/pyregistry.c                  |    17 +-
>  source4/libcli/pysmb.c                             |   116 +-
>  source4/librpc/rpc/pyrpc.c                         |     6 +-
>  source4/librpc/rpc/pyrpc_util.c                    |     3 +
>  source4/param/pyparam.c                            |    81 +-
>  source4/rpc_server/drsuapi/getncchanges.c          |    10 +
>  .../expected-otherphone-after-dbcheck.ldif         |     9 +
>  ...xpected-replpropertymetadata-after-dbcheck.ldif |    37 +-
>  ...ected-replpropertymetadata-after-dbcheck2.ldif} |   124 +-
>  ...ected-replpropertymetadata-after-dbcheck3.ldif} |   136 +-
>  ...pected-replpropertymetadata-before-dbcheck.ldif |    22 +-
>  ...ected-replpropertymetadata-before-dbcheck2.ldif |   102 +
>  ...cted-replpropertymetadata-before-dbcheck3.ldif} |   144 +-
>  .../forced-duplicate-value-for-dbcheck.ldif        |     9 +
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump | 29028 ++++++------
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump | 43448 +++++++++---------
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump |   916 +-
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump |   476 +-
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump |     8 +-
>  .../private/dns/sam.ldb.d/metadata.tdb.dump        |     8 +-
>  .../release-4-1-0rc3/private/dns/sam.ldb.dump      |    24 +-
>  .../release-4-1-0rc3/private/hklm.ldb.dump         |    68 +-
>  .../release-4-1-0rc3/private/idmap.ldb.dump        |    44 +-
>  .../release-4-1-0rc3/private/privilege.ldb.dump    |   152 +-
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump | 29104 ++++++------
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump | 43772 +++++++++----------
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump |   916 +-
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump |   476 +-
>  ...DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb.dump |  6040 +--
>  .../private/sam.ldb.d/metadata.tdb.dump            |     8 +-
>  .../release-4-1-0rc3/private/sam.ldb.dump          |    24 +-
>  .../release-4-1-0rc3/private/secrets.ldb.dump      |    32 +-
>  .../release-4-1-0rc3/private/share.ldb.dump        |    24 +-
>  .../release-4-1-0rc3/steps-to-reproduce.txt        |     3 +
>  .../provisions/release-4-1-0rc3/sudoers2-mod.ldif  |     4 +
>  .../provisions/release-4-1-0rc3/sudoers2.ldif      |    21 +
>  testprogs/blackbox/dbcheck-oldrelease.sh           |    82 +-
>  64 files changed, 79032 insertions(+), 78041 deletions(-)
>  create mode 100644 lib/talloc/ABI/pytalloc-util-2.1.6.sigs
>  create mode 100644 lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs
>  copy lib/talloc/ABI/{talloc-2.1.4.sigs => talloc-2.1.6.sigs} (100%)
>  copy source4/auth/pyauth.h => lib/talloc/pytalloc_private.h (73%)
>  create mode 100644 python/samba/tests/dcerpc/array.py
>  create mode 100644 source4/selftest/provisions/release-4-1-0rc3/expected-otherphone-after-dbcheck.ldif
>  copy source4/selftest/provisions/release-4-1-0rc3/{expected-replpropertymetadata-after-dbcheck.ldif => expected-replpropertymetadata-after-dbcheck2.ldif} (50%)
>  copy source4/selftest/provisions/release-4-1-0rc3/{expected-replpropertymetadata-after-dbcheck.ldif => expected-replpropertymetadata-after-dbcheck3.ldif} (51%)
>  create mode 100644 source4/selftest/provisions/release-4-1-0rc3/expected-replpropertymetadata-before-dbcheck2.ldif
>  copy source4/selftest/provisions/release-4-1-0rc3/{expected-replpropertymetadata-after-dbcheck.ldif => expected-replpropertymetadata-before-dbcheck3.ldif} (50%)
>  create mode 100644 source4/selftest/provisions/release-4-1-0rc3/forced-duplicate-value-for-dbcheck.ldif
>  create mode 100644 source4/selftest/provisions/release-4-1-0rc3/sudoers2-mod.ldif
>  create mode 100644 source4/selftest/provisions/release-4-1-0rc3/sudoers2.ldif
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
> index 5fc2a70..1344391 100644
> --- a/auth/credentials/pycredentials.c
> +++ b/auth/credentials/pycredentials.c
> @@ -37,26 +37,15 @@ static PyObject *PyString_FromStringOrNULL(const char *str)
>  
>  static PyObject *py_creds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
>  {
> -	pytalloc_Object *ret = (pytalloc_Object *)type->tp_alloc(type, 0);
> -	if (ret == NULL) {
> -		PyErr_NoMemory();
> -		return NULL;
> -	}
> -	ret->talloc_ctx = talloc_new(NULL);
> -	if (ret->talloc_ctx == NULL) {
> -		PyErr_NoMemory();
> -		return NULL;
> -	}
> -	ret->ptr = cli_credentials_init(ret->talloc_ctx);
> -	return (PyObject *)ret;
> +	return pytalloc_steal(type, cli_credentials_init(NULL));
>  }
>  
> -static PyObject *py_creds_get_username(pytalloc_Object *self)
> +static PyObject *py_creds_get_username(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_username(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_username(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_username(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -70,13 +59,13 @@ static PyObject *py_creds_set_username(pytalloc_Object *self, PyObject *args)
>  	return PyBool_FromLong(cli_credentials_set_username(PyCredentials_AsCliCredentials(self), newval, obt));
>  }
>  
> -static PyObject *py_creds_get_password(pytalloc_Object *self)
> +static PyObject *py_creds_get_password(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_password(PyCredentials_AsCliCredentials(self)));
>  }
>  
>  
> -static PyObject *py_creds_set_password(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_password(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -90,12 +79,12 @@ static PyObject *py_creds_set_password(pytalloc_Object *self, PyObject *args)
>  	return PyBool_FromLong(cli_credentials_set_password(PyCredentials_AsCliCredentials(self), newval, obt));
>  }
>  
> -static PyObject *py_creds_get_domain(pytalloc_Object *self)
> +static PyObject *py_creds_get_domain(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_domain(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_domain(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_domain(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -109,12 +98,12 @@ static PyObject *py_creds_set_domain(pytalloc_Object *self, PyObject *args)
>  	return PyBool_FromLong(cli_credentials_set_domain(PyCredentials_AsCliCredentials(self), newval, obt));
>  }
>  
> -static PyObject *py_creds_get_realm(pytalloc_Object *self)
> +static PyObject *py_creds_get_realm(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_realm(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_realm(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_realm(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -128,12 +117,12 @@ static PyObject *py_creds_set_realm(pytalloc_Object *self, PyObject *args)
>  	return PyBool_FromLong(cli_credentials_set_realm(PyCredentials_AsCliCredentials(self), newval, obt));
>  }
>  
> -static PyObject *py_creds_get_bind_dn(pytalloc_Object *self)
> +static PyObject *py_creds_get_bind_dn(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_bind_dn(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_bind_dn(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_bind_dn(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	if (!PyArg_ParseTuple(args, "s", &newval))
> @@ -142,12 +131,12 @@ static PyObject *py_creds_set_bind_dn(pytalloc_Object *self, PyObject *args)
>  	return PyBool_FromLong(cli_credentials_set_bind_dn(PyCredentials_AsCliCredentials(self), newval));
>  }
>  
> -static PyObject *py_creds_get_workstation(pytalloc_Object *self)
> +static PyObject *py_creds_get_workstation(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_workstation(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_workstation(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_workstation(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -161,33 +150,33 @@ static PyObject *py_creds_set_workstation(pytalloc_Object *self, PyObject *args)
>  	return PyBool_FromLong(cli_credentials_set_workstation(PyCredentials_AsCliCredentials(self), newval, obt));
>  }
>  
> -static PyObject *py_creds_is_anonymous(pytalloc_Object *self)
> +static PyObject *py_creds_is_anonymous(PyObject *self, PyObject *unused)
>  {
>  	return PyBool_FromLong(cli_credentials_is_anonymous(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_anonymous(pytalloc_Object *self)
> +static PyObject *py_creds_set_anonymous(PyObject *self, PyObject *unused)
>  {
>  	cli_credentials_set_anonymous(PyCredentials_AsCliCredentials(self));
>  	Py_RETURN_NONE;
>  }
>  
> -static PyObject *py_creds_authentication_requested(pytalloc_Object *self)
> +static PyObject *py_creds_authentication_requested(PyObject *self, PyObject *unused)
>  {
>          return PyBool_FromLong(cli_credentials_authentication_requested(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_wrong_password(pytalloc_Object *self)
> +static PyObject *py_creds_wrong_password(PyObject *self, PyObject *unused)
>  {
>          return PyBool_FromLong(cli_credentials_wrong_password(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_cmdline_callbacks(pytalloc_Object *self)
> +static PyObject *py_creds_set_cmdline_callbacks(PyObject *self, PyObject *unused)
>  {
>          return PyBool_FromLong(cli_credentials_set_cmdline_callbacks(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_parse_string(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_parse_string(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -202,20 +191,24 @@ static PyObject *py_creds_parse_string(pytalloc_Object *self, PyObject *args)
>  	Py_RETURN_NONE;
>  }
>  
> -static PyObject *py_creds_get_nt_hash(pytalloc_Object *self)
> +static PyObject *py_creds_get_nt_hash(PyObject *self, PyObject *unused)
>  {
> -	const struct samr_Password *ntpw = cli_credentials_get_nt_hash(PyCredentials_AsCliCredentials(self), self->ptr);
> +	PyObject *ret;
> +	struct cli_credentials *creds = PyCredentials_AsCliCredentials(self);
> +	struct samr_Password *ntpw = cli_credentials_get_nt_hash(creds, creds);
>  
> -	return PyString_FromStringAndSize(discard_const_p(char, ntpw->hash), 16);
> +	ret = PyString_FromStringAndSize(discard_const_p(char, ntpw->hash), 16);
> +	TALLOC_FREE(ntpw);
> +	return ret;
>  }
>  
> -static PyObject *py_creds_get_kerberos_state(pytalloc_Object *self)
> +static PyObject *py_creds_get_kerberos_state(PyObject *self, PyObject *unused)
>  {
>  	int state = cli_credentials_get_kerberos_state(PyCredentials_AsCliCredentials(self));
>  	return PyInt_FromLong(state);
>  }
>  
> -static PyObject *py_creds_set_kerberos_state(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_kerberos_state(PyObject *self, PyObject *args)
>  {
>  	int state;
>  	if (!PyArg_ParseTuple(args, "i", &state))
> @@ -225,7 +218,7 @@ static PyObject *py_creds_set_kerberos_state(pytalloc_Object *self, PyObject *ar
>  	Py_RETURN_NONE;
>  }
>  
> -static PyObject *py_creds_set_krb_forwardable(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_krb_forwardable(PyObject *self, PyObject *args)
>  {
>  	int state;
>  	if (!PyArg_ParseTuple(args, "i", &state))
> @@ -236,12 +229,12 @@ static PyObject *py_creds_set_krb_forwardable(pytalloc_Object *self, PyObject *a
>  }
>  
>  
> -static PyObject *py_creds_get_forced_sasl_mech(pytalloc_Object *self)
> +static PyObject *py_creds_get_forced_sasl_mech(PyObject *self, PyObject *unused)
>  {
>  	return PyString_FromStringOrNULL(cli_credentials_get_forced_sasl_mech(PyCredentials_AsCliCredentials(self)));
>  }
>  
> -static PyObject *py_creds_set_forced_sasl_mech(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_forced_sasl_mech(PyObject *self, PyObject *args)
>  {
>  	char *newval;
>  	enum credentials_obtained obt = CRED_SPECIFIED;
> @@ -256,7 +249,7 @@ static PyObject *py_creds_set_forced_sasl_mech(pytalloc_Object *self, PyObject *
>  	Py_RETURN_NONE;
>  }
>  
> -static PyObject *py_creds_guess(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_guess(PyObject *self, PyObject *args)
>  {
>  	PyObject *py_lp_ctx = Py_None;
>  	struct loadparm_context *lp_ctx;
> @@ -287,7 +280,7 @@ static PyObject *py_creds_guess(pytalloc_Object *self, PyObject *args)
>  	Py_RETURN_NONE;
>  }
>  
> -static PyObject *py_creds_set_machine_account(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_machine_account(PyObject *self, PyObject *args)
>  {
>  	PyObject *py_lp_ctx = Py_None;
>  	struct loadparm_context *lp_ctx;
> @@ -322,24 +315,11 @@ static PyObject *py_creds_set_machine_account(pytalloc_Object *self, PyObject *a
>  
>  static PyObject *PyCredentialCacheContainer_from_ccache_container(struct ccache_container *ccc)
>  {
> -	PyCredentialCacheContainerObject *py_ret;
> -
> -	if (ccc == NULL) {
> -		Py_RETURN_NONE;
> -	}
> -
> -	py_ret = (PyCredentialCacheContainerObject *)PyCredentialCacheContainer.tp_alloc(&PyCredentialCacheContainer, 0);
> -	if (py_ret == NULL) {
> -		PyErr_NoMemory();
> -		return NULL;
> -	}
> -	py_ret->mem_ctx = talloc_new(NULL);
> -	py_ret->ccc = talloc_reference(py_ret->mem_ctx, ccc);
> -	return (PyObject *)py_ret;
> +	return pytalloc_reference(&PyCredentialCacheContainer, ccc);
>  }
>  
>  
> -static PyObject *py_creds_get_named_ccache(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_get_named_ccache(PyObject *self, PyObject *args)
>  {
>  	PyObject *py_lp_ctx = Py_None;
>  	char *ccache_name;
> @@ -385,7 +365,7 @@ static PyObject *py_creds_get_named_ccache(pytalloc_Object *self, PyObject *args
>  	return NULL;
>  }
>  
> -static PyObject *py_creds_set_gensec_features(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_set_gensec_features(PyObject *self, PyObject *args)
>  {
>  	unsigned int gensec_features;
>  
> @@ -397,7 +377,7 @@ static PyObject *py_creds_set_gensec_features(pytalloc_Object *self, PyObject *a
>  	Py_RETURN_NONE;
>  }
>  
> -static PyObject *py_creds_get_gensec_features(pytalloc_Object *self, PyObject *args)
> +static PyObject *py_creds_get_gensec_features(PyObject *self, PyObject *args)
>  {
>  	unsigned int gensec_features;
>  
> @@ -407,71 +387,71 @@ static PyObject *py_creds_get_gensec_features(pytalloc_Object *self, PyObject *a
>  
>  
>  static PyMethodDef py_creds_methods[] = {
> -	{ "get_username", (PyCFunction)py_creds_get_username, METH_NOARGS,
> +	{ "get_username", py_creds_get_username, METH_NOARGS,
>  		"S.get_username() -> username\nObtain username." },
> -	{ "set_username", (PyCFunction)py_creds_set_username, METH_VARARGS,
> +	{ "set_username", py_creds_set_username, METH_VARARGS,
>  		"S.set_username(name, obtained=CRED_SPECIFIED) -> None\n"
>  		"Change username." },
> -	{ "get_password", (PyCFunction)py_creds_get_password, METH_NOARGS,
> +	{ "get_password", py_creds_get_password, METH_NOARGS,
>  		"S.get_password() -> password\n"
>  		"Obtain password." },
> -	{ "set_password", (PyCFunction)py_creds_set_password, METH_VARARGS,
> +	{ "set_password", py_creds_set_password, METH_VARARGS,
>  		"S.set_password(password, obtained=CRED_SPECIFIED) -> None\n"
>  		"Change password." },
> -	{ "get_domain", (PyCFunction)py_creds_get_domain, METH_NOARGS,
> +	{ "get_domain", py_creds_get_domain, METH_NOARGS,
>  		"S.get_domain() -> domain\n"
>  		"Obtain domain name." },
> -	{ "set_domain", (PyCFunction)py_creds_set_domain, METH_VARARGS,
> +	{ "set_domain", py_creds_set_domain, METH_VARARGS,
>  		"S.set_domain(domain, obtained=CRED_SPECIFIED) -> None\n"
>  		"Change domain name." },
> -	{ "get_realm", (PyCFunction)py_creds_get_realm, METH_NOARGS,
> +	{ "get_realm", py_creds_get_realm, METH_NOARGS,
>  		"S.get_realm() -> realm\n"
>  		"Obtain realm name." },
> -	{ "set_realm", (PyCFunction)py_creds_set_realm, METH_VARARGS,
> +	{ "set_realm", py_creds_set_realm, METH_VARARGS,
>  		"S.set_realm(realm, obtained=CRED_SPECIFIED) -> None\n"
>  		"Change realm name." },
> -	{ "get_bind_dn", (PyCFunction)py_creds_get_bind_dn, METH_NOARGS,
> +	{ "get_bind_dn", py_creds_get_bind_dn, METH_NOARGS,
>  		"S.get_bind_dn() -> bind dn\n"
>  		"Obtain bind DN." },
> -	{ "set_bind_dn", (PyCFunction)py_creds_set_bind_dn, METH_VARARGS,
> +	{ "set_bind_dn", py_creds_set_bind_dn, METH_VARARGS,
>  		"S.set_bind_dn(bind_dn) -> None\n"
>  		"Change bind DN." },
> -	{ "is_anonymous", (PyCFunction)py_creds_is_anonymous, METH_NOARGS,
> +	{ "is_anonymous", py_creds_is_anonymous, METH_NOARGS,
>  		NULL },
> -	{ "set_anonymous", (PyCFunction)py_creds_set_anonymous, METH_NOARGS,
> +	{ "set_anonymous", py_creds_set_anonymous, METH_NOARGS,
>          	"S.set_anonymous() -> None\n"
>  		"Use anonymous credentials." },
> -	{ "get_workstation", (PyCFunction)py_creds_get_workstation, METH_NOARGS,
> +	{ "get_workstation", py_creds_get_workstation, METH_NOARGS,
>  		NULL },
> -	{ "set_workstation", (PyCFunction)py_creds_set_workstation, METH_VARARGS,
> +	{ "set_workstation", py_creds_set_workstation, METH_VARARGS,
>  		NULL },
> -	{ "authentication_requested", (PyCFunction)py_creds_authentication_requested, METH_NOARGS,
> +	{ "authentication_requested", py_creds_authentication_requested, METH_NOARGS,
>  		NULL },
> -	{ "wrong_password", (PyCFunction)py_creds_wrong_password, METH_NOARGS,
> +	{ "wrong_password", py_creds_wrong_password, METH_NOARGS,
>  		"S.wrong_password() -> bool\n"
>  		"Indicate the returned password was incorrect." },
> -	{ "set_cmdline_callbacks", (PyCFunction)py_creds_set_cmdline_callbacks, METH_NOARGS,
> +	{ "set_cmdline_callbacks", py_creds_set_cmdline_callbacks, METH_NOARGS,
>  		"S.set_cmdline_callbacks() -> bool\n"
>  		"Use command-line to obtain credentials not explicitly set." },
> -	{ "parse_string", (PyCFunction)py_creds_parse_string, METH_VARARGS,
> +	{ "parse_string", py_creds_parse_string, METH_VARARGS,
>  		"S.parse_string(text, obtained=CRED_SPECIFIED) -> None\n"
>  		"Parse credentials string." },
> -	{ "get_nt_hash", (PyCFunction)py_creds_get_nt_hash, METH_NOARGS,
> +	{ "get_nt_hash", py_creds_get_nt_hash, METH_NOARGS,
>  		NULL },
> -	{ "get_kerberos_state", (PyCFunction)py_creds_get_kerberos_state, METH_NOARGS,
> +	{ "get_kerberos_state", py_creds_get_kerberos_state, METH_NOARGS,
>  		NULL },
> -	{ "set_kerberos_state", (PyCFunction)py_creds_set_kerberos_state, METH_VARARGS,
> +	{ "set_kerberos_state", py_creds_set_kerberos_state, METH_VARARGS,
>  		NULL },
> -	{ "set_krb_forwardable", (PyCFunction)py_creds_set_krb_forwardable, METH_VARARGS,
> +	{ "set_krb_forwardable", py_creds_set_krb_forwardable, METH_VARARGS,
>  		NULL },
> -	{ "guess", (PyCFunction)py_creds_guess, METH_VARARGS, NULL },
> -	{ "set_machine_account", (PyCFunction)py_creds_set_machine_account, METH_VARARGS, NULL },
> -	{ "get_named_ccache", (PyCFunction)py_creds_get_named_ccache, METH_VARARGS, NULL },
> -	{ "set_gensec_features", (PyCFunction)py_creds_set_gensec_features, METH_VARARGS, NULL },
> -	{ "get_gensec_features", (PyCFunction)py_creds_get_gensec_features, METH_NOARGS, NULL },
> -	{ "get_forced_sasl_mech", (PyCFunction)py_creds_get_forced_sasl_mech, METH_NOARGS,
> +	{ "guess", py_creds_guess, METH_VARARGS, NULL },
> +	{ "set_machine_account", py_creds_set_machine_account, METH_VARARGS, NULL },
> +	{ "get_named_ccache", py_creds_get_named_ccache, METH_VARARGS, NULL },
> +	{ "set_gensec_features", py_creds_set_gensec_features, METH_VARARGS, NULL },
> +	{ "get_gensec_features", py_creds_get_gensec_features, METH_NOARGS, NULL },
> +	{ "get_forced_sasl_mech", py_creds_get_forced_sasl_mech, METH_NOARGS,
>  		"S.get_forced_sasl_mech() -> SASL mechanism\nObtain forced SASL mechanism." },
> -	{ "set_forced_sasl_mech", (PyCFunction)py_creds_set_forced_sasl_mech, METH_VARARGS,
> +	{ "set_forced_sasl_mech", py_creds_set_forced_sasl_mech, METH_VARARGS,
>  		"S.set_forced_sasl_mech(name) -> None\n"
>  		"Set forced SASL mechanism." },
>  	{ NULL }
> @@ -479,7 +459,6 @@ static PyMethodDef py_creds_methods[] = {
>  
>  PyTypeObject PyCredentials = {
>  	.tp_name = "credentials.Credentials",
> -	.tp_basicsize = sizeof(pytalloc_Object),
>  	.tp_new = py_creds_new,
>  	.tp_flags = Py_TPFLAGS_DEFAULT,
>  	.tp_methods = py_creds_methods,
> @@ -488,23 +467,16 @@ PyTypeObject PyCredentials = {
>  
>  PyTypeObject PyCredentialCacheContainer = {
>  	.tp_name = "credentials.CredentialCacheContainer",
> -	.tp_basicsize = sizeof(pytalloc_Object),
>  	.tp_flags = Py_TPFLAGS_DEFAULT,
>  };
>  
>  void initcredentials(void)
>  {
>  	PyObject *m;
> -	PyTypeObject *talloc_type = pytalloc_GetObjectType();
> -	if (talloc_type == NULL)
> -		return;
> -
> -	PyCredentials.tp_base = PyCredentialCacheContainer.tp_base = talloc_type;
> -
> -	if (PyType_Ready(&PyCredentials) < 0)
> +	if (pytalloc_BaseObject_PyType_Ready(&PyCredentials) < 0)
>  		return;
>  
> -	if (PyType_Ready(&PyCredentialCacheContainer) < 0)
> +	if (pytalloc_BaseObject_PyType_Ready(&PyCredentialCacheContainer) < 0)
>  		return;
>  
>  	m = Py_InitModule3("credentials", NULL, "Credentials management.");
> diff --git a/auth/credentials/pycredentials.h b/auth/credentials/pycredentials.h
> index 3a110fb..a136a21 100644
> --- a/auth/credentials/pycredentials.h
> +++ b/auth/credentials/pycredentials.h
> @@ -24,11 +24,6 @@
>  
>  extern PyTypeObject PyCredentials;
>  extern PyTypeObject PyCredentialCacheContainer;
> -typedef struct {
> -	PyObject_HEAD
> -	TALLOC_CTX *mem_ctx;
> -	struct ccache_container *ccc;
> -} PyCredentialCacheContainerObject;
>  #define PyCredentials_Check(py_obj) PyObject_TypeCheck(py_obj, &PyCredentials)
>  #define PyCredentials_AsCliCredentials(py_obj) pytalloc_get_type(py_obj, struct cli_credentials)
>  #define cli_credentials_from_py_object(py_obj) (py_obj == Py_None)?cli_credentials_init_anon(NULL):PyCredentials_AsCliCredentials(py_obj)
> diff --git a/lib/ldb/pyldb.h b/lib/ldb/pyldb.h
> index f8aea22..e0cce1e 100644
> --- a/lib/ldb/pyldb.h
> +++ b/lib/ldb/pyldb.h
> @@ -60,11 +60,18 @@ typedef struct {
>  } PyLdbModuleObject;
>  #define pyldb_Module_AsModule(pyobj) ((PyLdbModuleObject *)pyobj)->mod
>  
> +/*
> + * NOTE: el (and so the return value of
> + * pyldb_MessageElement_AsMessageElement()) may not be a valid talloc
> + * context, it could be part of an array
> + */
> +
>  typedef struct {
>  	PyObject_HEAD
>  	TALLOC_CTX *mem_ctx;
>  	struct ldb_message_element *el;
>  } PyLdbMessageElementObject;
> +
>  #define pyldb_MessageElement_AsMessageElement(pyobj) ((PyLdbMessageElementObject *)pyobj)->el
>  
>  typedef struct {
> diff --git a/lib/talloc/ABI/pytalloc-util-2.1.6.sigs b/lib/talloc/ABI/pytalloc-util-2.1.6.sigs
> new file mode 100644
> index 0000000..666fec0
> --- /dev/null
> +++ b/lib/talloc/ABI/pytalloc-util-2.1.6.sigs
> @@ -0,0 +1,13 @@
> +_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
> +_pytalloc_get_ptr: void *(PyObject *)
> +_pytalloc_get_type: void *(PyObject *, const char *)
> +pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
> +pytalloc_BaseObject_check: int (PyObject *)
> +pytalloc_BaseObject_size: size_t (void)
> +pytalloc_CObject_FromTallocPtr: PyObject *(void *)
> +pytalloc_Check: int (PyObject *)
> +pytalloc_GetBaseObjectType: PyTypeObject *(void)
> +pytalloc_GetObjectType: PyTypeObject *(void)
> +pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
> +pytalloc_steal: PyObject *(PyTypeObject *, void *)
> +pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
> diff --git a/lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs b/lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs
> new file mode 100644
> index 0000000..4410f11
> --- /dev/null
> +++ b/lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs
> @@ -0,0 +1,12 @@
> +_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
> +_pytalloc_get_ptr: void *(PyObject *)
> +_pytalloc_get_type: void *(PyObject *, const char *)
> +pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
> +pytalloc_BaseObject_check: int (PyObject *)
> +pytalloc_BaseObject_size: size_t (void)
> +pytalloc_Check: int (PyObject *)
> +pytalloc_GetBaseObjectType: PyTypeObject *(void)
> +pytalloc_GetObjectType: PyTypeObject *(void)
> +pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
> +pytalloc_steal: PyObject *(PyTypeObject *, void *)
> +pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
> diff --git a/lib/talloc/ABI/talloc-2.1.4.sigs b/lib/talloc/ABI/talloc-2.1.6.sigs
> similarity index 100%
> copy from lib/talloc/ABI/talloc-2.1.4.sigs
> copy to lib/talloc/ABI/talloc-2.1.6.sigs
> diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
> index 3afae9c..74349da 100644
> --- a/lib/talloc/pytalloc.c
> +++ b/lib/talloc/pytalloc.c
> @@ -20,6 +20,7 @@
>  #include <Python.h>
>  #include <talloc.h>
>  #include <pytalloc.h>
> +#include "pytalloc_private.h"
>  
>  static PyTypeObject TallocObject_Type;
>  
> @@ -157,6 +158,86 @@ static PyTypeObject TallocObject_Type = {
>  #endif
>  };
>  
> +/**
> + * Default (but only slightly more useful than the default) implementation of Repr().
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logs.tar.gz
Type: application/gzip
Size: 677363 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160308/7f4e887b/logs.tar-0001.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160308/7f4e887b/signature-0001.sig>


More information about the samba-technical mailing list