From: Noel Power Date: Wed, 9 May 2018 15:09:00 +0000 (+0100) Subject: auth/credentials: py2/py3 credential key needs to return bytes X-Git-Tag: tdb-1.3.17~1750 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fd9b77ad49aa8c482c15f7b408c3599c157716b;p=thirdparty%2Fsamba.git auth/credentials: py2/py3 credential key needs to return bytes new_client_authenticator returns a dictionary. The key 'credential' needs to return bytes in Python3, without this change the the code will attempt to convert the binary data to a string (resulting sometimes in decode errors). Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index c626e3fa8a0..56174fefbb4 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -659,7 +659,7 @@ static PyObject *py_creds_new_client_authenticator(PyObject *self, netlogon_creds_client_authenticator( nc, &auth); - ret = Py_BuildValue("{ss#si}", + ret = Py_BuildValue("{s"PYARG_BYTES_LEN"si}", "credential", (const char *) &auth.cred, sizeof(auth.cred), "timestamp", auth.timestamp);