The branch, master has been updated via 7142a88 waf: disable-python - don't include python.h in test_headers.c via 4455547 autobuild: Add nopython environment to test --disable-python builds (but without tests) via 7000fa0 waf: disable-python - don't build torture bits via dbf97e8 waf: disable-python - don't build samba-policy via fa82998 waf: disable-python - don't build samba-net via 7eeda99 waf: disable-python - don't build pyrpc_util, dcerpc.py via 696d2f7 waf: disable-python - don't build PROVISION, pyparam_util via 676e80b waf: disable-python - don't build python/ via 81ff0f3 waf: disable-python - align tdb's wscript via b45ff0b waf: disable-python - align tevent wscript via ce956be waf: disable-python - align ldb's wscript via dcba0b1 waf: disable-python - align talloc's wscript via 7d5db90 waf: disable-python - configuration adjustments via 5bbcd09 waf: disable-python - add option globally to build system via 9a9e342 waf: disable-python - fix ctdb configuration via 8ba2fe5 python: Port the samba.net module to Python 3 via 0d83cec python: Remove unused import PY3 via 4ebd877 python: selftest: Add possibility to run old Python test suites with Python 3 via 64bc64c python: samba.gensec: Port module to Python 3 compatible form via 0672fc1 python: samba.gensec: Fix error handling in set_credentials() function via d0914e2 python: selftests: Enable samba.getopt tests execution with Python 3 via 9ada914 python: samba.getopt: Port module to Python 3 compatible form via da71c39 python: samba.tests.core: Port and enable core tests in Python 3 via afe1e83 python: samba.tests: Move import of ported modules out of PY3 condition via e9a4649 python: samba._ldb: Port of samba._ldb to Python 3 compatible form via 9d8bcea python: samba.tests.auth: Add tests for samba.auth module via 1ac5bf2 python: samba.auth: Port samba.auth to Python 3 compatible form via 47b0148 python: wscript_build: Build some DCE/RPC modules with Python 3 via a40d7f1 python: samba.dcerpc: Port security module to Python 3 comp. form via e481aed dcerpc/misc tests: asset GUID ordering in python 2 and 3 via 9843cce python: samba.tests.dcerpc.misc: Port and enable tests via 3b1c0ba python: samba.dcerpc: Port RPC related stuff to Python 3 via 2de5fa4 python: pidl: Port Python interface generator via 5edb0b4 python: samba.tests: Enable Python 3 tests for ported modules via b7a5308 buildtools: Work around a . being in the target name when building python3 helpers via fe8bba5 python: wscript_build: Build some modules for Python 3 via 6fa125e python: Make top-level samba modules Python 3 compatible via 211df4a python: samba.tests.dcerpc: Move Class RawDCERPCTest to separated file. via 9c55bb9 python: samba.tests.glue: Add new tests for samba._glue. via b454b09 python: samba._glue: Port samba._glue module to Python 3. via 5123f15 python: samba.tests.param: Add missing tests via 31cef92 python: samba.param: Port param module to Python 3 via 035e6dc python: samba.tests.credentials: Python 3 compatible tests via 1dab2b4 python: samba.credentials: Port pycredentials.c to Python3-compatible form. via 583ff0a lib/ldb: Enable use of a python3 pyldb-util system library via f5cafee talloc: use the system pytalloc-util for python3 as well via 132cbad scripts/traffic_summary: documentation typo via 4485ba5 ./examples/scripts/SambaConfig.py: fix typo in "continue" via d424c7d python/examples/winreg: two variable name typos on a single line via b7cd0f2 python sites/subnets: correctly spell variable name via cedb991 python provision: FDSBackend takes forced uri via b9c5614 python/remove_dc: avoid using non-existent variable via 732233f samba-tool domain: correctly spell variable name via 495383c python/join: correct spelling of "ctx.del_noerror" via 0779d66 selftest: remove unused broken client.py via 765275c gitignore: add some hidden files via 17dce5d perftests/ad_dc_search: do less work in expensive member searches via bb4ad8d pyldb: p3k readiness: allow single unicode string in msg element from 2772fa4 talloc: fix doxygen of talloc_move
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 7142a884419ae9940ba0429f9d117b94aff699b5 Author: Ian Stakenvicius <a...@gentoo.org> Date: Mon Jan 30 10:11:46 2017 -0500 waf: disable-python - don't include python.h in test_headers.c Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abart...@samba.org> Autobuild-Date(master): Fri Mar 10 11:24:13 CET 2017 on sn-devel-144 commit 4455547204fd5d2d54944468c404f751279c495d Author: Andrew Bartlett <abart...@samba.org> Date: Mon Jan 30 09:36:31 2017 -0500 autobuild: Add nopython environment to test --disable-python builds (but without tests) This ensures we keep this option building as we extend our use of python. The rule is that new features and changes to existing features that require python are most welcome, they just need to be disabled for the minimalistic targets we still ecourage Samba on, that typically just want smbd Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 7000fa01f8844450e020c84af85c7e1eb228b982 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 22:53:39 2017 -0500 waf: disable-python - don't build torture bits samba-net being disabled causes a chain of dependency or proto.h-based missing code issues that require a number of modules or subsystems to be disabled in samba4/torture. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit dbf97e8d5ed45e16a35d0118002b666c6ee8ec26 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 21:32:22 2017 -0500 waf: disable-python - don't build samba-policy samba-policy requires samba-net which requires PROVISION, which is disabled when python isn't available. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit fa829986dea06a578b891133f96e9b6b02d81088 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 21:31:21 2017 -0500 waf: disable-python - don't build samba-net samba-net requires PROVISION, which is disabled when python isn't available. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 7eeda992ac65cc5cc9d87378343fcdd5b8a50a16 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 17:04:18 2017 -0500 waf: disable-python - don't build pyrpc_util, dcerpc.py Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 696d2f785083ec949a2cdd210a60962a031b0090 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 16:49:29 2017 -0500 waf: disable-python - don't build PROVISION, pyparam_util Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 676e80bb5f560e77dc6b01eea3c9e37066c5aad2 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 16:38:36 2017 -0500 waf: disable-python - don't build python/ Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 81ff0f306523079396e8538d5cbff7e9f008f062 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 14:42:05 2017 -0500 waf: disable-python - align tdb's wscript Drop the configure option for --disable-python as it is now global in wafsamba. If samba is set to use a system copy of tdb, and tdb wasn't built with python support, then the system pytevent will not be found. If samba is being built without python support then pytdb is not needed, so do not bother to try and find it. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit b45ff0bcf9ed4a9e393ab7bcb2ac6657dd1f5dfe Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 14:37:39 2017 -0500 waf: disable-python - align tevent wscript Drop the configure option for --disable-python as it is now global in wafsamba. If samba is set to use a system copy of tevent, and tevent wasn't built with python support, then the system pytevent will not be found. If samba is being built without python support then pytevent is not needed, so do not bother to try and find it. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit ce956be075a626f68b13df772a919c883185d858 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 14:34:25 2017 -0500 waf: disable-python - align ldb's wscript If samba is set to use a system copy of ldb, and ldb wasn't built with python support, then no system pyldb-util will be found. If samba is being built without python support then pyldb-util isn not needed, so do not bother to try and find it. The system ldb check had to be duplicated due to the earlier commits which changed order of ldb and pyldb-util checks, and by association also added a dependency of pyldb-util onto ldb. This seemed cleaner than messing with variables. The build configuration for pyldb-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 <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit dcba0b19757b64164577722976b3da7622ff3955 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 14:27:50 2017 -0500 waf: disable-python - align talloc's wscript 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 <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 7d5db908509ffa099fa4b2ce7351e6bf7d1c06e2 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 14:07:21 2017 -0500 waf: disable-python - configuration adjustments Adjust configuration to accomodate when --disable-python is set: - Error when AD-DC is still enabled (and others later as needed) - Set mandatory=false on SAMBA_CHECK_PYTHON_HEADERS Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 5bbcd09382a65f9fb86b446bfbaf58a9b6e13aa1 Author: Ian Stakenvicius <a...@gentoo.org> Date: Fri Jan 27 13:28:01 2017 -0500 waf: disable-python - add option globally to build system This commit adds --disable-python as an option to the build system. It adds PYTHON_BUILD_IS_ENABLED() to bld, to be used with enabled= on other modules, and adjusts SAMBA_PYTHON() to set enabled=False if PYTHON_BUILD_IS_ENABLED() is false. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 9a9e3423d8c7be6350cba20cb6001fc14d47d336 Author: Ian Stakenvicius <a...@gentoo.org> Date: Thu Feb 23 10:16:25 2017 -0500 waf: disable-python - fix ctdb configuration When ctdb is built in standalone mode, it turned off the python requirement for submodules by setting Options.options.disable_python to True before checking for its own (non-optional) python support. Ad ctdb does not need python for itself or any of the submodules it is built against, the safest solution seems to be to allow the python and python-headers checks to not find python. Signed-off-by: Ian Stakenvicius <a...@gentoo.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 8ba2fe54dea3e99da7f9b18557d9d31aed3ff7d0 Author: Petr Viktorin <pvikt...@redhat.com> Date: Mon Jan 23 20:34:08 2017 +0100 python: Port the samba.net module to Python 3 Signed-off-by: Petr Viktorin <pvikt...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 0d83cec7c9cbf4ed84c5ee96eb460fbf1623418e Author: Andrew Bartlett <abart...@samba.org> Date: Thu Feb 9 16:16:10 2017 +1300 python: Remove unused import PY3 Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 4ebd877ec0447f9ecf44c43e5dce01d895995f9d Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Jan 17 11:05:44 2017 +0100 python: selftest: Add possibility to run old Python test suites with Python 3 Add possibility to execute old Python test suites with Python 3 and enable tests with Python 3 of ported samba.gensec module. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 64bc64ce647164e3544bfdd231c3f2d1239d2ca3 Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Jan 17 13:20:38 2017 +0100 python: samba.gensec: Port module to Python 3 compatible form Port samba.gensec and samba.tests.gensec modules to Python 3 compatible form, enable execution of tests with Python 3 and remove unused import of samba.gensec from samba.tests module __init__.py file. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 0672fc145aad731c8771746d1d7c9881b48e3522 Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Jan 30 14:18:46 2017 +0100 python: samba.gensec: Fix error handling in set_credentials() function Add `return NULL;` to error handling part of `set_credentials()` function. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit d0914e271305d48cfdf6908ee46a1e8a56aefa0a Author: Lumir Balhar <lbal...@redhat.com> Date: Wed Jan 18 10:44:08 2017 +0100 python: selftests: Enable samba.getopt tests execution with Python 3 Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 9ada914f9075ef7e255fe3386f4bafb6f77275f6 Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Jan 17 11:03:17 2017 +0100 python: samba.getopt: Port module to Python 3 compatible form Port samba.getopt module to Python 3 compatible form. Remove unused and untested `get_hostconfig()` function. Andrew Bartlett suggested this removal because it is the simpliest way how to break a long dependency line of Python modules which have to be ported at once. More info: https://lists.samba.org/archive/samba-technical/2017-January/118150.html Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit da71c39f46581023834e129d13ab4663493c224d Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Jan 2 14:10:29 2017 +0100 python: samba.tests.core: Port and enable core tests in Python 3 Port samba core tests to Python 3 compatible form and enable their execution with Python 3. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit afe1e830de28e3ab223e71d20edff6967d888460 Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Jan 2 08:52:29 2017 +0100 python: samba.tests: Move import of ported modules out of PY3 condition Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit e9a464911cc7eeb226a2ff86268ae5ef379cc162 Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Jan 2 08:51:19 2017 +0100 python: samba._ldb: Port of samba._ldb to Python 3 compatible form Port of samba._ldb Python module to Python 3 compatible form. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 9d8bcead4f4e60209fad0b68faafad9d7f18d41e Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Jan 2 14:39:17 2017 +0100 python: samba.tests.auth: Add tests for samba.auth module Add some tests which test that `system_session` object has correct attributes and methods. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 1ac5bf21a1efdc74d377feff74f15021c69e009e Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Dec 20 10:57:13 2016 +0100 python: samba.auth: Port samba.auth to Python 3 compatible form Port samba.auth Python module to Python 3 compatible form and enable tests execution with Python 3. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 47b014899aa7de4e9f23f937c3419599723e596e Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Dec 20 10:54:24 2016 +0100 python: wscript_build: Build some DCE/RPC modules with Python 3 Samba.auth Python module depends on a lot of DCE/RPC modules which have to be built with Python 3 to make port of samba.auth to Python 3 possible. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit a40d7f18dd9e6a83d07731c409aa865f5e0e9aaf Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Dec 20 10:53:23 2016 +0100 python: samba.dcerpc: Port security module to Python 3 comp. form Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit e481aed28da8687812ad2aed6efaaba26c65d500 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Fri Mar 10 15:48:38 2017 +1300 dcerpc/misc tests: asset GUID ordering in python 2 and 3 Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 9843ccef878ba473db68dbbd2a6b89d5a3369f88 Author: Lumir Balhar <lbal...@redhat.com> Date: Wed Jan 18 11:38:55 2017 +0100 python: samba.tests.dcerpc.misc: Port and enable tests Port tests of samba.dcerpc.misc module to Python 3 compatible form and enable their execution with Python 3. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 3b1c0ba98a8497172d2124e8555e1c504781b8f9 Author: Lumir Balhar <lbal...@redhat.com> Date: Wed Feb 15 09:19:33 2017 +0100 python: samba.dcerpc: Port RPC related stuff to Python 3 Port RPC related stuff like samba.dcerpc.misc and samba.dcerpc Python modules and pyrpc_util to Python 3 compatible form. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Pair-programmed-by: Andrew Bartlett <abart...@samba.org> commit 2de5fa45e0abfdb50f604f87e494bf334c39003a Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Jan 23 21:03:17 2017 +0100 python: pidl: Port Python interface generator Port PIDL generator of Python interfaces to generate interfaces in Python 3 compatible form. Python 2.7 is now required, so we can use PyCapsule in both versions. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Pair-programmed-by: Andrew Bartlett <abart...@samba.org> commit 5edb0b4ebd599ae83cebf591cc7f05a60f635a93 Author: Lumir Balhar <lbal...@redhat.com> Date: Sat Dec 10 15:11:14 2016 +0100 python: samba.tests: Enable Python 3 tests for ported modules Enable tests with Python 3 for Python 3 compatible modules. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit b7a53086120efb8185f2fe65b2db884d1ae1c2ef Author: Andrew Bartlett <abart...@samba.org> Date: Thu Feb 9 15:07:39 2017 +1300 buildtools: Work around a . being in the target name when building python3 helpers The pyparam_util module becomes pyparam_util.cpython_35m_x86_64_linux_gnu but the command line parser for -D stops at the first . That we even set -DSTATIC_subsystem_MODULES_PROTO for these subsystems without any modules ever declared is left for another time Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit fe8bba5f8174b81eb4fe660f3250b9222498f9b7 Author: Lumir Balhar <lbal...@redhat.com> Date: Sat Dec 10 15:01:17 2016 +0100 python: wscript_build: Build some modules for Python 3 Update a few wscript_build files to build Python 3-compatible modules for Python 3. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 6fa125e121c1216d89d8bafd7da894d49c1d6527 Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Dec 13 11:26:53 2016 +0100 python: Make top-level samba modules Python 3 compatible New file compat.py will help with porting to Python 3. For now, it contains only PY3 variable based on six.PY3 which simplifies condition mentioned below. The added `if not PY3` conditions enable us to bootstrap running tests with Python 3 even if most modules are not ported yet. The plan is to move modules outside this condition as they are ported. The `PY3` condition is currently used only in tests and for the samba._ldb module which is not ported yet and has a lot of dependencies. The other changes are related to differences between Python 2 and 3. Python 2.6 introduced the `0o` prefix for octal literals as an alternative to plain `0`. In Python 3, support for plain `0` is dropped and octal literals have to start with `0o` prefix. Python 2.6 introduced a clearer `except` syntax: `except ExceptionType as target:` instead of `except ExceptionType, target:`. In Python 3, the old syntax is no longer allowed. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 211df4a1e46977fc197c4a86e28faa0b46e1f73f Author: Lumir Balhar <lbal...@redhat.com> Date: Thu Sep 8 09:05:22 2016 +0200 python: samba.tests.dcerpc: Move Class RawDCERPCTest to separated file. The class is quite big, used in only one place, and it complicates situation around bootstrapping of Python 3 port. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 9c55bb9f657268de20e86222a57f4cbce73f8f27 Author: Lumir Balhar <lbal...@redhat.com> Date: Tue Dec 13 11:20:42 2016 +0100 python: samba.tests.glue: Add new tests for samba._glue. Add new file with tests of samba._glue module. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit b454b0903c876f1cbc9447610ea243bf7ef2ea1e Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Dec 5 12:14:28 2016 +0100 python: samba._glue: Port samba._glue module to Python 3. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 5123f15072db698228b1e32e474bc7b6419326f4 Author: Lumir Balhar <lbal...@redhat.com> Date: Sat Dec 10 14:11:04 2016 +0100 python: samba.tests.param: Add missing tests Add some new tests of samba.param Python bindings. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 31cef92cd3332ed674373b0de8526a4ab850d5d3 Author: Lumir Balhar <lbal...@redhat.com> Date: Sat Dec 10 13:55:43 2016 +0100 python: samba.param: Port param module to Python 3 Port Python bindings of samba.param module to Python3-compatible form. Because native Python file objects are officially no longer backed by FILE*, API of some _dump() functions is changed. File argument is now optional and contains only name of file. Stdout is default if no file name is specified. Otherwise opening and closing files is done on C layer instead of Python. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 035e6dce4f4bf1363e7928797021feb0e6ec2fc2 Author: Lumir Balhar <lbal...@redhat.com> Date: Wed Jan 18 11:28:08 2017 +0100 python: samba.tests.credentials: Python 3 compatible tests Port test of pycredentials to Python 3 compatible form. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 1dab2b493ea5a267024dadb5715a02ce53edf630 Author: Lumir Balhar <lbal...@redhat.com> Date: Mon Oct 17 16:07:31 2016 +0200 python: samba.credentials: Port pycredentials.c to Python3-compatible form. Port Python bindings of samba.credentials module to Python3-compatible form using macros from py3compat.h. Signed-off-by: Lumir Balhar <lbal...@redhat.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 583ff0a0e384f391f9969c606fc287064b846935 Author: Andrew Bartlett <abart...@samba.org> Date: Mon Mar 6 22:23:35 2017 +1300 lib/ldb: Enable use of a python3 pyldb-util system library To do this, we have to install a .pc file for the python3 pyldb-util Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Incorportaing fixes by Petr Viktorin <pvikt...@redhat.com> Signed-off-by: Petr Viktorin <pvikt...@redhat.com> commit f5cafee0c7a96396798d2b229ff3f9dced1d74f3 Author: Andrew Bartlett <abart...@samba.org> Date: Mon Mar 6 19:25:13 2017 +1300 talloc: use the system pytalloc-util for python3 as well This involves installing a .pc file for the python3 library as well To get the .pc file generated and installed is quite a mission, we have to rework the talloc build system to ensure that the second 'env' created for EXTRA_PYTHON has everything set up on it, the TALLOC_VERSION in particular. Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Incorportaing fixes by Petr Viktorin <pvikt...@redhat.com> Signed-off-by: Petr Viktorin <pvikt...@redhat.com> commit 132cbad9ce6372525581f8115ec4cba92b910b42 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Wed Mar 1 17:33:09 2017 +1300 scripts/traffic_summary: documentation typo Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 4485ba5f3cc0d4d86540a3093f7b1e684a801b59 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 15:13:32 2017 +1300 ./examples/scripts/SambaConfig.py: fix typo in "continue" Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit d424c7d5af0d36380b6a9d3046a542a70324e713 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 15:11:08 2017 +1300 python/examples/winreg: two variable name typos on a single line Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit b7cd0f2843f8695c087dc542358ac6ea0016a1d9 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 14:55:32 2017 +1300 python sites/subnets: correctly spell variable name Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit cedb991e6f43a02af075dbf6187f0cde92d69008 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 14:54:58 2017 +1300 python provision: FDSBackend takes forced uri Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit b9c56142b52c6b3912132d250d7a8d2a3aed0c3b Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 14:53:46 2017 +1300 python/remove_dc: avoid using non-existent variable Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abart...@samba.org> commit 732233ff3dd135f1645c6e7854f8911bdd6979eb Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 14:51:27 2017 +1300 samba-tool domain: correctly spell variable name Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 495383c9a6af305d623f31bf9c190e3ae4fab847 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 14:50:14 2017 +1300 python/join: correct spelling of "ctx.del_noerror" Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 0779d6671830ed24d871b9d4806b1141134cad5f Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Thu Mar 9 14:47:50 2017 +1300 selftest: remove unused broken client.py Nothing uses this, and pyflakes points out it is unusable: ./selftest/client.py:60: undefined name 'prefix_abs' ./selftest/client.py:69: undefined name 'opts' ./selftest/client.py:70: undefined name 'interfaces' Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 765275ce9ac764f714c77758b3ea8024d53ebabe Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Wed Mar 8 17:04:55 2017 +1300 gitignore: add some hidden files .gdb_history is generated by gdb, .emacs* are generated by emacs, and .clang* by clang. Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 17dce5d84fae8247f65cd6202e731af4acd2bde7 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Fri Mar 10 11:14:48 2017 +1300 perftests/ad_dc_search: do less work in expensive member searches Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit bb4ad8dffea3c6e462f1055bd51fceed80a84952 Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Date: Wed Jan 11 12:18:15 2017 +1300 pyldb: p3k readiness: allow single unicode string in msg element Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> ----------------------------------------------------------------------- Summary of changes: .gitignore | 3 + .travis.yml | 1 + auth/credentials/pycredentials.c | 24 +- auth/credentials/wscript_build | 12 +- buildtools/wafsamba/pkgconfig.py | 12 +- buildtools/wafsamba/samba_deps.py | 1 + buildtools/wafsamba/samba_python.py | 30 +- buildtools/wafsamba/wafsamba.py | 9 +- buildtools/wafsamba/wscript | 10 + ctdb/wscript | 4 +- examples/scripts/shares/python/SambaConfig.py | 2 +- lib/ldb-samba/pyldb.c | 24 +- lib/ldb-samba/wscript_build | 10 +- lib/ldb/pyldb-util.pc.in | 4 +- lib/ldb/pyldb.c | 11 +- lib/ldb/wscript | 51 +- lib/talloc/pytalloc-util.pc.in | 4 +- lib/talloc/wscript | 56 +- lib/tdb/wscript | 9 +- lib/tevent/wscript | 9 +- pidl/lib/Parse/Pidl/Samba4/Python.pm | 57 +- python/examples/winreg.py | 2 +- python/pyglue.c | 31 +- python/samba/__init__.py | 27 +- .../samba/{tests/dcerpc/__init__.py => compat.py} | 10 +- python/samba/getopt.py | 8 +- python/samba/join.py | 2 +- python/samba/netcmd/domain.py | 2 +- python/samba/netcmd/sites.py | 2 +- python/samba/netcmd/testparm.py | 7 +- python/samba/provision/__init__.py | 6 +- python/samba/provision/backend.py | 9 +- python/samba/remove_dc.py | 4 +- python/samba/tests/__init__.py | 859 +-------------------- python/samba/tests/auth.py | 29 +- python/samba/tests/core.py | 4 +- python/samba/tests/credentials.py | 26 +- python/samba/tests/dcerpc/misc.py | 14 +- python/samba/tests/dcerpc/raw_protocol.py | 2 +- .../tests/{__init__.py => dcerpc/raw_testcase.py} | 366 +-------- python/samba/tests/gensec.py | 36 +- python/samba/tests/glue.py | 74 ++ python/samba/tests/param.py | 46 +- python/wscript_build | 21 +- script/autobuild.py | 18 +- script/traffic_summary.pl | 2 +- selftest/client.py | 80 -- selftest/selftesthelpers.py | 4 +- selftest/tests.py | 13 +- source4/auth/gensec/pygensec.c | 58 +- source4/auth/gensec/wscript_build | 14 +- source4/auth/pyauth.c | 46 +- source4/auth/wscript_build | 16 +- .../dsdb/tests/python/ad_dc_search_performance.py | 10 +- source4/lib/policy/wscript_build | 3 +- source4/libnet/py_net.c | 31 +- source4/libnet/wscript_build | 16 +- source4/librpc/ndr/py_misc.c | 46 +- source4/librpc/ndr/py_security.c | 40 +- source4/librpc/rpc/dcerpc.py | 2 +- source4/librpc/rpc/pyrpc.c | 49 +- source4/librpc/rpc/pyrpc_util.c | 3 +- source4/librpc/wscript_build | 146 ++-- source4/param/pyparam.c | 119 ++- source4/param/pyparam_util.c | 7 +- source4/param/wscript_build | 27 +- source4/selftest/tests.py | 10 +- source4/torture/drs/wscript_build | 3 +- source4/torture/local/wscript_build | 3 +- source4/torture/wscript_build | 28 +- testsuite/headers/test_headers.c | 4 +- wscript | 6 +- 72 files changed, 981 insertions(+), 1753 deletions(-) copy python/samba/{tests/dcerpc/__init__.py => compat.py} (76%) copy python/samba/tests/{__init__.py => dcerpc/raw_testcase.py} (74%) create mode 100644 python/samba/tests/glue.py delete mode 100644 selftest/client.py Changeset truncated at 500 lines: diff --git a/.gitignore b/.gitignore index 46c01af..1a43d43 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ semantic.cache .testrepository /bin/.confcache/*/* /bin/.conf_check_*/* +/.emacs.desktop* +/.gdb_history +.clang-format diff --git a/.travis.yml b/.travis.yml index 483ad50..ce0e745 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: - TASK=samba-libs - TASK=samba-static - TASK=samba-o3 + - TASK=samba-nopython - TASK=ldb - TASK=tdb - TASK=talloc diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index 6da64a6..3bac26d 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -17,6 +17,7 @@ */ #include <Python.h> +#include "python/py3compat.h" #include "includes.h" #include "pycredentials.h" #include "param/param.h" @@ -32,7 +33,7 @@ static PyObject *PyString_FromStringOrNULL(const char *str) { if (str == NULL) Py_RETURN_NONE; - return PyString_FromString(str); + return PyStr_FromString(str); } static PyObject *py_creds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) @@ -335,7 +336,7 @@ static PyObject *py_creds_get_nt_hash(PyObject *self, PyObject *unused) struct cli_credentials *creds = PyCredentials_AsCliCredentials(self); struct samr_Password *ntpw = cli_credentials_get_nt_hash(creds, creds); - ret = PyString_FromStringAndSize(discard_const_p(char, ntpw->hash), 16); + ret = PyBytes_FromStringAndSize(discard_const_p(char, ntpw->hash), 16); TALLOC_FREE(ntpw); return ret; } @@ -623,6 +624,14 @@ static PyMethodDef py_creds_methods[] = { { NULL } }; +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + .m_name = "credentials", + .m_doc = "Credentials management.", + .m_size = -1, + .m_methods = py_creds_methods, +}; + PyTypeObject PyCredentials = { .tp_name = "credentials.Credentials", .tp_new = py_creds_new, @@ -636,18 +645,18 @@ PyTypeObject PyCredentialCacheContainer = { .tp_flags = Py_TPFLAGS_DEFAULT, }; -void initcredentials(void) +MODULE_INIT_FUNC(credentials) { PyObject *m; if (pytalloc_BaseObject_PyType_Ready(&PyCredentials) < 0) - return; + return NULL; if (pytalloc_BaseObject_PyType_Ready(&PyCredentialCacheContainer) < 0) - return; + return NULL; - m = Py_InitModule3("credentials", NULL, "Credentials management."); + m = PyModule_Create(&moduledef); if (m == NULL) - return; + return NULL; PyModule_AddObject(m, "UNINITIALISED", PyInt_FromLong(CRED_UNINITIALISED)); PyModule_AddObject(m, "CALLBACK", PyInt_FromLong(CRED_CALLBACK)); @@ -668,4 +677,5 @@ void initcredentials(void) PyModule_AddObject(m, "Credentials", (PyObject *)&PyCredentials); Py_INCREF(&PyCredentialCacheContainer); PyModule_AddObject(m, "CredentialCacheContainer", (PyObject *)&PyCredentialCacheContainer); + return m; } diff --git a/auth/credentials/wscript_build b/auth/credentials/wscript_build index 009f5ec..30c0f72 100644 --- a/auth/credentials/wscript_build +++ b/auth/credentials/wscript_build @@ -24,9 +24,9 @@ bld.SAMBA_SUBSYSTEM('CREDENTIALS_NTLM', source='credentials_ntlm.c', deps='samba-credentials') -bld.SAMBA_PYTHON('pycredentials', - source='pycredentials.c', - public_deps='samba-credentials cmdline-credentials pytalloc-util pyparam_util CREDENTIALS_KRB5 CREDENTIALS_SECRETS', - realname='samba/credentials.so' - ) - +for env in bld.gen_python_environments(): + bld.SAMBA_PYTHON('pycredentials', + source='pycredentials.c', + public_deps='samba-credentials cmdline-credentials pytalloc-util pyparam_util CREDENTIALS_KRB5 CREDENTIALS_SECRETS', + realname='samba/credentials.so' + ) diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py index 25cec78..999bad4 100644 --- a/buildtools/wafsamba/pkgconfig.py +++ b/buildtools/wafsamba/pkgconfig.py @@ -38,16 +38,20 @@ def subst_at_vars(task): return 0 -def PKG_CONFIG_FILES(bld, pc_files, vnum=None): +def PKG_CONFIG_FILES(bld, pc_files, vnum=None, extra_name=None): '''install some pkg_config pc files''' dest = '${PKGCONFIGDIR}' dest = bld.EXPAND_VARIABLES(dest) for f in TO_LIST(pc_files): - base=os.path.basename(f) + if extra_name: + target = f.split('.pc')[0] + extra_name + ".pc" + else: + target = f + base=os.path.basename(target) t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base, rule=subst_at_vars, source=f+'.in', - target=f) + target=target) bld.add_manual_dependency(bld.path.find_or_declare(f), bld.env['PREFIX']) t.vars = [] if t.env.RPATH_ON_INSTALL: @@ -58,7 +62,7 @@ def PKG_CONFIG_FILES(bld, pc_files, vnum=None): t.env.PACKAGE_VERSION = vnum for v in [ 'PREFIX', 'EXEC_PREFIX', 'LIB_RPATH' ]: t.vars.append(t.env[v]) - bld.INSTALL_FILES(dest, f, flat=True, destname=base) + bld.INSTALL_FILES(dest, target, flat=True, destname=base) Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index 2ffe745..978a5e9 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -229,6 +229,7 @@ def add_init_functions(self): if modules == []: sname = sname.replace('-','_') + sname = sname.replace('.','_') sname = sname.replace('/','_') cflags.append('-DSTATIC_%s_MODULES=%s' % (sname, sentinel)) if sentinel == 'NULL': diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py index 057a017..40b42fc 100644 --- a/buildtools/wafsamba/samba_python.py +++ b/buildtools/wafsamba/samba_python.py @@ -40,6 +40,18 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)): @conf def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True): + if conf.env.disable_python: + if mandatory: + raise Utils.WafError("Cannot check for python headers when " + "--disable-python specified") + + conf.msg("python headers", "Check disabled due to --disable-python") + # we don't want PYTHONDIR in config.h, as otherwise changing + # --prefix causes a complete rebuild + del(conf.env.defines['PYTHONDIR']) + del(conf.env.defines['PYTHONARCHDIR']) + return + if conf.env["python_headers_checked"] == []: if conf.env['EXTRA_PYTHON']: conf.setenv('extrapython') @@ -75,6 +87,14 @@ def _check_python_headers(conf, mandatory): conf.env['PYTHON_SO_ABI_FLAG'] = abi_pattern % '' else: conf.env['PYTHON_SO_ABI_FLAG'] = '' + conf.env['PYTHON_LIBNAME_SO_ABI_FLAG'] = ( + conf.env['PYTHON_SO_ABI_FLAG'].replace('_', '-')) + + +def PYTHON_BUILD_IS_ENABLED(self): + return self.CONFIG_SET('HAVE_PYTHON_H') + +Build.BuildContext.PYTHON_BUILD_IS_ENABLED = PYTHON_BUILD_IS_ENABLED def SAMBA_PYTHON(bld, name, @@ -91,6 +111,11 @@ def SAMBA_PYTHON(bld, name, enabled=True): '''build a python extension for Samba''' + # force-disable when we can't build python modules, so + # every single call doesn't need to pass this in. + if not bld.PYTHON_BUILD_IS_ENABLED(): + enabled = False + if bld.env['IS_EXTRA_PYTHON']: name = 'extra-' + name @@ -138,7 +163,10 @@ Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON def pyembed_libname(bld, name, extrapython=False): - return name + bld.env['PYTHON_SO_ABI_FLAG'] + if bld.env['PYTHON_SO_ABI_FLAG']: + return name + bld.env['PYTHON_SO_ABI_FLAG'] + else: + return name Build.BuildContext.pyembed_libname = pyembed_libname diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 4a47dbf..137cb0e 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -144,7 +144,7 @@ def SAMBA_LIBRARY(bld, libname, source, '''define a Samba library''' if pyembed and bld.env['IS_EXTRA_PYTHON']: - public_headers = pc_files = None + public_headers = None if private_library and public_headers: raise Utils.WafError("private library '%s' must not have public header files" % @@ -225,7 +225,7 @@ def SAMBA_LIBRARY(bld, libname, source, if vnum is None and soname is None: raise Utils.WafError("public library '%s' must have a vnum" % libname) - if pc_files is None and not bld.env['IS_EXTRA_PYTHON']: + if pc_files is None: raise Utils.WafError("public library '%s' must have pkg-config file" % libname) if public_headers is None and not bld.env['IS_EXTRA_PYTHON']: @@ -328,7 +328,10 @@ def SAMBA_LIBRARY(bld, libname, source, t.link_name = link_name if pc_files is not None and not private_library: - bld.PKG_CONFIG_FILES(pc_files, vnum=vnum) + if pyembed and bld.env['IS_EXTRA_PYTHON']: + bld.PKG_CONFIG_FILES(pc_files, vnum=vnum, extra_name=bld.env['PYTHON_SO_ABI_FLAG']) + else: + bld.PKG_CONFIG_FILES(pc_files, vnum=vnum) if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']): diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index fcaaf1b..4eef008 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -196,6 +196,10 @@ def set_options(opt): help='tag release in git at the same time', type='string', action='store', dest='TAG_RELEASE') + opt.add_option('--disable-python', + help='do not generate python modules', + action='store_true', dest='disable_python', default=False) + opt.add_option('--extra-python', type=str, help=("build selected libraries for the specified " "additional version of Python " @@ -279,8 +283,14 @@ def configure(conf): conf.env.AUTOCONF_HOST = Options.options.AUTOCONF_HOST conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX + conf.env.disable_python = Options.options.disable_python + conf.env.EXTRA_PYTHON = Options.options.EXTRA_PYTHON + if (conf.env.disable_python and conf.env.EXTRA_PYTHON): + Logs.error('ERROR: cannot specify both --disable-python and --extra-python.') + sys.exit(1) + if (conf.env.AUTOCONF_HOST and conf.env.AUTOCONF_BUILD and conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST): diff --git a/ctdb/wscript b/ctdb/wscript index 4c8db60..9e99fa2 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -107,8 +107,8 @@ def configure(conf): if conf.env.standalone_ctdb: conf.SAMBA_CHECK_PERL(mandatory=True) - conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2,5,0)) - conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True) + conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,5,0)) + conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False) if conf.CHECK_FOR_THIRD_PARTY(): conf.RECURSE('third_party/popt') diff --git a/examples/scripts/shares/python/SambaConfig.py b/examples/scripts/shares/python/SambaConfig.py index 3d4a473..6ceec8a 100644 --- a/examples/scripts/shares/python/SambaConfig.py +++ b/examples/scripts/shares/python/SambaConfig.py @@ -124,7 +124,7 @@ class SambaConf: if input_str[-1] == "\\" : result += input_str[0:-1] - contine + continue ## otherwise we have a complete line result += input_str diff --git a/lib/ldb-samba/pyldb.c b/lib/ldb-samba/pyldb.c index 6c0d2a7..dfcb551 100644 --- a/lib/ldb-samba/pyldb.c +++ b/lib/ldb-samba/pyldb.c @@ -20,6 +20,7 @@ */ #include <Python.h> +#include "python/py3compat.h" #include "includes.h" #include <ldb.h> #include <pyldb.h> @@ -29,7 +30,6 @@ #include "lib/ldb-samba/ldif_handlers.h" #include "auth/pyauth.h" -void init_ldb(void); static PyObject *pyldb_module; static PyObject *py_ldb_error; @@ -237,6 +237,14 @@ static PyMethodDef py_samba_ldb_methods[] = { { NULL }, }; +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + .m_name = "_ldb", + .m_doc = "Samba-specific LDB python bindings", + .m_size = -1, + .m_methods = py_samba_ldb_methods, +}; + static PyTypeObject PySambaLdb = { .tp_name = "samba._ldb.Ldb", .tp_doc = "Connection to a LDB database.", @@ -244,27 +252,29 @@ static PyTypeObject PySambaLdb = { .tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, }; -void init_ldb(void) +MODULE_INIT_FUNC(_ldb) { PyObject *m; pyldb_module = PyImport_ImportModule("ldb"); if (pyldb_module == NULL) - return; + return NULL; PySambaLdb.tp_base = (PyTypeObject *)PyObject_GetAttrString(pyldb_module, "Ldb"); if (PySambaLdb.tp_base == NULL) - return; + return NULL; py_ldb_error = PyObject_GetAttrString(pyldb_module, "LdbError"); if (PyType_Ready(&PySambaLdb) < 0) - return; + return NULL; - m = Py_InitModule3("_ldb", NULL, "Samba-specific LDB python bindings"); + m = PyModule_Create(&moduledef); if (m == NULL) - return; + return NULL; Py_INCREF(&PySambaLdb); PyModule_AddObject(m, "Ldb", (PyObject *)&PySambaLdb); + + return m; } diff --git a/lib/ldb-samba/wscript_build b/lib/ldb-samba/wscript_build index d35b227..c538b5a 100644 --- a/lib/ldb-samba/wscript_build +++ b/lib/ldb-samba/wscript_build @@ -18,10 +18,12 @@ bld.SAMBA_SUBSYSTEM('ldbwrap', deps='ldb samba-util ldbsamba samba-hostconfig' ) - -bld.SAMBA_PYTHON('python_samba__ldb', 'pyldb.c', - deps='ldbsamba pyparam_util ldbwrap pyldb-util pyauth', - realname='samba/_ldb.so') +for env in bld.gen_python_environments(): + pyparam_util = bld.pyembed_libname('pyparam_util') + pyldb_util = bld.pyembed_libname('pyldb-util') + bld.SAMBA_PYTHON('python_samba__ldb', 'pyldb.c', + deps='ldbsamba %s ldbwrap %s pyauth' % (pyparam_util, pyldb_util), + realname='samba/_ldb.so') bld.SAMBA_MODULE('ldbsamba_extensions', source='samba_extensions.c', diff --git a/lib/ldb/pyldb-util.pc.in b/lib/ldb/pyldb-util.pc.in index 348ae8b..60ec702 100644 --- a/lib/ldb/pyldb-util.pc.in +++ b/lib/ldb/pyldb-util.pc.in @@ -4,10 +4,10 @@ libdir=@libdir@ includedir=@includedir@ modulesdir=@LDB_MODULESDIR@ -Name: pyldb-util +Name: pyldb-util@PYTHON_SO_ABI_FLAG@ Description: Python bindings for LDB Version: @PACKAGE_VERSION@ Requires: ldb -Libs: @LIB_RPATH@ -L${libdir} -lpyldb-util +Libs: @LIB_RPATH@ -L${libdir} -lpyldb-util@PYTHON_LIBNAME_SO_ABI_FLAG@ Cflags: -I${includedir} URL: http://ldb.samba.org/ diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index bea837f..b65e255 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -3047,7 +3047,7 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb if (py_elements != NULL) { Py_ssize_t i; - if (PyBytes_Check(py_elements)) { + if (PyBytes_Check(py_elements) || PyStr_Check(py_elements)) { char *_msg = NULL; el->num_values = 1; el->values = talloc_array(el, struct ldb_val, 1); @@ -3056,12 +3056,17 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb PyErr_NoMemory(); return NULL; } - result = PyBytes_AsStringAndSize(py_elements, &_msg, &size); + if (PyBytes_Check(py_elements)) { + result = PyBytes_AsStringAndSize(py_elements, &_msg, &size); + msg = _msg; + } else { + msg = PyStr_AsUTF8AndSize(py_elements, &size); + result = (msg == NULL) ? -1 : 0; + } if (result != 0) { talloc_free(mem_ctx); return NULL; } - msg = _msg; el->values[0].data = talloc_memdup(el->values, (const uint8_t *)msg, size + 1); el->values[0].length = size; diff --git a/lib/ldb/wscript b/lib/ldb/wscript index 7f05db3..c877f3b 100644 --- a/lib/ldb/wscript +++ b/lib/ldb/wscript @@ -46,7 +46,7 @@ def configure(conf): conf.find_program('xsltproc', var='XSLTPROC') conf.check_tool('python') conf.check_python_version((2,4,2)) - conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True) + conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=not conf.env.disable_python) # where does the default LIBDIR end up? in conf.env somewhere? # @@ -55,10 +55,30 @@ def configure(conf): conf.env.standalone_ldb = conf.IN_LAUNCH_DIR() if not conf.env.standalone_ldb: - if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION, - onlyif='talloc tdb tevent', - implied_deps='replace talloc tdb tevent ldb'): - conf.define('USING_SYSTEM_PYLDB_UTIL', 1) + if conf.env.disable_python: + if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION, + onlyif='talloc tdb tevent', + implied_deps='replace talloc tdb tevent'): + conf.define('USING_SYSTEM_LDB', 1) + else: + using_system_pyldb_util = True + if not conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION, + onlyif='talloc tdb tevent', + implied_deps='replace talloc tdb tevent ldb'): + using_system_pyldb_util = False + + # We need to get a pyldb-util for all the python versions + # we are building for + if conf.env['EXTRA_PYTHON']: + name = 'pyldb-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG'] -- Samba Shared Repository