summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-11-13 10:06:20 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-11-14 08:01:44 +0000
commitd3fffca5e9ab45b43fa3f460ad6051356c9a00a9 (patch)
tree15f08f400ad9875734b99a7844eddd75f34b7b36 /auth
parent7c7dc855ba982a37cb5040752ca473aab3446d6c (diff)
downloadsamba-d3fffca5e9ab45b43fa3f460ad6051356c9a00a9.tar.gz
auth:pycreds: Check return code of netlogon_creds_client_authenticator()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth')
-rw-r--r--auth/credentials/pycredentials.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index 446f30970a2..7427e286dca 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -832,6 +832,7 @@ static PyObject *py_creds_new_client_authenticator(PyObject *self,
struct cli_credentials *creds = NULL;
struct netlogon_creds_CredentialState *nc = NULL;
PyObject *ret = NULL;
+ NTSTATUS status;
creds = PyCredentials_AsCliCredentials(self);
if (creds == NULL) {
@@ -848,9 +849,13 @@ static PyObject *py_creds_new_client_authenticator(PyObject *self,
return NULL;
}
- netlogon_creds_client_authenticator(
- nc,
- &auth);
+ status = netlogon_creds_client_authenticator(nc, &auth);
+ if (!NT_STATUS_IS_OK(status)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Failed to create client authenticator");
+ return NULL;
+ }
+
ret = Py_BuildValue("{s"PYARG_BYTES_LEN"si}",
"credential",
(const char *) &auth.cred, sizeof(auth.cred),