From: Stefan Metzmacher Date: Mon, 16 Dec 2024 13:43:41 +0000 (+0100) Subject: s4:scripting: fix gen_hresult.py X-Git-Tag: samba-4.20.7~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a015ffb3dea44bbe4c77f3b626accd5dd7c273d6;p=thirdparty%2Fsamba.git s4:scripting: fix gen_hresult.py Commit 6877e4849e81ed8f7f355fa4069f13a134e999ce reversed the return values of hresult_errstr() and hresult_errstr_const(). hresult_errstr() should return "HRES_SEC_E_WRONG_PRINCIPAL", while hresult_errstr_const() should return "The target principal name is incorrect.". BUG: https://bugzilla.samba.org/show_bug.cgi?id=15769 Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner (cherry picked from commit 6e0e9c4efc86f5ec4566aa0220ed4a74ad5436c1) --- diff --git a/source4/scripting/bin/gen_hresult.py b/source4/scripting/bin/gen_hresult.py index 3caca259436..dec0adf11be 100755 --- a/source4/scripting/bin/gen_hresult.py +++ b/source4/scripting/bin/gen_hresult.py @@ -101,7 +101,7 @@ def generateSourceFile(out_file, errors): out_file.write(" switch (HRES_ERROR_V(err_code)) {\n") for err in errors: out_file.write(f' case 0x{err.err_code:X}:\n') - out_file.write(f' result = \"{err.err_define}\";\n') + out_file.write(f' result = \"{err.err_string}\";\n') out_file.write(f' break;\n') out_file.write(" }\n") out_file.write("\n") @@ -120,7 +120,7 @@ def generateSourceFile(out_file, errors): out_file.write(" switch (HRES_ERROR_V(err_code)) {\n") for err in errors: out_file.write(f' case 0x{err.err_code:X}:\n') - out_file.write(f' return \"{err.err_string}\";\n') + out_file.write(f' return \"{err.err_define}\";\n') out_file.write(f' break;\n') out_file.write(" }\n") out_file.write(" snprintf(msg, sizeof(msg), \"HRES code 0x%08x\", HRES_ERROR_V(err_code));\n")