summaryrefslogtreecommitdiff
path: root/lib/talloc
Commit message (Collapse)AuthorAgeFilesLines
* py3: Remove PyStr_FromFormat() compatability macroAndrew Bartlett2019-06-241-8/+2
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* lib/talloc: squash 'cast between incompatible function types' warningNoel Power2019-05-162-5/+12
| | | | | | | | | | To avoid warning above produced by using -Wcast-function-type we; + ensure PyCFunctions of type METH_NOARGS defined dummy arg Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* talloc torture: avoid NULL dereferenceDouglas Bagnall2019-05-091-1/+3
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* talloc: Follow pattern of ldb and tdb to ensure "make test" depends on a buildAndrew Bartlett2019-05-061-1/+7
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Spelling fix s/informations/information/Mathieu Parent2019-04-023-5/+5
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* pytalloc: Check for errors during module initialization.Kristján Valur2019-03-261-3/+13
| | | | | | Signed-off-by: Kristján Valur <kristjan@rvx.is> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytalloc: Handle memory errors when creating pytalloc objects.Kristján Valur2019-03-261-6/+23
| | | | | | | | Don't create superfluous exceptions. Signed-off-by: Kristján Valur <kristjan@rvx.is> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytalloc: Further refactoring to eliminate duplicate code.Kristján Valur2019-03-261-36/+34
| | | | | | Signed-off-by: Kristján Valur <kristjan@rvx.is> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytalloc: Refactor the pytalloc_reference and pytalloc_steal to use a common ↵Kristján Valur2019-03-262-57/+32
| | | | | | | | method. Signed-off-by: Kristján Valur <kristjan@rvx.is> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* talloc: Release talloc 2.2.0talloc-2.2.0Andrew Bartlett2019-03-214-2/+82
| | | | | | | | | | | * Remove pytalloc_CObject_FromTallocPtr() * Remove --extra-python (a build time mode to produce Python2 and Python3 bindings at the same time) * New minor version to allow Samba 4.10 to release a talloc if required from that branch Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* build: Standardise on calling conf.SAMBA_CHECK_PYTHON() in librariesAndrew Bartlett2019-03-211-10/+2
| | | | | | | | | | | | | We do this by removing the confusing mandatory option to conf.SAMBA_CHECK_PYTHON{,_HEADERS}(), instead just use the value of --disable-python internally This follows the default minimum of Python 3.4 and keeps things consistent with the main Samba build where --disable-python is required to skip building python bindings. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* build: Remove manual specification of minimum python versionAndrew Bartlett2019-03-211-1/+1
| | | | | | | We now used the default of 3.4 from conf.SAMBA_CHECK_PYTHON() Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* ABI: Remove unused .py3*.sigs filesAndrew Bartlett2019-03-2112-161/+0
| | | | | | | | These are no longer used by the build system so avoid confusion by removing them from the tree. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* build: Remove bld.gen_python_environments()Andrew Bartlett2019-03-211-15/+14
| | | | | | | This was part of --extra-python support. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* build: Remove --extra-pythonAndrew Bartlett2019-03-211-7/+0
| | | | | | | | | | | This option is quite invasive in waf and was mainly for the python3 transition. Testing with multiple python versions can be done by testing a full compile against multiple versions, likewise multiple different binding versions can be created the same way. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* pytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr()Andrew Bartlett2019-03-212-32/+0
| | | | | | | | This function makes it harder to remove the --extra-python handlers and is only provided for Python 2.x, support for which Samba is removing. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* talloc: Fix alignment issues for casting pointersAndreas Schneider2019-03-191-5/+25
| | | | | | | | | | | warning: cast from 'char *' to 'struct talloc_chunk *' increases required alignment from 1 to 8 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Mar 19 12:38:50 UTC 2019 on sn-devel-144
* talloc: version 2.1.16talloc-2.1.16Stefan Metzmacher2019-02-264-1/+97
| | | | | | * Fix standalone build of talloc. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Search for location of waf scriptDavid Mulder2019-02-261-1/+2
| | | | | | | | | | | | When calling make from the ldb, talloc, tdb, and tevent bundles, we need to first find the location of the waf script. Currently the build fails since it can't find waf. Fixes regression caused by a660b7f. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* talloc: version 2.1.15talloc-2.1.15Stefan Metzmacher2019-01-154-1/+97
| | | | | | | | | | | | | | * Deprecate talloc_set_memlimit() and talloc_autofree_context() * Fix undefined behavior in talloc_memdup * The build uses python3 by default: * --extra-python would take python2 now * To build with python2 only use: PYTHON=python2 ./configure PYTHON=python2 make PYTHON=python2 make install Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Karolin Seeger <kseeger@samba.org>
* PY3: change shebang to python3 in lib dirJoe Guo2018-12-141-1/+1
| | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* build: Move python detection back into waf (instead of in configure and ↵Andrew Bartlett2018-12-142-2/+1
| | | | | | | | | | | | | | | | | | | Makefile) This avoids creating a mini-configure in the configure script. Users wishing to use python2 to build need to specify PYTHON= to both ./configure and make After we merged the python3 change, it became clear that relying on systems prefixing the correct python just causes trouble and make debugging harder, so only use $PYTHON for the override, not the default case This essentially reverts a660b7fb8e519bd3be558fd0425bff8f287fca1f but leaves the files more consistent. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* build: Workaround python3 hash order issues (for now)Andrew Bartlett2018-12-131-1/+1
| | | | | | | | | | | This works around python3 having a new hash seed each time it starts to allow a second "make" not to rebuild the world. This should probably be reverted once we find the hash that is causing the issue, but should reduce frustration for now. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib:talloc: Fix undefined behavior in talloc_memdupAndreas Schneider2018-12-121-2/+7
| | | | | | | | lib/talloc/talloc.c:2419: runtime error: null pointer passed as argument 2, which is declared to never be null Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* PY3: switch current build to use python3Noel Power2018-12-102-2/+4
| | | | | | | | | | | | | | Make sure default make and configure for all now defaults to building with python3. To build a samba (or sub component e.g. talloc etc.) with python3 ./configure && make To build a samba (or sub component e.g. talloc etc.) with python2 PYTHON=python ./configure && PYTHON=python make Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: talloc: Mark talloc_autofree_context() as deprecated.Jeremy Allison2018-11-061-8/+9
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* talloc/test/pytalloc: remove unused importsDouglas Bagnall2018-10-251-1/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* talloc: deprecate talloc_set_memlimit()David Disseldorp2018-10-191-1/+11
| | | | | | | | The memlimit functionality was never utilized by Samba. It adds unneeded complexity, so flag it as deprecated. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* PY3: detect talloc_utils (for version of python running the build)Noel Power2018-09-161-2/+2
| | | | | | | | | | | | It seems all combinations have potential to fail here :/ however for the moment making the assumption * if python2 driving the build you are building against libpython2 (with the option of having python3 as 'extra-python' * if python3 driving the build you are building against libpython3 (with the option of having python3 as 'extra-python' NOTE: this isn't inforced it probably should be !!!! In a system with python2 and python3 installed it seems waf needs PYTHON env variable to decide which libpython to build against. It's also an option that configure should use that too (to figure out which talloc_util to use or build) However.... right now I just want the thing to build Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/talloc/wscript: update to handle waf 2.0.4Alexander Bokovoy2018-09-051-19/+17
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PEP8: fix E302: expected 2 blank lines, found 1Joe Guo2018-08-241-0/+2
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* talloc: version 2.1.14talloc-2.1.14Stefan Metzmacher2018-07-124-1/+97
| | | | | | | | | | * Fix some typos in the comments * Remove extra 0x prefix for the "%p" format specifiers, avoiding 0x0x0 strings in the output. * make sure we link extra-python versions of libraries Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* talloc: Fix some typos in the commentsKai Blin2018-05-281-2/+2
| | | | | | | | | | Now with even more typos fixed. Thanks Rowland. Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Mon May 28 16:16:17 CEST 2018 on sn-devel-144
* Remove extra 0x prefix for the "%p" format specifiers, avoiding 0x0x0 ↵Timur I. Bakeyev2018-05-161-1/+1
| | | | | | | | strings in the output. Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* wscript_build: make sure we link extra-python versions of librariesNoel Power2018-04-131-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* talloc: version 2.1.13talloc-2.1.13Stefan Metzmacher2018-04-054-1/+97
| | | | | | | | | | | * Use atexit() again instead of a library destructor (bug #13366) Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Apr 5 15:53:16 CEST 2018 on sn-devel-144
* talloc: use atexit() again instead of a library destructorStefan Metzmacher2018-04-051-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change for https://bugzilla.samba.org/show_bug.cgi?id=7587 ("talloc_autofree_context() in shared libraries and plugins is a bad idea on FreeBSD") (ommit 41b6810ba01f44537f470c806adb8686e1a39c48) causes the following for sssd on Linux: Stack trace of thread 19667: #0 0x00007f2cab91ff6b __GI_raise (libc.so.6) #1 0x00007f2cab90a5c1 __GI_abort (libc.so.6) #2 0x00007f2cab90a491 __assert_fail_base (libc.so.6) #3 0x00007f2cab9186e2 __GI___assert_fail (libc.so.6) #4 0x00007f2cb10aaca5 k5_mutex_lock (libkrb5.so.3) #5 0x00007f2cb10ab790 k5_mutex_lock (libkrb5.so.3) #6 0x00007f2cb10ab8f5 profile_free_file (libkrb5.so.3) #7 0x00007f2cb10ab983 profile_close_file (libkrb5.so.3) #8 0x00007f2cb10af249 profile_release (libkrb5.so.3) #9 0x00007f2cb10a06c7 k5_os_free_context (libkrb5.so.3) #10 0x00007f2cb1075a9a krb5_free_context (libkrb5.so.3) #11 0x000055cea7cb2dd1 kcm_data_destructor (sssd_kcm) #12 0x00007f2cac153e96 _tc_free_internal (libtalloc.so.2) #13 0x00007f2cac1537b0 _tc_free_internal (libtalloc.so.2) #14 0x00007f2cac1537b0 _tc_free_internal (libtalloc.so.2) #15 0x00007f2cac1537b0 _tc_free_internal (libtalloc.so.2) #16 0x00007f2cac1537b0 _tc_free_internal (libtalloc.so.2) #17 0x00007f2cac14e648 _talloc_free (libtalloc.so.2) #18 0x00007f2cac14c480 talloc_lib_fini (libtalloc.so.2) #19 0x00007f2cb151da96 _dl_fini (ld-linux-x86-64.so.2) #20 0x00007f2cab9226bc __run_exit_handlers (libc.so.6) #21 0x00007f2cab9227ec __GI_exit (libc.so.6) #22 0x00007f2cb030dc61 orderly_shutdown (libsss_util.so) #23 0x00007f2cac365a46 tevent_common_check_signal (libtevent.so.0) #24 0x00007f2cac367975 epoll_event_loop_once (libtevent.so.0) #25 0x00007f2cac365dab std_event_loop_once (libtevent.so.0) #26 0x00007f2cac362098 _tevent_loop_once (libtevent.so.0) #27 0x00007f2cac3622eb tevent_common_loop_wait (libtevent.so.0) #28 0x00007f2cac365d3b std_event_loop_wait (libtevent.so.0) #29 0x00007f2cb030eb37 server_loop (libsss_util.so) #30 0x000055cea7cb29f4 main (sssd_kcm) #31 0x00007f2cab90c1eb __libc_start_main (libc.so.6) #32 0x000055cea7cb2c7a _start (sssd_kcm) We still only register one atexit handler instead of multiple ones like in talloc 2.1.11, but avoids using a library destructor. Bug #7587 seems to be fixed by not using talloc_autofree_context() within samba. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13366 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* talloc: version 2.1.12talloc-2.1.12Stefan Metzmacher2018-03-214-1/+97
| | | | | | | | | | | | | * Fix documentation typo * Fix compilation with -Wstrict-overflow=2 * Use a library destructor instead of atexit() if available (bug #7587) Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Mar 21 18:39:33 CET 2018 on sn-devel-144
* talloc: use a library destructor instead of atexit() if availableStefan Metzmacher2018-03-211-28/+44
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7587 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* talloc: Fix size type and checks in _vasprintf_tcAndreas Schneider2018-03-211-3/+8
| | | | | | | This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* talloc: Fix documentation typoMartin Schwenke2018-01-221-1/+1
| | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Jan 22 11:11:38 CET 2018 on sn-devel-144
* talloc: version 2.1.11talloc-2.1.11Stefan Metzmacher2018-01-124-1/+97
| | | | | | | * disable-python - fix talloc wscript if bundling disabled * Do not disclose the random talloc magic in free()'ed memory Signed-off-by: Stefan Metzmacher <metze@samba.org>
* talloc: Do not disclose the random talloc magic in free()'ed memoryAndrew Bartlett2018-01-121-30/+88
| | | | | | | | | | | This may help us avoid exploits via memory read attacks on Samba by ensuring that if the read is on an invalid chunk that the talloc magic disclosed there is not useful to create a valid chunk and so set a destructor. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13211 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* talloc: Add tests to require use-after-free to give the correct ↵Andrew Bartlett2018-01-121-0/+68
| | | | | | | | | talloc_abort() string BUG: https://bugzilla.samba.org/show_bug.cgi?id=13210 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* talloc: Remove talloc_abort_magic()Andrew Bartlett2018-01-121-15/+5
| | | | | | | | | | | | | The check required for talloc_abort_magic() prevents the 'access after free error' from being printed. It is also no longer possible to determine the difference between invalid memory and a talloc version mismatch as the magic is now random on many platforms. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13210 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* waf: disable-python - fix talloc wscript if bundling disabledIan Stakenvicius2017-08-011-9/+12
| | | | | | | | | | | | | | | | | | The pytalloc-util dependency logic in lib/talloc/wscript on a standalone build checks for pytalloc-util in a manner that will fail if bundling is disabled, this causes issues on --disable-python builds of ldb, tevent, and samba. This patch restructures the logic to skip checks if python is disabled, instead just setting the temporary state variable 'using_system_pytalloc_util' to False Successfully tested patch on ldb-1.1.31 and above, tevent-0.9.33, and samba-4.7_rc3 Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* talloc: version 2.1.10talloc-2.1.10Stefan Metzmacher2017-07-214-1/+97
| | | | | | | * build, documentation and python3 improvements Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* talloc: Fix execution of test_magic_differs from tarballLukas Slebodnik2017-07-041-0/+2
| | | | | | | | | | | | make check failed in case of tarball because test_magic_differs.sh is in top level directory and not in sub-directory lib/talloc sh: ./lib/talloc/test_magic_differs.sh: No such file or directory magic differs test returned 127 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* talloc: Use libraries from build dir for testsuiteLukas Slebodnik2017-07-041-0/+4
| | | | | | | | | | | | | | | | | | There was a failure when tests were executed after after extracting talloc tarball. sh$ make -j8 check WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$PATH waf test bin/talloc_testsuite: error while loading shared libraries: libtalloc.so.2: cannot open shared object file: No such file or directory sh: ./lib/talloc/test_magic_differs.sh: No such file or directory Traceback (most recent call last): File "test_pytalloc.py", line 11, in <module> import talloc ImportError: libtalloc.so.2: cannot open shared object file: No such file or directory Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* waf: disable-python - align talloc's wscriptIan Stakenvicius2017-03-101-7/+5
| | | | | | | | | | | | | | | | | | | Drop the configure option for --disable-python as it is now global in wafsamba If samba is set to use a system copy of talloc, and talloc wasn't built with python support, then the system pytalloc-util will not be found. If samba is being built without python support then pytalloc-util is not needed, so do not bother to try and find it. The build configuration for pytalloc-util needs to exist even if it's not being built, so that dependency resolution can occur throughout the rest of the samba build system -- this required dropping the higher level conditional and using the enabled= parameter instead. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>