The branch, master has been updated via d357141 CI/Autobuild: Remove samba-none-env-py3 test via 8ba6bb5 Add new CI job for new purepy3-none-env autobuild task via f8b5dd9 script: Add new (temporary) autobuild task for none-env tests. via 25b16fa python/samba/netcmd: PY3 fix CI error for samba.tests.samba_tool.help via c11e90a python/samba/provision: PY3 PY3 port samba4.blackbox.provision-backend via cf38a06 python/samba: PY3 port samba4.blackbox.provision-backend via 86e22c0 python/samba/provision: PY3 port samba4.blackbox.provision-backend via 2c0f7f0 python/samba/netcmd: PY3 make sure get_testparm_var returns 'str' via a114ff2 python/samba/samba3: PY3 tdb.Tdb.get method expects bytes in PY3 via 7aa4031 python/samba/netcmd: PY3 fix samba.tests.domain_backup_offline via 09f6b86 python/samba: PY3 port samba4.blackbox.functionalprep via 7562a55 python/samba/netcmd: PY3 Fix error in samba4.blackbox.schemaupgrade via 55f5147 selftest/filter: PY3 Make filter-subunit forgiving of decoding errors via b142e28 python/samba: PY3 fix samba4.blackbox.upgradeprovision.release-4-0-0 via 60e7aa8 s4/scripting/bin: blobs needs to be bytes via c377bcd s4/scripting/bin: PY3 fix samba4.blackbox.upgradeprovision.alpha13 via 1a4e95d s4/scripting/bin: PY3 make sure GUID result of format is string via f94a813 s4/scripting: Py2/Py3 for samba4.blackbox.upgradeprovision.alpha13 via 0febd00 s4/scripting: PY2/PY3 port for samba4.blackbox.upgradeprovision.current via 557ff7b python/samba: samba4.blackbox.dbcheck.release-4-1-0rc3 via 370dcbb samba_tool: Enclose iterator with list via e5cac2b python/samba: misc use of str for ldb.bytes via 17728c2 python/samba: ldb attribute string fix for wafsamba.tests via 8eae420 PY3: ensure StringIO usage is py2/py3 compatible via ca12342 PY3: relative import fixes via 9ae5fd6 s4/scripting/bin: PY3 Fix exception tuple assignments. via 4287d11 PY3: port samba.tests.samba3sam via 72c5b27 python/samba: use PY3 version of ConfigParser via 04c118c python/samba/gp_parse: PY2/PY3 compat porting for gp_init.py via 600fde5 python/samba: add alias for ConfigParser for PY2/PY3 compatability via 8d7830b PY3: convert samba.tests.strings to Py2/Py3 via 2323972 python: py_strcasecmp_m & py_strstr_m don't handle unicode properly via 95dbe11 python/samba/tests: PY2/PY3 port samba.tests.dcerpc.integer via 9ea6cb1 python/samba/netcmd: PY3 only possible to decode bytes via ade47b3 PY3: Only decode when necessary via ee595e9 s4/setup/tests: PY3 samba-tool needs to be called with correct python ver. via 15b2ab0 s4/scripting: PY3 Ensure python scripts are run with correct python ver. via c751013 testprogs/blackbox: Use PYTHON env variable for calling python scripts via c8403f3 python/samba/tests: make sure samba-tool is called with ${PYTHON} via 9f8a570f selftest/target: Make sure samba-tool is called with ${PYTHON} via e538217 PY3: In a pure PY3 build filter-subunit was getting called without 'python' via dcf787b s4/scripting: PY3 need to convert cmp funct to key func for sort. via 4120026 python/samba/gp_parse: PY3 fdeploy_sids needs to use key method for sort via 842f09a samba-tool: PY3 dict view doesn't have sort method, via ff3f541 python/samba/tests: PY3 iterable has no sort method via f5f8676 s4/scripting/bin: PY3 Make sure print statements are enclosed by '()' via d114ca1 selftest: Add expected-value testing for userParameters from fbea9d3 ctdb-daemon: Fix valgrind hit in event code
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit d3571415469ece5341a330c8987139d0f5749e52 Author: Noel Power <noel.po...@suse.com> Date: Thu Oct 18 09:49:24 2018 +0100 CI/Autobuild: Remove samba-none-env-py3 test We now run a purepython3 none-env test, later when the whole build is running under python3 we will resurrect this job but as (samba-none-env-py2) for python2 Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Andrew Bartlett <abart...@samba.org> Autobuild-Date(master): Tue Oct 23 09:10:22 CEST 2018 on sn-devel-144 commit 8ba6bb59c159bf1ac5aab4be1939e7d0657ae4cb Author: Noel Power <noel.po...@suse.com> Date: Tue Oct 16 19:39:41 2018 +0100 Add new CI job for new purepy3-none-env autobuild task Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit f8b5dd954460cccc7f482e9988b6f13e84a60e9c Author: Noel Power <noel.po...@suse.com> Date: Tue Oct 16 19:25:26 2018 +0100 script: Add new (temporary) autobuild task for none-env tests. Ideally we want all the tests to run under python3 by default (no special task for this) and then convert the existing '-py3' tasks to run the python tests with python3. However at the moment the convertion process is not ready to do this, for a while we need to run separate autobuild tasks for this. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 25b16fa0649579f17789e4f06e40b840d77942aa Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 17 18:06:34 2018 +0100 python/samba/netcmd: PY3 fix CI error for samba.tests.samba_tool.help Strangely the test was failing on CI only, looks like there is an issue with order of elements returned from dict.items() with python3.4 (version of python in CI docker instance) and python3.6 (version on my development machine). Changed code to sort the keys so order of help printed out should be the same for each invocation. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit c11e90a123fce5cf8d29d59ae96dfc84d5ce0d04 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 12:25:09 2018 +0100 python/samba/provision: PY3 PY3 port samba4.blackbox.provision-backend Enclose filter with list as filter object has no 'len' method Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit cf38a067e8b1a3308c2c11dbecae8efbc7be02ba Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 12:21:10 2018 +0100 python/samba: PY3 port samba4.blackbox.provision-backend convert ldif content to str when necessary Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 86e22c060655bde73b24223e790bd27c5fd4afe7 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 12:18:32 2018 +0100 python/samba/provision: PY3 port samba4.blackbox.provision-backend Fix some attibrutes that need to be treated as str Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 2c0f7f07c60209cd3e32b9f17737e72fcc02fdc9 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 11:18:13 2018 +0100 python/samba/netcmd: PY3 make sure get_testparm_var returns 'str' part of PY3 port samba4.blackbox.upgrade.samba3-upgrade* Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit a114ff2182a7de1a49416136b2b8e9280f7768da Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 11:16:40 2018 +0100 python/samba/samba3: PY3 tdb.Tdb.get method expects bytes in PY3 part of PY3 port samba4.blackbox.upgrade.samba3-upgrade* Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 7aa40311d737d6ac90503b835280af6dcd85e026 Author: Noel Power <noel.po...@suse.com> Date: Tue Oct 9 21:16:08 2018 +0100 python/samba/netcmd: PY3 fix samba.tests.domain_backup_offline Fix attributes that need to be treated as str not bytes Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 09f6b86403cdb8cee3d999dfac1455bb87a4bdac Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 8 15:21:45 2018 +0100 python/samba: PY3 port samba4.blackbox.functionalprep Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 7562a5518fe8ea49991ca0af8b977f7b9940d014 Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 8 12:27:56 2018 +0100 python/samba/netcmd: PY3 Fix error in samba4.blackbox.schemaupgrade Getting Exception: must be str, not ldb.bytes error in scheme_upgrade phase of test Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 55f51476ac6ed9a653bd9e9695b1dc4783b32ce3 Author: Noel Power <noel.po...@suse.com> Date: Fri Oct 5 16:49:45 2018 +0100 selftest/filter: PY3 Make filter-subunit forgiving of decoding errors samba4.local.ndr for one is a test that outputs string in an encoding that stdin.readline() guesses to be utf8 (but it isn't) filter subunit can afford to be forgiving of some random text that can't be decoded as utf8 so lets do that. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit b142e28e35628fb815cdb16830b12c77d5142455 Author: Noel Power <noel.po...@suse.com> Date: Fri Oct 5 15:10:52 2018 +0100 python/samba: PY3 fix samba4.blackbox.upgradeprovision.release-4-0-0 Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 60e7aa86d8777a4f5d61f45686ec8cda3a59ea99 Author: Noel Power <noel.po...@suse.com> Date: Thu Oct 4 18:29:37 2018 +0100 s4/scripting/bin: blobs needs to be bytes Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit c377bcd487c59555633041624683a3c958897dbc Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 3 15:19:09 2018 +0100 s4/scripting/bin: PY3 fix samba4.blackbox.upgradeprovision.alpha13 commit 1a4e95da2b57c43c89a08aae18765ebf5a7f0f88 Author: Noel Power <noel.po...@suse.com> Date: Tue Oct 2 14:45:53 2018 +0100 s4/scripting/bin: PY3 make sure GUID result of format is string Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit f94a81379666db7145ae0495bf16fb4f95c6cb31 Author: Noel Power <noel.po...@suse.com> Date: Mon Aug 27 20:29:53 2018 +0100 s4/scripting: Py2/Py3 for samba4.blackbox.upgradeprovision.alpha13 fixup source4/scripting/bin/samba_upgradedns Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 0febd003b5762339e491017afe65661b2709ef97 Author: Noel Power <noel.po...@suse.com> Date: Mon Aug 27 13:08:26 2018 +0100 s4/scripting: PY2/PY3 port for samba4.blackbox.upgradeprovision.current o Fix various ldb attribute that need to be converted to string o dict has no 'has_key' method o ndr_unpack needs bytes not string o b64encode needs bytes (so open file with binary mode) o StandardError was removed in python3 use Exception instead o fix octal literals Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 557ff7b7fffc86718b27fbdb3c3b34f894b5f593 Author: Noel Power <noel.po...@suse.com> Date: Sat Aug 25 12:50:58 2018 +0100 python/samba: samba4.blackbox.dbcheck.release-4-1-0rc3 * Various string related fixed py2/py3 * Fix strange double decode followed by encode code (see comments in change) * Added dump_attr_values, simply printing attribute values (from sequence) doesn't work (when using string '%s' format codes in existing string). We need to print out string from bytes in PY3 and fallback to repr(which will print b'blah') if we get a decode error Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 370dcbb791153ff725bd1e254e610ce43dfcd7f1 Author: Noel Power <noel.po...@suse.com> Date: Sat Aug 25 11:39:04 2018 +0100 samba_tool: Enclose iterator with list Really strange bug caused by map being updated while being iterated. This caused keys to be skipped and inconsistent and incorrect results from ldapcmp. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit e5cac2b843d18bc0d67562460366e0abf9484b3c Author: Noel Power <noel.po...@suse.com> Date: Thu Aug 23 17:59:12 2018 +0100 python/samba: misc use of str for ldb.bytes Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 17728c2f53acbb2a128440152d8d2d954f85f67a Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 1 14:47:06 2018 +0100 python/samba: ldb attribute string fix for wafsamba.tests commit 8eae420fbc0377e7d64a16defe31b0f9e7976121 Author: Noel Power <noel.po...@suse.com> Date: Mon Aug 6 13:39:15 2018 +0100 PY3: ensure StringIO usage is py2/py3 compatible commit ca12342b0a07ca707823cd35be12dc806fa46a89 Author: Noel Power <noel.po...@suse.com> Date: Mon Aug 6 15:02:18 2018 +0100 PY3: relative import fixes commit 9ae5fd65a8cc5e08d318dff1773b04194115a039 Author: Noel Power <noel.po...@suse.com> Date: Fri Sep 28 16:49:27 2018 +0100 s4/scripting/bin: PY3 Fix exception tuple assignments. In Python3 to access the exception arguments you need to now use Exception.args, in Python2 you could access these direcly with the 'except' declaration. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 4287d119b02defb3ae5b18d1f1c44be098537cba Author: Noel Power <noel.po...@suse.com> Date: Sun Aug 5 21:08:33 2018 +0100 PY3: port samba.tests.samba3sam commit 72c5b270668a07d7591ea033e811ec09ebb3652d Author: Noel Power <noel.po...@suse.com> Date: Wed Sep 5 14:59:19 2018 +0100 python/samba: use PY3 version of ConfigParser Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 04c118cf0eefebe5e25cdd687c0d970c7ba70b67 Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 15 10:58:23 2018 +0100 python/samba/gp_parse: PY2/PY3 compat porting for gp_init.py Fixes 1) use compat versions of ConfigParser and StringIO 2) open file needs to be opened in binary mode as write_pretty_xml routine uses BytesIO() object. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 600fde58ab616f7c786b43da23acb0b441bd6885 Author: Noel Power <noel.po...@suse.com> Date: Fri Aug 24 09:55:08 2018 +0100 python/samba: add alias for ConfigParser for PY2/PY3 compatability ConfigParser module changed name to configParser in PY3, additionally the behaviour regarding interpolation has changed. ConfigParser now has a default interpolation param whose behaviour demands that '%' is escaped. To maintain behaviour with the python2 version this default param needs to be changed. Add some alias(s) and 'shim' Configparser symbol in samba.compat to cater for this. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 8d7830b6fc1b0cfb2f1dd9e9315aff67dbef3c93 Author: Noel Power <noel.po...@suse.com> Date: Sat Aug 4 21:00:06 2018 +0100 PY3: convert samba.tests.strings to Py2/Py3 Previously the py2 api for strcasecmp_m/strstr_m required strings/unicode but couldn't actually handle unicode with anything other than the default encoding (e.g. ascii). The c-api as been fixed and the encoding steps (which were unnecessary and causing errors in PY3) have been removed commit 23239727734bbc7f58dcba3d8e9f160849885276 Author: Noel Power <noel.po...@suse.com> Date: Tue Aug 7 16:21:35 2018 +0100 python: py_strcasecmp_m & py_strstr_m don't handle unicode properly py_strcasecmp_m & py_strstr_m use PyArg_ParseTuple() with 's' which in Py2 tries to decode string with the default (e.g. ascii) encoding Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 95dbe1177fd82e3a553ac98fd25ee06ca20f8776 Author: Noel Power <noel.po...@suse.com> Date: Sat Aug 4 17:01:24 2018 +0100 python/samba/tests: PY2/PY3 port samba.tests.dcerpc.integer Python3 no longer has a long type so the 'L' postfix is no longer valid. Additionally in python2 an int that exceeds will be transparently converted into a long when necessary commit 9ea6cb187305877af33dc629a4cf894e572e6a13 Author: Noel Power <noel.po...@suse.com> Date: Thu Sep 27 18:16:49 2018 +0100 python/samba/netcmd: PY3 only possible to decode bytes Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit ade47b3df0a173743ed4ff0633e8544f08774253 Author: Noel Power <noel.po...@suse.com> Date: Sat Aug 4 14:23:28 2018 +0100 PY3: Only decode when necessary commit ee595e9b7cea888a978831076e9de3111afccd42 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 11:14:59 2018 +0100 s4/setup/tests: PY3 samba-tool needs to be called with correct python ver. Ensure samba-tool python version defined by $PYTHON Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 15b2ab04b7a97fe948aec9169d5d49f22fdb8289 Author: Noel Power <noel.po...@suse.com> Date: Wed Oct 10 10:15:31 2018 +0100 s4/scripting: PY3 Ensure python scripts are run with correct python ver. As part of port samba4.blackbox.samba3dump to python2/3 make sure test_samba3dump.sh runs samba3dump with $PYTHON which should define the correct python version. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit c751013fa5a0b9ca3248f1177d107e05f5094393 Author: Noel Power <noel.po...@suse.com> Date: Mon Aug 27 17:06:37 2018 +0100 testprogs/blackbox: Use PYTHON env variable for calling python scripts Ensure samba-tool is called with correct python that is defined by $PYTHON Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit c8403f3360ba0d028700d6186c604ca95bf04c0b Author: Noel Power <noel.po...@suse.com> Date: Thu Sep 27 16:08:34 2018 +0100 python/samba/tests: make sure samba-tool is called with ${PYTHON} Ensure python scripts are called with the python version that is defined by $PYTHON Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 9f8a570f906ca787ba4044c0f2fbe88b2c6afd5e Author: Noel Power <noel.po...@suse.com> Date: Thu Sep 27 09:30:40 2018 +0100 selftest/target: Make sure samba-tool is called with ${PYTHON} Ensure python scripts are called with the python version that is defined by $PYTHON Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit e53821793074691e92d71e49023dd4b61efd5f1c Author: Noel Power <noel.po...@suse.com> Date: Sat Aug 4 15:38:40 2018 +0100 PY3: In a pure PY3 build filter-subunit was getting called without 'python' tests were getting called with "| ${src}/selftest/filter-subunit" which resulted in filter-subunit getting execve'd without a calling python. This resulted in /usr/bin/python (default python) getting called and subsequent imports failing. commit dcf787b26354d133a26dcad74cc62fe62b59a87d Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 15 10:36:19 2018 +0100 s4/scripting: PY3 need to convert cmp funct to key func for sort. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 412002629eb849638d929668f96d5e2dab50f1cc Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 15 16:04:25 2018 +0100 python/samba/gp_parse: PY3 fdeploy_sids needs to use key method for sort Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 842f09aaa7b5f0210d3250facbdf745feedd6ef2 Author: Noel Power <noel.po...@suse.com> Date: Mon Oct 15 16:23:07 2018 +0100 samba-tool: PY3 dict view doesn't have sort method, Can't sort a dict view, create a list from view then use list.sort Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit ff3f5411fa15080c5f0c6b9f3112ab1e0e58525a Author: Noel Power <noel.po...@suse.com> Date: Wed Sep 26 17:22:16 2018 +0100 python/samba/tests: PY3 iterable has no sort method map in python3 returns an iterable, in python2 it returned a list. Iterable has no sort method, use sort function instead or construct a list from the iterable so you can use list.sort Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit f5f8676b630e595532e188a559448478c0702ec7 Author: Noel Power <noel.po...@suse.com> Date: Thu Sep 27 18:15:49 2018 +0100 s4/scripting/bin: PY3 Make sure print statements are enclosed by '()' Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit d114ca1e64cd811b6d7a893dfc26a6dca49c1d2c Author: Andrew Bartlett <abart...@samba.org> Date: Tue Oct 23 16:27:29 2018 +1300 selftest: Add expected-value testing for userParameters This does not means that bugs like https://bugzilla.samba.org/show_bug.cgi?id=11881 are fixed, however we do not wish to cause further issues without noticing it, eg during python3 fixes for dbcheck. Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Gary Lockyer <g...@catalyst.net.nz> ----------------------------------------------------------------------- Summary of changes: .gitlab-ci.yml | 11 ++- buildtools/wafsamba/samba_abi.py | 2 +- buildtools/wafsamba/samba_bundled.py | 4 +- buildtools/wafsamba/tests/test_abi.py | 2 +- python/pyglue.c | 14 ++-- python/samba/compat.py | 4 + python/samba/dbchecker.py | 73 ++++++++++++----- python/samba/forest_update.py | 2 +- python/samba/gp_parse/gp_ini.py | 8 +- python/samba/gpclass.py | 2 +- python/samba/ms_forest_updates_markdown.py | 3 +- python/samba/netcmd/__init__.py | 5 +- python/samba/netcmd/domain.py | 9 ++- python/samba/netcmd/domain_backup.py | 10 +-- python/samba/netcmd/ldapcmp.py | 6 +- python/samba/provision/__init__.py | 18 ++--- python/samba/provision/backend.py | 6 +- python/samba/samba3/__init__.py | 30 +++---- python/samba/schema.py | 4 +- python/samba/tests/__init__.py | 3 + python/samba/tests/dcerpc/integer.py | 10 +-- python/samba/tests/docs.py | 18 ++++- python/samba/tests/samba3sam.py | 8 +- python/samba/tests/strings.py | 18 ++--- script/autobuild.py | 14 +++- selftest/filter-subunit | 8 +- selftest/selftesthelpers.py | 2 +- selftest/subunithelper.py | 7 +- selftest/target/Samba.pm | 15 +++- selftest/target/Samba4.pm | 21 +++-- source4/scripting/bin/samba3dump | 92 +++++++++++----------- source4/scripting/bin/samba_dnsupdate | 81 +++++++++---------- source4/scripting/bin/samba_kcc | 7 +- source4/scripting/bin/samba_spnupdate | 8 +- source4/scripting/bin/samba_upgradedns | 7 +- source4/scripting/bin/samba_upgradeprovision | 53 +++++++------ .../expected-userParameters-after-dbcheck.ldif | 48 +++++++++++ source4/selftest/test_samba3dump.sh | 2 +- source4/setup/tests/blackbox_group.sh | 56 ++++++------- source4/setup/tests/blackbox_newuser.sh | 20 ++--- source4/setup/tests/blackbox_s3upgrade.sh | 6 +- source4/setup/tests/blackbox_setpassword.sh | 10 +-- testprogs/blackbox/dbcheck-oldrelease.sh | 13 +++ testprogs/blackbox/functionalprep.sh | 10 +-- testprogs/blackbox/renamedc.sh | 4 +- testprogs/blackbox/schemaupgrade.sh | 4 +- testprogs/blackbox/upgradeprovision-oldrelease.sh | 18 ++--- 47 files changed, 473 insertions(+), 303 deletions(-) create mode 100644 source4/selftest/provisions/release-4-1-0rc3/expected-userParameters-after-dbcheck.ldif Changeset truncated at 500 lines: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 010608b..ec1c362 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,12 +29,6 @@ build_samba_none_env: # this one takes about 1 hours to finish - python script/autobuild.py samba-none-env --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase -build_samba_none_env_py3: - <<: *shared_template - script: - # this one takes about 1 hours to finish - - python script/autobuild.py samba-none-env-py3 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase - build_samba_nopython: <<: *shared_template script: @@ -106,3 +100,8 @@ build_samba_buildpy3_only: <<: *shared_template script: - python3 script/autobuild.py samba-buildpy3-only --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase + +build_samba_purepy3-none_env: + <<: *shared_template + script: + - python3 script/autobuild.py samba-purepy3-none-env --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py index b5c6da4..80db7f8 100644 --- a/buildtools/wafsamba/samba_abi.py +++ b/buildtools/wafsamba/samba_abi.py @@ -7,7 +7,7 @@ import fnmatch from waflib import Options, Utils, Logs, Task, Build, Errors from waflib.TaskGen import feature, before, after -import samba_utils +from wafsamba import samba_utils # these type maps cope with platform specific names for common types # please add new type mappings into the list below diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index fea4cb2..60ce7da 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -3,7 +3,7 @@ import sys from waflib import Build, Options, Logs from waflib.Configure import conf -from samba_utils import TO_LIST +from wafsamba import samba_utils def PRIVATE_NAME(bld, name, private_extension, private_library): '''possibly rename a library to include a bundled extension''' @@ -139,7 +139,7 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0', # We always do a logic validation of 'onlyif' first missing = [] if onlyif: - for l in TO_LIST(onlyif): + for l in samba_utils.TO_LIST(onlyif): f = 'FOUND_SYSTEMLIB_%s' % l if not f in conf.env: Logs.error('ERROR: CHECK_BUNDLED_SYSTEM(%s) - ' % (libname) + diff --git a/buildtools/wafsamba/tests/test_abi.py b/buildtools/wafsamba/tests/test_abi.py index 7489214..d6bdb04 100644 --- a/buildtools/wafsamba/tests/test_abi.py +++ b/buildtools/wafsamba/tests/test_abi.py @@ -21,7 +21,7 @@ from wafsamba.samba_abi import ( normalise_signature, ) -from cStringIO import StringIO +from samba.compat import StringIO class NormaliseSignatureTests(TestCase): diff --git a/python/pyglue.c b/python/pyglue.c index 1b11186..04efa14 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -297,26 +297,30 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args) static PyObject *py_strcasecmp_m(PyObject *self, PyObject *args) { - char *s1, *s2; + const char *s1 = NULL; + const char *s2 = NULL; - if (!PyArg_ParseTuple(args, "ss", &s1, &s2)) + if (!PyArg_ParseTuple(args, "eses", "utf8", &s1, "utf8", &s2)) { return NULL; + } return PyInt_FromLong(strcasecmp_m(s1, s2)); } static PyObject *py_strstr_m(PyObject *self, PyObject *args) { - char *s1, *s2, *ret; + const char *s1 = NULL; + const char *s2 = NULL; + char *ret = NULL; - if (!PyArg_ParseTuple(args, "ss", &s1, &s2)) + if (!PyArg_ParseTuple(args, "eses", "utf8", &s1, "utf8", &s2)) return NULL; ret = strstr_m(s1, s2); if (!ret) { Py_RETURN_NONE; } - return PyStr_FromString(ret); + return PyUnicode_FromString(ret); } static PyMethodDef py_misc_methods[] = { diff --git a/python/samba/compat.py b/python/samba/compat.py index 0c1869a..ff5f3c2 100644 --- a/python/samba/compat.py +++ b/python/samba/compat.py @@ -83,6 +83,9 @@ if PY3: # alias import io StringIO = io.StringIO + def ConfigParser(defaults=None, dict_type=None, allow_no_value=None): + from configparser import ConfigParser + return ConfigParser(defaults, dict_type, allow_no_value, interpolation=None) else: # Helper function to return bytes. # if 'unicode' is passed in then it is decoded using 'utf8' and @@ -158,4 +161,5 @@ else: # alias import cStringIO StringIO = cStringIO.StringIO + from ConfigParser import ConfigParser cmp_fn = cmp diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index d1251a2..dcdbb893 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -35,6 +35,25 @@ from samba.auth import system_session, admin_session from samba.netcmd import CommandError from samba.netcmd.fsmo import get_fsmo_roleowner +# vals is a sequence of ldb.bytes objects which are a subclass +# of 'byte' type in python3 and just a str type in python2, to +# display as string these need to be converted to string via (str) +# function in python3 but that may generate a UnicodeDecode error, +# if so use repr instead. We need to at least try to get the 'str' +# value if possible to allow some tests which check the strings +# outputted to pass, these tests compare attr values logged to stdout +# against those in various results files. + +def dump_attr_values(vals): + result = "" + for value in vals: + if len(result): + result = "," + result + try: + result = result + str(value) + except UnicodeDecode: + result = result + repr(value) + return result class dbcheck(object): """check a SAM database for errors""" @@ -493,7 +512,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) def err_duplicate_values(self, dn, attrname, dup_values, values): '''fix attribute normalisation errors''' self.report("ERROR: Duplicate values for attribute '%s' in '%s'" % (attrname, dn)) - self.report("Values contain a duplicate: [%s]/[%s]!" % (','.join(dup_values), ','.join(values))) + self.report("Values contain a duplicate: [%s]/[%s]!" % (','.join(dump_attr_values(dup_values)), ','.join(dump_attr_values(values)))) if not self.confirm_all("Fix duplicates for '%s' from '%s'?" % (attrname, dn), 'fix_all_duplicates'): self.report("Not fixing attribute '%s'" % attrname) return @@ -779,7 +798,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) res = self.samdb.search("", scope=ldb.SCOPE_BASE, attrs=["dsServiceName"]) assert len(res) == 1 - serviceName = res[0]["dsServiceName"][0] + serviceName = str(res[0]["dsServiceName"][0]) if not self.confirm_all('Sieze role %s onto current DC by adding fSMORoleOwner=%s' % (obj.dn, serviceName), 'seize_fsmo_role'): self.report("Not Siezing role %s onto current DC by adding fSMORoleOwner=%s" % (obj.dn, serviceName)) return @@ -902,8 +921,19 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) m = ldb.Message() m.dn = obj.dn - m['value'] = ldb.MessageElement(obj[attrname][0].decode('utf-16-le').decode('utf-16-le').encode('utf-16-le'), + # m['value'] = ldb.MessageElement(obj[attrname][0].decode('utf-16-le').decode('utf-16-le').encode('utf-16-le'), + # hmm the above old python2 code doesn't make sense to me and cannot + # work in python3 because a string doesn't have a decode method. + # However in python2 for some unknown reason this double decode + # followed by encode seems to result in what looks like utf8. + # In python2 just .decode('utf-16-le').encode('utf-16-le') does nothing + # but trigger the 'double UTF16 encoded' condition again :/ + # + # In python2 and python3 value.decode('utf-16-le').encode('utf8') seems + # to do the trick and work as expected. + m['value'] = ldb.MessageElement(obj[attrname][0].decode('utf-16-le').encode('utf8'), ldb.FLAG_MOD_REPLACE, 'userParameters') + if self.do_modify(m, [], "Failed to correct doubled-UTF16 encoded userParameters on %s by converting" % (obj.dn)): self.report("Corrected doubled-UTF16 encoded userParameters on %s by converting" % (obj.dn)) @@ -1223,14 +1253,14 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) dsdb_dn.prefix = "B:8:%08X:" % int(res[0]['instanceType'][0]) dsdb_dn.binary = "%08X" % int(res[0]['instanceType'][0]) - if str(dsdb_dn) != val: + if str(dsdb_dn) != str(val): error_count += 1 self.err_incorrect_binary_dn(obj.dn, attrname, val, dsdb_dn, "incorrect instanceType part of Binary DN") continue # now we have two cases - the source object might or might not be deleted - is_deleted = 'isDeleted' in obj and obj['isDeleted'][0].upper() == 'TRUE' - target_is_deleted = 'isDeleted' in res[0] and res[0]['isDeleted'][0].upper() == 'TRUE' + is_deleted = 'isDeleted' in obj and str(obj['isDeleted'][0]).upper() == 'TRUE' + target_is_deleted = 'isDeleted' in res[0] and str(res[0]['isDeleted'][0]).upper() == 'TRUE' if is_deleted and obj.dn not in self.deleted_objects_containers and linkID: # A fully deleted object should not have any linked @@ -1503,7 +1533,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) sd = ndr_unpack(security.descriptor, sd_val[0]) - is_deleted = 'isDeleted' in obj and obj['isDeleted'][0].upper() == 'TRUE' + is_deleted = 'isDeleted' in obj and str(obj['isDeleted'][0]).upper() == 'TRUE' if is_deleted: # we don't fix deleted objects return (sd, None) @@ -1587,7 +1617,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) attrs=["isDeleted", "objectClass"], controls=["show_recycled:1"]) o = res[0] - is_deleted = 'isDeleted' in o and o['isDeleted'][0].upper() == 'TRUE' + is_deleted = 'isDeleted' in o and str(o['isDeleted'][0]).upper() == 'TRUE' if is_deleted: # we don't fix deleted objects return (sd, None) @@ -1841,27 +1871,27 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) if "description" not in obj: self.report("ERROR: description not present on Deleted Objects container %s" % obj.dn) faulty = True - if "showInAdvancedViewOnly" not in obj or obj['showInAdvancedViewOnly'][0].upper() == 'FALSE': + if "showInAdvancedViewOnly" not in obj or str(obj['showInAdvancedViewOnly'][0]).upper() == 'FALSE': self.report("ERROR: showInAdvancedViewOnly not present on Deleted Objects container %s" % obj.dn) faulty = True if "objectCategory" not in obj: self.report("ERROR: objectCategory not present on Deleted Objects container %s" % obj.dn) faulty = True - if "isCriticalSystemObject" not in obj or obj['isCriticalSystemObject'][0].upper() == 'FALSE': + if "isCriticalSystemObject" not in obj or str(obj['isCriticalSystemObject'][0]).upper() == 'FALSE': self.report("ERROR: isCriticalSystemObject not present on Deleted Objects container %s" % obj.dn) faulty = True if "isRecycled" in obj: self.report("ERROR: isRecycled present on Deleted Objects container %s" % obj.dn) faulty = True - if "isDeleted" in obj and obj['isDeleted'][0].upper() == 'FALSE': + if "isDeleted" in obj and str(obj['isDeleted'][0]).upper() == 'FALSE': self.report("ERROR: isDeleted not set on Deleted Objects container %s" % obj.dn) faulty = True if "objectClass" not in obj or (len(obj['objectClass']) != 2 or - obj['objectClass'][0] != 'top' or - obj['objectClass'][1] != 'container'): + str(obj['objectClass'][0]) != 'top' or + str(obj['objectClass'][1]) != 'container'): self.report("ERROR: objectClass incorrectly set on Deleted Objects container %s" % obj.dn) faulty = True - if "systemFlags" not in obj or obj['systemFlags'][0] != '-1946157056': + if "systemFlags" not in obj or str(obj['systemFlags'][0]) != '-1946157056': self.report("ERROR: systemFlags incorrectly set on Deleted Objects container %s" % obj.dn) faulty = True return faulty @@ -2148,22 +2178,23 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) continue if str(attrname).lower() == 'userparameters': - if len(obj[attrname][0]) == 1 and obj[attrname][0][0] == '\x20': + if len(obj[attrname][0]) == 1 and obj[attrname][0][0] == b'\x20'[0]: error_count += 1 self.err_short_userParameters(obj, attrname, obj[attrname]) continue - elif obj[attrname][0][:16] == '\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00': + elif obj[attrname][0][:16] == b'\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00\x20\x00': # This is the correct, normal prefix continue - elif obj[attrname][0][:20] == 'IAAgACAAIAAgACAAIAAg': + elif obj[attrname][0][:20] == b'IAAgACAAIAAgACAAIAAg': # this is the typical prefix from a windows migration error_count += 1 self.err_base64_userParameters(obj, attrname, obj[attrname]) continue - elif obj[attrname][0][1] != '\x00' and obj[attrname][0][3] != '\x00' and obj[attrname][0][5] != '\x00' and obj[attrname][0][7] != '\x00' and obj[attrname][0][9] != '\x00': + #43:00:00:00:74:00:00:00:78 + elif obj[attrname][0][1] != b'\x00'[0] and obj[attrname][0][3] != b'\x00'[0] and obj[attrname][0][5] != b'\x00'[0] and obj[attrname][0][7] != b'\x00'[0] and obj[attrname][0][9] != b'\x00'[0]: # This is a prefix that is not in UTF-16 format for the space or munged dialback prefix error_count += 1 self.err_utf8_userParameters(obj, attrname, obj[attrname]) @@ -2175,7 +2206,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) self.err_odd_userParameters(obj, attrname, obj[attrname]) continue - elif obj[attrname][0][1] == '\x00' and obj[attrname][0][2] == '\x00' and obj[attrname][0][3] == '\x00' and obj[attrname][0][4] != '\x00' and obj[attrname][0][5] == '\x00': + elif obj[attrname][0][1] == b'\x00'[0] and obj[attrname][0][2] == b'\x00'[0] and obj[attrname][0][3] == b'\x00'[0] and obj[attrname][0][4] != b'\x00'[0] and obj[attrname][0][5] == b'\x00'[0]: # This is a prefix that would happen if a SAMR-written value was replicated from a Samba 4.1 server to a working server error_count += 1 self.err_doubled_userParameters(obj, attrname, obj[attrname]) @@ -2339,7 +2370,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) found = False for loc in msg[location]: - if loc == self.samdb.get_dsServiceName(): + if str(loc) == self.samdb.get_dsServiceName(): found = True if not found: # This DC is not in the replica locations @@ -2473,7 +2504,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) self.report('ERROR: dsServiceName missing in @ROOTDSE') return error_count + 1 - if not obj['dsServiceName'][0].startswith('<GUID='): + if not str(obj['dsServiceName'][0]).startswith('<GUID='): self.report('ERROR: dsServiceName not in GUID form in @ROOTDSE') error_count += 1 if not self.confirm('Change dsServiceName to GUID form?'): diff --git a/python/samba/forest_update.py b/python/samba/forest_update.py index ba6f859..985e9f9 100644 --- a/python/samba/forest_update.py +++ b/python/samba/forest_update.py @@ -346,7 +346,7 @@ objectClass: container controls=["search_options:1:2"]) assert len(msg) == 1 - existing_sddl = msg[0][attr][0] + existing_sddl = str(msg[0][attr][0]) index = existing_sddl.rfind("S:") if index != -1: new_sddl = existing_sddl[:index] + ace + existing_sddl[index:] diff --git a/python/samba/gp_parse/gp_ini.py b/python/samba/gp_parse/gp_ini.py index 6c3d939..58aee88 100644 --- a/python/samba/gp_parse/gp_ini.py +++ b/python/samba/gp_parse/gp_ini.py @@ -21,9 +21,9 @@ import codecs import collections import re -from ConfigParser import ConfigParser from xml.etree.ElementTree import Element, SubElement -from StringIO import StringIO +from samba.compat import ConfigParser +from samba.compat import StringIO from samba.gp_parse import GPParser, ENTITY_USER_ID @@ -70,7 +70,7 @@ class GPIniParser(GPParser): return section_name def write_xml(self, filename): - with file(filename, 'w') as f: + with open(filename, 'wb') as f: root = Element('IniFile') for sec_ini in self.ini_conf.sections(): @@ -199,7 +199,7 @@ class GPFDeploy1IniParser(GPIniParser): def custom_entities(self, root, global_entities): entities = [] fdeploy_sids = root.findall('.//Section[@fdeploy_SID]') - fdeploy_sids.sort() + fdeploy_sids.sort(key = lambda x: x.tag) for sid in fdeploy_sids: old_attrib = sid.attrib['fdeploy_SID'] diff --git a/python/samba/gpclass.py b/python/samba/gpclass.py index b7c53eb..41ff3e9 100644 --- a/python/samba/gpclass.py +++ b/python/samba/gpclass.py @@ -21,7 +21,7 @@ import errno import tdb sys.path.insert(0, "bin/python") from samba import NTSTATUSError -from ConfigParser import ConfigParser +from samba.compat import ConfigParser from samba.compat import StringIO from abc import ABCMeta, abstractmethod import xml.etree.ElementTree as etree diff --git a/python/samba/ms_forest_updates_markdown.py b/python/samba/ms_forest_updates_markdown.py index 3afe2ec..26cc3fd 100644 --- a/python/samba/ms_forest_updates_markdown.py +++ b/python/samba/ms_forest_updates_markdown.py @@ -27,6 +27,7 @@ import re import os import markdown import xml.etree.ElementTree as ET +from samba.compat import get_string # Display specifier updates or otherwise (ignored in forest_update.py) @@ -217,7 +218,7 @@ def read_ms_markdown(in_file, out_folder=None, out_dict={}): if node.text and node.text.startswith('|Operation'): # Strip first and last | updates = [x[1:len(x) - 1].split('|') for x in - ET.tostring(node, method='text').splitlines()] + get_string(ET.tostring(node, method='text')).splitlines()] for update in updates[2:]: output = re.match('Operation (\d+): {(.*)}', update[0]) if output: diff --git a/python/samba/netcmd/__init__.py b/python/samba/netcmd/__init__.py index 0687016..57436c7 100644 --- a/python/samba/netcmd/__init__.py +++ b/python/samba/netcmd/__init__.py @@ -138,7 +138,8 @@ class Command(object): prog=prog, epilog=epilog) parser.add_options(self.takes_options) optiongroups = {} - for name, optiongroup in self.takes_optiongroups.items(): + for name in sorted(self.takes_optiongroups.keys()): + optiongroup = self.takes_optiongroups[name] optiongroups[name] = optiongroup(parser) parser.add_option_group(optiongroups[name]) return parser, optiongroups @@ -247,7 +248,7 @@ class SuperCommand(Command): subcommand = '--help' epilog = "\nAvailable subcommands:\n" - subcmds = self.subcommands.keys() + subcmds = list(self.subcommands.keys()) subcmds.sort() max_length = max([len(c) for c in subcmds]) for cmd_name in subcmds: diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index f022e37..c671a76 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -103,6 +103,7 @@ from samba.netcmd.pso import cmd_domain_passwordsettings_pso from samba.netcmd.domain_backup import cmd_domain_backup from samba.compat import binary_type +from samba.compat import get_string string_version_to_constant = { "2008_R2": DS_DOMAIN_FUNCTION_2008_R2, @@ -153,9 +154,9 @@ def get_testparm_var(testparm, smbconf, varname): stdout=subprocess.PIPE, stderr=errfile) (out, err) = p.communicate() errfile.close() - lines = out.split('\n') + lines = out.split(b'\n') if lines: - return lines[0].strip() + return get_string(lines[0]).strip() return "" @@ -1848,7 +1849,7 @@ class DomainTrustCommand(Command): objectAttr = lsa.ObjectAttribute() objectAttr.sec_qos = lsa.QosInfo() - policy = conn.OpenPolicy2(''.decode('utf-8'), + policy = conn.OpenPolicy2(b''.decode('utf-8'), objectAttr, policy_access) info = conn.QueryInfoPolicy2(policy, lsa.LSA_POLICY_INFO_DNS) @@ -4092,7 +4093,7 @@ class cmd_domain_schema_upgrade(Command): if len(res) != 1: ldif_op.unknown_oid = value else: - display_name = res[0]['ldapDisplayName'][0] + display_name = str(res[0]['ldapDisplayName'][0]) line = line.replace(value, ' ' + display_name) # Microsoft has marked objects as defunct that Samba doesn't know about diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py index 683e7d2..9f4486b 100644 --- a/python/samba/netcmd/domain_backup.py +++ b/python/samba/netcmd/domain_backup.py @@ -61,11 +61,11 @@ def get_sid_for_restore(samdb): # Find the DN of the RID set of the server res = samdb.search(base=ldb.Dn(samdb, samdb.get_serverName()), scope=ldb.SCOPE_BASE, attrs=["serverReference"]) - server_ref_dn = ldb.Dn(samdb, res[0]['serverReference'][0]) + server_ref_dn = ldb.Dn(samdb, str(res[0]['serverReference'][0])) res = samdb.search(base=server_ref_dn, scope=ldb.SCOPE_BASE, attrs=['rIDSetReferences']) - rid_set_dn = ldb.Dn(samdb, res[0]['rIDSetReferences'][0]) + rid_set_dn = ldb.Dn(samdb, str(res[0]['rIDSetReferences'][0])) # Get the alloc pools and next RID of the RID set res = samdb.search(base=rid_set_dn, @@ -460,7 +460,7 @@ class cmd_domain_backup_restore(cmd_fsmo_seize): is_rename = True if 'backupRename' in res[0] else False sid = res[0].get('sidForRestore')[0] logger.info('Creating account with SID: ' + str(sid)) - ctx.join_add_objects(specified_sid=dom_sid(sid)) + ctx.join_add_objects(specified_sid=dom_sid(str(sid))) m = ldb.Message() -- Samba Shared Repository