From: John Mulligan Date: Fri, 24 Mar 2023 19:11:59 +0000 (-0400) Subject: python:join: fix reused variable name in provision func X-Git-Tag: talloc-2.4.1~1092 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5d04a43cf6b32aa8ea443bc5ac485581d77d200;p=thirdparty%2Fsamba.git python:join: fix reused variable name in provision func Recent updates to run adprep during the provision function re-used a variable name that was already in use as a string. This reassignment changed the type of the referenced object. This variable name is later used to setup the mit krb5 kdc conf and expects the var to contain a string. When executed with default cli options on a mit krb5 based build samba tool fails with a traceback: ``` INFO 2023-03-23 21:22:50,399 pid:6 /usr/lib64/python3.10/site-packages/samba/provision/__init__.py #2021: Fixing provision GUIDs ERROR(): uncaught exception - 'DomainUpdate' object has no attribute 'upper' File "/usr/lib64/python3.10/site-packages/samba/netcmd/__init__.py", line 230, in _run return self.run(*args, **kwargs) File "/usr/lib64/python3.10/site-packages/samba/netcmd/domain.py", line 555, in run result = provision(self.logger, File "/usr/lib64/python3.10/site-packages/samba/provision/__init__.py", line 2408, in provision create_kdc_conf(paths.kdcconf, realm, domain, os.path.dirname(lp.get("log file"))) File "/usr/lib64/python3.10/site-packages/samba/provision/kerberos.py", line 43, in create_kdc_conf domain = domain.upper() ``` This change removes the re-use of the existing var name by chaining the calls. Fixes: 4bba26579d1 Signed-off-by: John Mulligan Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Apr 5 02:02:29 UTC 2023 on atb-devel-224 --- diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py index 6946eb42f38..d557e09df5a 100644 --- a/python/samba/provision/__init__.py +++ b/python/samba/provision/__init__.py @@ -2391,10 +2391,11 @@ def provision(logger, session_info, smbconf=None, try: from samba.domain_update import DomainUpdate - domain = DomainUpdate(samdb, fix=True) - domain.check_updates_functional_level(adprep_level, - DS_DOMAIN_FUNCTION_2008, - update_revision=True) + DomainUpdate(samdb, fix=True).check_updates_functional_level( + adprep_level, + DS_DOMAIN_FUNCTION_2008, + update_revision=True, + ) samdb.transaction_commit() except Exception as e: