summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2021-06-22 09:24:38 +0200
committerAndrew Bartlett <abartlet@samba.org>2021-06-29 02:19:35 +0000
commit304cb910bd3637e79805b7a0fd21f508d1f9d5a0 (patch)
tree449655b42506a073f5710c491e202b027c5fd886 /auth
parent9f69e93bad38d45a53219cf248ba92097298b7e7 (diff)
downloadsamba-304cb910bd3637e79805b7a0fd21f508d1f9d5a0.tar.gz
auth:creds: Check return code of cli_credentials_guess()
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index 7405704906a..798cdb41a00 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -661,6 +661,7 @@ static PyObject *py_creds_guess(PyObject *self, PyObject *args)
struct loadparm_context *lp_ctx;
TALLOC_CTX *mem_ctx;
struct cli_credentials *creds;
+ bool ok;
creds = PyCredentials_AsCliCredentials(self);
if (creds == NULL) {
@@ -683,9 +684,11 @@ static PyObject *py_creds_guess(PyObject *self, PyObject *args)
return NULL;
}
- cli_credentials_guess(creds, lp_ctx);
-
+ ok = cli_credentials_guess(creds, lp_ctx);
talloc_free(mem_ctx);
+ if (!ok) {
+ return NULL;
+ }
Py_RETURN_NONE;
}