The branch, master has been updated via 5fcb675a8b0 s4/scripting: fix % len(res) was in the wrong place via 3eccaf5d1eb s4/dsdb: fix unnecessary backslash via 8c19775a27c s4/scripting: fix a few trailing semicolons in gen_{hresult,ntstatus,werror}.py via 18cbec4ba07 s4/scripting: fix a few invalid docstring args via bb34d93277f dsdb/tests: fix assignment to for loop variable from 6258173a62e s4:kdc: Don’t call memcpy() with a NULL pointer
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 5fcb675a8b064aa6b2a2529703ed7911bff3bb04 Author: Rob van der Linde <r...@catalyst.net.nz> Date: Fri Feb 24 12:58:29 2023 +1300 s4/scripting: fix % len(res) was in the wrong place Signed-off-by: Rob van der Linde <r...@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsut...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Andrew Bartlett <abart...@samba.org> Autobuild-Date(master): Fri May 5 05:54:11 UTC 2023 on atb-devel-224 commit 3eccaf5d1ebf397f4900d4126765f7a21a951f10 Author: Rob van der Linde <r...@catalyst.net.nz> Date: Fri Feb 24 12:57:57 2023 +1300 s4/dsdb: fix unnecessary backslash Signed-off-by: Rob van der Linde <r...@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsut...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 8c19775a27c596024c4351b90fb063c1c1c27c14 Author: Rob van der Linde <r...@catalyst.net.nz> Date: Fri Feb 24 12:54:16 2023 +1300 s4/scripting: fix a few trailing semicolons in gen_{hresult,ntstatus,werror}.py Signed-off-by: Rob van der Linde <r...@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsut...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 18cbec4ba07c2f29e684f207a3bd2cbe51b3e852 Author: Rob van der Linde <r...@catalyst.net.nz> Date: Fri Feb 24 12:48:23 2023 +1300 s4/scripting: fix a few invalid docstring args One arg "dn" was removed, the others just had a typo. Signed-off-by: Rob van der Linde <r...@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsut...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit bb34d93277f375e718788d8e42399e23cf371ab0 Author: Rob van der Linde <r...@catalyst.net.nz> Date: Fri Feb 24 12:43:50 2023 +1300 dsdb/tests: fix assignment to for loop variable because the loop variables are all called 'k' and the inner and outer loop both use 'k'. Signed-off-by: Rob van der Linde <r...@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsut...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> ----------------------------------------------------------------------- Summary of changes: source4/dsdb/tests/python/priv_attrs.py | 8 ++++---- source4/dsdb/tests/python/user_account_control.py | 4 ++-- source4/dsdb/tests/python/vlv.py | 10 +++++----- source4/scripting/bin/gen_hresult.py | 8 ++++---- source4/scripting/bin/gen_ntstatus.py | 14 +++++++------- source4/scripting/bin/gen_werror.py | 12 ++++++------ source4/scripting/bin/samba_upgradeprovision | 13 ++++++------- 7 files changed, 34 insertions(+), 35 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/dsdb/tests/python/priv_attrs.py b/source4/dsdb/tests/python/priv_attrs.py index 4dfdfb9cbb8..0450cc561db 100644 --- a/source4/dsdb/tests/python/priv_attrs.py +++ b/source4/dsdb/tests/python/priv_attrs.py @@ -329,11 +329,11 @@ class PrivAttrsTests(samba.tests.TestCase): except LdbError as e5: (enum, estr) = e5.args if "unpriv-add-error" in attrs[test_name]: - self.assertGotLdbError(attrs[test_name]["unpriv-add-error"], \ - enum) + self.assertGotLdbError(attrs[test_name]["unpriv-add-error"], + enum) else: - self.assertGotLdbError(attrs[test_name]["unpriv-error"], \ - enum) + self.assertGotLdbError(attrs[test_name]["unpriv-error"], + enum) elif "only-2" in attrs[test_name] and \ attrs[test_name]["only-2"] != objectclass: try: diff --git a/source4/dsdb/tests/python/user_account_control.py b/source4/dsdb/tests/python/user_account_control.py index b54b33678dc..ca99ce3fba1 100755 --- a/source4/dsdb/tests/python/user_account_control.py +++ b/source4/dsdb/tests/python/user_account_control.py @@ -96,7 +96,7 @@ class UserAccountControlTests(samba.tests.TestCase): UF_SERVER_TRUST_ACCOUNT]: account_type_str = dsdb.user_account_control_flag_bit_to_string(account_type) for objectclass in ["computer", "user"]: - for name in [("oc_uac_lock$", "withdollar"), \ + for name in [("oc_uac_lock$", "withdollar"), ("oc_uac_lock", "plain")]: test_name = f"{account_type_str}_{objectclass}_{priv[1]}_{name[1]}" cls.generate_dynamic_test("test_objectclass_uac_dollar_lock", @@ -1282,7 +1282,7 @@ class UserAccountControlTests(samba.tests.TestCase): try: self.admin_samdb.add(msg_dict) - if (objectclass == "user" \ + if (objectclass == "user" and account_type != UF_NORMAL_ACCOUNT): self.fail("Able to create {account_type_str} on {objectclass}") except LdbError as e: diff --git a/source4/dsdb/tests/python/vlv.py b/source4/dsdb/tests/python/vlv.py index 3d5782b02ec..33b51557ed3 100644 --- a/source4/dsdb/tests/python/vlv.py +++ b/source4/dsdb/tests/python/vlv.py @@ -365,15 +365,15 @@ class VLVTests(VLVTestsBase): index_map[k] = i keys = [] - for k in gte_order: - if k in index_map: - i = index_map[k] - gte_map[k] = i + for o in gte_order: + if o in index_map: + i = index_map[o] + gte_map[o] = i for k in keys: gte_map[k] = i keys = [] else: - keys.append(k) + keys.append(o) for k in keys: gte_map[k] = len(expected_order) diff --git a/source4/scripting/bin/gen_hresult.py b/source4/scripting/bin/gen_hresult.py index e08b3904353..13a5a56eb0f 100755 --- a/source4/scripting/bin/gen_hresult.py +++ b/source4/scripting/bin/gen_hresult.py @@ -46,7 +46,7 @@ def escapeString( input ): def parseErrorDescriptions( input_file, isWinError ): # read in the data fileContents = open(input_file,"r") - count = 0; + count = 0 for line in fileContents: content = line.strip().split(None,1) # start new error definition ? @@ -168,7 +168,7 @@ def generateSourceFile(out_file): out_file.write("};\n") out_file.write("\n") out_file.write("const char *hresult_errstr_const(HRESULT err_code)\n") - out_file.write("{\n"); + out_file.write("{\n") out_file.write(" const char *result = NULL;\n") out_file.write(" int i;\n") out_file.write(" for (i = 0; i < ARRAY_SIZE(hresult_errs); ++i) {\n") @@ -186,7 +186,7 @@ def generateSourceFile(out_file): out_file.write("};\n") out_file.write("\n") out_file.write("const char *hresult_errstr(HRESULT err_code)\n") - out_file.write("{\n"); + out_file.write("{\n") out_file.write(" static char msg[22];\n") out_file.write(" int i;\n") out_file.write("\n") @@ -206,7 +206,7 @@ def generateSourceFile(out_file): # pasted into a text file def main (): - input_file1 = None; + input_file1 = None filename = "hresult" headerfile_name = filename + ".h" sourcefile_name = filename + ".c" diff --git a/source4/scripting/bin/gen_ntstatus.py b/source4/scripting/bin/gen_ntstatus.py index 495f69ff593..09aa4f36620 100755 --- a/source4/scripting/bin/gen_ntstatus.py +++ b/source4/scripting/bin/gen_ntstatus.py @@ -84,16 +84,16 @@ def generatePythonFile(out_file, errors): out_file.write("MODULE_INIT_FUNC(ntstatus)\n") out_file.write("{\n") out_file.write("\tPyObject *m;\n\n") - out_file.write("\tm = PyModule_Create(&moduledef);\n"); - out_file.write("\tif (m == NULL)\n"); - out_file.write("\t\treturn NULL;\n\n"); + out_file.write("\tm = PyModule_Create(&moduledef);\n") + out_file.write("\tif (m == NULL)\n") + out_file.write("\t\treturn NULL;\n\n") for err in errors: line = """\tPyModule_AddObject(m, \"%s\", \t\tPyLong_FromUnsignedLongLong(NT_STATUS_V(%s)));\n""" % (err.err_define, err.err_define) out_file.write(line) - out_file.write("\n"); - out_file.write("\treturn m;\n"); - out_file.write("}\n"); + out_file.write("\n") + out_file.write("\treturn m;\n") + out_file.write("}\n") def transformErrorName( error_name ): if error_name.startswith("STATUS_"): @@ -114,7 +114,7 @@ def transformErrorName( error_name ): # [3]: The name of the output generated source file with C arrays # [4]: The name of the output generated python file def main (): - input_file = None; + input_file = None if len(sys.argv) == 5: input_file = sys.argv[1] diff --git a/source4/scripting/bin/gen_werror.py b/source4/scripting/bin/gen_werror.py index fd552d1ecd9..445d7994d8b 100755 --- a/source4/scripting/bin/gen_werror.py +++ b/source4/scripting/bin/gen_werror.py @@ -82,16 +82,16 @@ def generatePythonFile(out_file, errors): out_file.write("MODULE_INIT_FUNC(werror)\n") out_file.write("{\n") out_file.write("\tPyObject *m;\n\n") - out_file.write("\tm = PyModule_Create(&moduledef);\n"); - out_file.write("\tif (m == NULL)\n"); - out_file.write("\t\treturn NULL;\n\n"); + out_file.write("\tm = PyModule_Create(&moduledef);\n") + out_file.write("\tif (m == NULL)\n") + out_file.write("\t\treturn NULL;\n\n") for err in errors: line = """\tPyModule_AddObject(m, \"%s\", \t\tPyLong_FromUnsignedLongLong(W_ERROR_V(%s)));\n""" % (err.err_define, err.err_define) out_file.write(line) - out_file.write("\n"); - out_file.write("\treturn m;\n"); - out_file.write("}\n"); + out_file.write("\n") + out_file.write("\treturn m;\n") + out_file.write("}\n") def transformErrorName( error_name ): if error_name.startswith("WERR_"): diff --git a/source4/scripting/bin/samba_upgradeprovision b/source4/scripting/bin/samba_upgradeprovision index c5c508a9c28..b18b4778ebd 100755 --- a/source4/scripting/bin/samba_upgradeprovision +++ b/source4/scripting/bin/samba_upgradeprovision @@ -311,10 +311,10 @@ def sanitychecks(samdb, names): print("No DC found. Your provision is most probably broken!") return False elif len(res) != 1: - print("Found %d domain controllers. For the moment " \ - "upgradeprovision is not able to handle an upgrade on a " \ - "domain with more than one DC. Please demote the other " \ - "DC(s) before upgrading") % len(res) + print("Found %d domain controllers. For the moment " + "upgradeprovision is not able to handle an upgrade on a " + "domain with more than one DC. Please demote the other " + "DC(s) before upgrading" % len(res)) return False else: return True @@ -742,7 +742,6 @@ def add_missing_entries(ref_samdb, samdb, names, basedn, list): provision :param samdb: Ldb object representing the SAM db of the upgraded provision - :param dn: DN of the object to be added :param names: List of key provision parameters :param basedn: DN of the partition to be updated :param list: List of DN to be added in the upgraded provision""" @@ -1081,7 +1080,7 @@ def update_partition(ref_samdb, samdb, basedn, names, schema, provisionUSNs, pre This function will also add the missing object and update existing object to add or remove attributes that were missing. - :param ref_sambdb: An LDB object conntected to the sam.ldb of the + :param ref_samdb: An LDB object connected to the sam.ldb of the reference provision :param samdb: An LDB object connected to the sam.ldb of the update provision @@ -1343,7 +1342,7 @@ def simple_update_basesamdb(newpaths, paths, names): def update_samdb(ref_samdb, samdb, names, provisionUSNs, schema, prereloadfunc): """Upgrade the SAM DB contents for all the provision partitions - :param ref_sambdb: An LDB object conntected to the sam.ldb of the reference + :param ref_samdb: An LDB object connected to the sam.ldb of the reference provision :param samdb: An LDB object connected to the sam.ldb of the update provision -- Samba Shared Repository