mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
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>
This commit is contained in:
parent
7c7dc855ba
commit
d3fffca5e9
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user