From 3b349c29b59ebe7e1e389dc0d51b2063c657b210 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 12 Jun 2024 11:19:55 +1200 Subject: [PATCH] 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 --- python/samba/join.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.3