1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

pycredentials: Remove PyCredentialCacheContainerObject

We can call pytalloc_reference() and avoid having this in the header file

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett
2016-02-29 16:26:08 +13:00
parent fe4b990cba
commit 7506321996
2 changed files with 1 additions and 19 deletions

View File

@ -315,20 +315,7 @@ static PyObject *py_creds_set_machine_account(PyObject *self, PyObject *args)
static PyObject *PyCredentialCacheContainer_from_ccache_container(struct ccache_container *ccc)
{
PyCredentialCacheContainerObject *py_ret;
if (ccc == NULL) {
Py_RETURN_NONE;
}
py_ret = (PyCredentialCacheContainerObject *)PyCredentialCacheContainer.tp_alloc(&PyCredentialCacheContainer, 0);
if (py_ret == NULL) {
PyErr_NoMemory();
return NULL;
}
py_ret->mem_ctx = talloc_new(NULL);
py_ret->ccc = talloc_reference(py_ret->mem_ctx, ccc);
return (PyObject *)py_ret;
return pytalloc_reference(&PyCredentialCacheContainer, ccc);
}

View File

@ -24,11 +24,6 @@
extern PyTypeObject PyCredentials;
extern PyTypeObject PyCredentialCacheContainer;
typedef struct {
PyObject_HEAD
TALLOC_CTX *mem_ctx;
struct ccache_container *ccc;
} PyCredentialCacheContainerObject;
#define PyCredentials_Check(py_obj) PyObject_TypeCheck(py_obj, &PyCredentials)
#define PyCredentials_AsCliCredentials(py_obj) pytalloc_get_type(py_obj, struct cli_credentials)
#define cli_credentials_from_py_object(py_obj) (py_obj == Py_None)?cli_credentials_init_anon(NULL):PyCredentials_AsCliCredentials(py_obj)