From: Douglas Bagnall Date: Tue, 11 Jun 2024 23:19:55 +0000 (+1200) Subject: python:join: avoid useless use of py2-compat string_to_byte_array X-Git-Tag: tdb-1.4.11~374 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b349c29b59ebe7e1e389dc0d51b2063c657b210;p=thirdparty%2Fsamba.git python:join: avoid useless use of py2-compat string_to_byte_array This was a workaround for the migration to Python 3, but is now just extra work for the computer and cognitive load for us. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/join.py b/python/samba/join.py index 724dd6e258e..7b09445a52a 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -20,7 +20,7 @@ from samba.auth import system_session from samba.samdb import SamDB -from samba import gensec, Ldb, drs_utils, arcfour_encrypt, string_to_byte_array +from samba import gensec, Ldb, drs_utils, arcfour_encrypt import ldb import samba import uuid @@ -1407,7 +1407,7 @@ class DCJoinContext(object): except RuntimeError: pass - password_blob = string_to_byte_array(ctx.trustdom_pass.encode('utf-16-le')) + password_blob = list(ctx.trustdom_pass.encode('utf-16-le')) clear_value = drsblobs.AuthInfoClear() clear_value.size = len(password_blob) @@ -1443,7 +1443,7 @@ class DCJoinContext(object): auth_blob = lsa.DATA_BUF2() auth_blob.size = len(encrypted_trustpass) - auth_blob.data = string_to_byte_array(encrypted_trustpass) + auth_blob.data = list(encrypted_trustpass) auth_info = lsa.TrustDomainInfoAuthInfoInternal() auth_info.auth_blob = auth_blob