diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-02-25 16:16:33 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-02-26 13:59:16 +1100 |
commit | 781ad038c96195031053291414a12225eb818fd9 (patch) | |
tree | faf68b7deb844b69cb7463d6c7f689ecc7248971 /source4/auth/credentials/pycredentials.c | |
parent | ad7223b9bd31f71b8af2ae83361d7e054a433cc5 (diff) | |
download | samba-781ad038c96195031053291414a12225eb818fd9.tar.gz samba-781ad038c96195031053291414a12225eb818fd9.tar.bz2 samba-781ad038c96195031053291414a12225eb818fd9.zip |
s4-krb5: propogate errors from a lot more kerberos functions
We need to be able to give sensible error messages when a kerberos
calls fails. This propogates the kerberos error up the stack to the
caller.
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/auth/credentials/pycredentials.c')
-rw-r--r-- | source4/auth/credentials/pycredentials.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c index 002ecbcd08..8602be8060 100644 --- a/source4/auth/credentials/pycredentials.c +++ b/source4/auth/credentials/pycredentials.c @@ -254,6 +254,7 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg struct ccache_container *ccc; struct tevent_context *event_ctx; int ret; + const char *error_string; if (!PyArg_ParseTuple(args, "|Os", &py_lp_ctx, &ccache_name)) return NULL; @@ -264,15 +265,17 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg event_ctx = tevent_context_init(NULL); - ret = cli_credentials_get_named_ccache(PyCredentials_AsCliCredentials(self), event_ctx, lp_ctx, ccache_name, &ccc); + ret = cli_credentials_get_named_ccache(PyCredentials_AsCliCredentials(self), event_ctx, lp_ctx, + ccache_name, &ccc, &error_string); if (ret == 0) { talloc_steal(ccc, event_ctx); return PyCredentialCacheContainer_from_ccache_container(ccc); - } else { - talloc_free(event_ctx); - return NULL; } + PyErr_SetStringError(error_string); + + talloc_free(event_ctx); + return NULL; } static PyMethodDef py_creds_methods[] = { |