summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/credentials/pycredentials.c60
-rw-r--r--source4/auth/credentials/pycredentials.h2
-rw-r--r--source4/auth/gensec/pygensec.c40
-rw-r--r--source4/auth/pyauth.c8
-rw-r--r--source4/auth/pyauth.h2
5 files changed, 56 insertions, 56 deletions
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index b77d476bb8..5d21721490 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -37,7 +37,7 @@ static PyObject *PyString_FromStringOrNULL(const char *str)
static PyObject *py_creds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- py_talloc_Object *ret = (py_talloc_Object *)type->tp_alloc(type, 0);
+ pytalloc_Object *ret = (pytalloc_Object *)type->tp_alloc(type, 0);
if (ret == NULL) {
PyErr_NoMemory();
return NULL;
@@ -51,12 +51,12 @@ static PyObject *py_creds_new(PyTypeObject *type, PyObject *args, PyObject *kwar
return (PyObject *)ret;
}
-static PyObject *py_creds_get_username(py_talloc_Object *self)
+static PyObject *py_creds_get_username(pytalloc_Object *self)
{
return PyString_FromStringOrNULL(cli_credentials_get_username(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_username(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_username(pytalloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
@@ -70,13 +70,13 @@ static PyObject *py_creds_set_username(py_talloc_Object *self, PyObject *args)
return PyBool_FromLong(cli_credentials_set_username(PyCredentials_AsCliCredentials(self), newval, obt));
}
-static PyObject *py_creds_get_password(py_talloc_Object *self)
+static PyObject *py_creds_get_password(pytalloc_Object *self)
{
return PyString_FromStringOrNULL(cli_credentials_get_password(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_password(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_password(pytalloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
@@ -90,12 +90,12 @@ static PyObject *py_creds_set_password(py_talloc_Object *self, PyObject *args)
return PyBool_FromLong(cli_credentials_set_password(PyCredentials_AsCliCredentials(self), newval, obt));
}
-static PyObject *py_creds_get_domain(py_talloc_Object *self)
+static PyObject *py_creds_get_domain(pytalloc_Object *self)
{
return PyString_FromStringOrNULL(cli_credentials_get_domain(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_domain(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_domain(pytalloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
@@ -109,12 +109,12 @@ static PyObject *py_creds_set_domain(py_talloc_Object *self, PyObject *args)
return PyBool_FromLong(cli_credentials_set_domain(PyCredentials_AsCliCredentials(self), newval, obt));
}
-static PyObject *py_creds_get_realm(py_talloc_Object *self)
+static PyObject *py_creds_get_realm(pytalloc_Object *self)
{
return PyString_FromStringOrNULL(cli_credentials_get_realm(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_realm(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_realm(pytalloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
@@ -128,12 +128,12 @@ static PyObject *py_creds_set_realm(py_talloc_Object *self, PyObject *args)
return PyBool_FromLong(cli_credentials_set_realm(PyCredentials_AsCliCredentials(self), newval, obt));
}
-static PyObject *py_creds_get_bind_dn(py_talloc_Object *self)
+static PyObject *py_creds_get_bind_dn(pytalloc_Object *self)
{
return PyString_FromStringOrNULL(cli_credentials_get_bind_dn(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_bind_dn(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_bind_dn(pytalloc_Object *self, PyObject *args)
{
char *newval;
if (!PyArg_ParseTuple(args, "s", &newval))
@@ -142,12 +142,12 @@ static PyObject *py_creds_set_bind_dn(py_talloc_Object *self, PyObject *args)
return PyBool_FromLong(cli_credentials_set_bind_dn(PyCredentials_AsCliCredentials(self), newval));
}
-static PyObject *py_creds_get_workstation(py_talloc_Object *self)
+static PyObject *py_creds_get_workstation(pytalloc_Object *self)
{
return PyString_FromStringOrNULL(cli_credentials_get_workstation(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_workstation(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_workstation(pytalloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
@@ -161,33 +161,33 @@ static PyObject *py_creds_set_workstation(py_talloc_Object *self, PyObject *args
return PyBool_FromLong(cli_credentials_set_workstation(PyCredentials_AsCliCredentials(self), newval, obt));
}
-static PyObject *py_creds_is_anonymous(py_talloc_Object *self)
+static PyObject *py_creds_is_anonymous(pytalloc_Object *self)
{
return PyBool_FromLong(cli_credentials_is_anonymous(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_anonymous(py_talloc_Object *self)
+static PyObject *py_creds_set_anonymous(pytalloc_Object *self)
{
cli_credentials_set_anonymous(PyCredentials_AsCliCredentials(self));
Py_RETURN_NONE;
}
-static PyObject *py_creds_authentication_requested(py_talloc_Object *self)
+static PyObject *py_creds_authentication_requested(pytalloc_Object *self)
{
return PyBool_FromLong(cli_credentials_authentication_requested(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_wrong_password(py_talloc_Object *self)
+static PyObject *py_creds_wrong_password(pytalloc_Object *self)
{
return PyBool_FromLong(cli_credentials_wrong_password(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_set_cmdline_callbacks(py_talloc_Object *self)
+static PyObject *py_creds_set_cmdline_callbacks(pytalloc_Object *self)
{
return PyBool_FromLong(cli_credentials_set_cmdline_callbacks(PyCredentials_AsCliCredentials(self)));
}
-static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_parse_string(pytalloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
@@ -202,14 +202,14 @@ static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
Py_RETURN_NONE;
}
-static PyObject *py_creds_get_nt_hash(py_talloc_Object *self)
+static PyObject *py_creds_get_nt_hash(pytalloc_Object *self)
{
const struct samr_Password *ntpw = cli_credentials_get_nt_hash(PyCredentials_AsCliCredentials(self), self->ptr);
return PyString_FromStringAndSize(discard_const_p(char, ntpw->hash), 16);
}
-static PyObject *py_creds_set_kerberos_state(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_kerberos_state(pytalloc_Object *self, PyObject *args)
{
int state;
if (!PyArg_ParseTuple(args, "i", &state))
@@ -219,7 +219,7 @@ static PyObject *py_creds_set_kerberos_state(py_talloc_Object *self, PyObject *a
Py_RETURN_NONE;
}
-static PyObject *py_creds_set_krb_forwardable(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_krb_forwardable(pytalloc_Object *self, PyObject *args)
{
int state;
if (!PyArg_ParseTuple(args, "i", &state))
@@ -229,7 +229,7 @@ static PyObject *py_creds_set_krb_forwardable(py_talloc_Object *self, PyObject *
Py_RETURN_NONE;
}
-static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_guess(pytalloc_Object *self, PyObject *args)
{
PyObject *py_lp_ctx = Py_None;
struct loadparm_context *lp_ctx;
@@ -260,7 +260,7 @@ static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
Py_RETURN_NONE;
}
-static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_machine_account(pytalloc_Object *self, PyObject *args)
{
PyObject *py_lp_ctx = Py_None;
struct loadparm_context *lp_ctx;
@@ -312,7 +312,7 @@ static PyObject *PyCredentialCacheContainer_from_ccache_container(struct ccache_
}
-static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_get_named_ccache(pytalloc_Object *self, PyObject *args)
{
PyObject *py_lp_ctx = Py_None;
char *ccache_name;
@@ -358,7 +358,7 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg
return NULL;
}
-static PyObject *py_creds_set_gensec_features(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_set_gensec_features(pytalloc_Object *self, PyObject *args)
{
unsigned int gensec_features;
@@ -370,7 +370,7 @@ static PyObject *py_creds_set_gensec_features(py_talloc_Object *self, PyObject *
Py_RETURN_NONE;
}
-static PyObject *py_creds_get_gensec_features(py_talloc_Object *self, PyObject *args)
+static PyObject *py_creds_get_gensec_features(pytalloc_Object *self, PyObject *args)
{
unsigned int gensec_features;
@@ -445,7 +445,7 @@ static PyMethodDef py_creds_methods[] = {
PyTypeObject PyCredentials = {
.tp_name = "credentials.Credentials",
- .tp_basicsize = sizeof(py_talloc_Object),
+ .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_creds_new,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_methods = py_creds_methods,
@@ -454,14 +454,14 @@ PyTypeObject PyCredentials = {
PyTypeObject PyCredentialCacheContainer = {
.tp_name = "credentials.CredentialCacheContainer",
- .tp_basicsize = sizeof(py_talloc_Object),
+ .tp_basicsize = sizeof(pytalloc_Object),
.tp_flags = Py_TPFLAGS_DEFAULT,
};
void initcredentials(void)
{
PyObject *m;
- PyTypeObject *talloc_type = PyTalloc_GetObjectType();
+ PyTypeObject *talloc_type = pytalloc_GetObjectType();
if (talloc_type == NULL)
return;
diff --git a/source4/auth/credentials/pycredentials.h b/source4/auth/credentials/pycredentials.h
index 451ade6ee9..3a110fb09a 100644
--- a/source4/auth/credentials/pycredentials.h
+++ b/source4/auth/credentials/pycredentials.h
@@ -30,7 +30,7 @@ typedef struct {
struct ccache_container *ccc;
} PyCredentialCacheContainerObject;
#define PyCredentials_Check(py_obj) PyObject_TypeCheck(py_obj, &PyCredentials)
-#define PyCredentials_AsCliCredentials(py_obj) py_talloc_get_type(py_obj, struct cli_credentials)
+#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)
#endif /* _PYCREDENTIALS_H_ */
diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c
index 6a69fd3f9d..a088f9c4db 100644
--- a/source4/auth/gensec/pygensec.c
+++ b/source4/auth/gensec/pygensec.c
@@ -36,7 +36,7 @@ static PyObject *py_get_name_by_authtype(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i", &type))
return NULL;
- security = py_talloc_get_type(self, struct gensec_security);
+ security = pytalloc_get_type(self, struct gensec_security);
name = gensec_get_name_by_authtype(security, type);
if (name == NULL)
@@ -78,7 +78,7 @@ static struct gensec_settings *settings_from_object(TALLOC_CTX *mem_ctx, PyObjec
static PyObject *py_gensec_start_client(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
NTSTATUS status;
- py_talloc_Object *self;
+ pytalloc_Object *self;
struct gensec_settings *settings;
const char *kwnames[] = { "settings", NULL };
PyObject *py_settings;
@@ -88,7 +88,7 @@ static PyObject *py_gensec_start_client(PyTypeObject *type, PyObject *args, PyOb
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", discard_const_p(char *, kwnames), &py_settings))
return NULL;
- self = (py_talloc_Object*)type->tp_alloc(type, 0);
+ self = (pytalloc_Object*)type->tp_alloc(type, 0);
if (self == NULL) {
PyErr_NoMemory();
return NULL;
@@ -149,7 +149,7 @@ static PyObject *py_gensec_start_client(PyTypeObject *type, PyObject *args, PyOb
static PyObject *py_gensec_start_server(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
NTSTATUS status;
- py_talloc_Object *self;
+ pytalloc_Object *self;
struct gensec_settings *settings = NULL;
const char *kwnames[] = { "settings", "auth_context", NULL };
PyObject *py_settings = Py_None;
@@ -161,7 +161,7 @@ static PyObject *py_gensec_start_server(PyTypeObject *type, PyObject *args, PyOb
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO", discard_const_p(char *, kwnames), &py_settings, &py_auth_context))
return NULL;
- self = (py_talloc_Object*)type->tp_alloc(type, 0);
+ self = (pytalloc_Object*)type->tp_alloc(type, 0);
if (self == NULL) {
PyErr_NoMemory();
return NULL;
@@ -201,11 +201,11 @@ static PyObject *py_gensec_start_server(PyTypeObject *type, PyObject *args, PyOb
}
if (py_auth_context != Py_None) {
- auth_context = py_talloc_get_type(py_auth_context, struct auth4_context);
+ auth_context = pytalloc_get_type(py_auth_context, struct auth4_context);
if (!auth_context) {
PyErr_Format(PyExc_TypeError,
"Expected auth.AuthContext for auth_context argument, got %s",
- talloc_get_name(py_talloc_get_ptr(py_auth_context)));
+ talloc_get_name(pytalloc_get_ptr(py_auth_context)));
return NULL;
}
}
@@ -233,7 +233,7 @@ static PyObject *py_gensec_set_credentials(PyObject *self, PyObject *args)
{
PyObject *py_creds = Py_None;
struct cli_credentials *creds;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
NTSTATUS status;
if (!PyArg_ParseTuple(args, "O", &py_creds))
@@ -243,7 +243,7 @@ static PyObject *py_gensec_set_credentials(PyObject *self, PyObject *args)
if (!creds) {
PyErr_Format(PyExc_TypeError,
"Expected samba.credentaials for credentials argument got %s",
- talloc_get_name(py_talloc_get_ptr(py_creds)));
+ talloc_get_name(pytalloc_get_ptr(py_creds)));
}
status = gensec_set_credentials(security, creds);
@@ -260,7 +260,7 @@ static PyObject *py_gensec_session_info(PyObject *self)
TALLOC_CTX *mem_ctx;
NTSTATUS status;
PyObject *py_session_info;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
struct auth_session_info *info;
if (security->ops == NULL) {
PyErr_SetString(PyExc_RuntimeError, "no mechanism selected");
@@ -283,7 +283,7 @@ static PyObject *py_gensec_session_info(PyObject *self)
static PyObject *py_gensec_start_mech_by_name(PyObject *self, PyObject *args)
{
char *name;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
NTSTATUS status;
if (!PyArg_ParseTuple(args, "s", &name))
@@ -301,7 +301,7 @@ static PyObject *py_gensec_start_mech_by_name(PyObject *self, PyObject *args)
static PyObject *py_gensec_start_mech_by_sasl_name(PyObject *self, PyObject *args)
{
char *sasl_name;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
NTSTATUS status;
if (!PyArg_ParseTuple(args, "s", &sasl_name))
@@ -319,7 +319,7 @@ static PyObject *py_gensec_start_mech_by_sasl_name(PyObject *self, PyObject *arg
static PyObject *py_gensec_start_mech_by_authtype(PyObject *self, PyObject *args)
{
int authtype, level;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
NTSTATUS status;
if (!PyArg_ParseTuple(args, "ii", &authtype, &level))
return NULL;
@@ -336,7 +336,7 @@ static PyObject *py_gensec_start_mech_by_authtype(PyObject *self, PyObject *args
static PyObject *py_gensec_want_feature(PyObject *self, PyObject *args)
{
int feature;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
/* This is i (and declared as an int above) by design, as they are handled as an integer in python */
if (!PyArg_ParseTuple(args, "i", &feature))
return NULL;
@@ -349,7 +349,7 @@ static PyObject *py_gensec_want_feature(PyObject *self, PyObject *args)
static PyObject *py_gensec_have_feature(PyObject *self, PyObject *args)
{
int feature;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
/* This is i (and declared as an int above) by design, as they are handled as an integer in python */
if (!PyArg_ParseTuple(args, "i", &feature))
return NULL;
@@ -366,7 +366,7 @@ static PyObject *py_gensec_update(PyObject *self, PyObject *args)
TALLOC_CTX *mem_ctx;
DATA_BLOB in, out;
PyObject *ret, *py_in;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
PyObject *finished_processing;
if (!PyArg_ParseTuple(args, "O", &py_in))
@@ -409,7 +409,7 @@ static PyObject *py_gensec_wrap(PyObject *self, PyObject *args)
TALLOC_CTX *mem_ctx;
DATA_BLOB in, out;
PyObject *ret, *py_in;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
if (!PyArg_ParseTuple(args, "O", &py_in))
return NULL;
@@ -443,7 +443,7 @@ static PyObject *py_gensec_unwrap(PyObject *self, PyObject *args)
TALLOC_CTX *mem_ctx;
DATA_BLOB in, out;
PyObject *ret, *py_in;
- struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ struct gensec_security *security = pytalloc_get_type(self, struct gensec_security);
if (!PyArg_ParseTuple(args, "O", &py_in))
return NULL;
@@ -505,7 +505,7 @@ static PyTypeObject Py_Security = {
.tp_name = "gensec.Security",
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_methods = py_gensec_security_methods,
- .tp_basicsize = sizeof(py_talloc_Object),
+ .tp_basicsize = sizeof(pytalloc_Object),
};
void initgensec(void);
@@ -513,7 +513,7 @@ void initgensec(void)
{
PyObject *m;
- Py_Security.tp_base = PyTalloc_GetObjectType();
+ Py_Security.tp_base = pytalloc_GetObjectType();
if (Py_Security.tp_base == NULL)
return;
diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c
index 2f83be95c7..08ce9d3f7f 100644
--- a/source4/auth/pyauth.c
+++ b/source4/auth/pyauth.c
@@ -207,7 +207,7 @@ static const char **PyList_AsStringList(TALLOC_CTX *mem_ctx, PyObject *list,
static PyObject *PyAuthContext_FromContext(struct auth4_context *auth_context)
{
- return py_talloc_reference(&PyAuthContext, auth_context);
+ return pytalloc_reference(&PyAuthContext, auth_context);
}
static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
@@ -252,7 +252,7 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
}
if (py_imessaging_ctx != Py_None) {
- imessaging_context = py_talloc_get_type(py_imessaging_ctx, struct imessaging_context);
+ imessaging_context = pytalloc_get_type(py_imessaging_ctx, struct imessaging_context);
}
if (py_methods == Py_None && py_ldb == Py_None) {
@@ -298,7 +298,7 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
static PyTypeObject PyAuthContext = {
.tp_name = "AuthContext",
- .tp_basicsize = sizeof(py_talloc_Object),
+ .tp_basicsize = sizeof(pytalloc_Object),
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = py_auth_context_new,
};
@@ -314,7 +314,7 @@ void initauth(void)
{
PyObject *m;
- PyAuthContext.tp_base = PyTalloc_GetObjectType();
+ PyAuthContext.tp_base = pytalloc_GetObjectType();
if (PyAuthContext.tp_base == NULL)
return;
diff --git a/source4/auth/pyauth.h b/source4/auth/pyauth.h
index 60fd2e5d14..c01144d87c 100644
--- a/source4/auth/pyauth.h
+++ b/source4/auth/pyauth.h
@@ -23,7 +23,7 @@
#include <pytalloc.h>
#include "auth/session.h"
-#define PyAuthSession_AsSession(obj) py_talloc_get_type(obj, struct auth_session_info)
+#define PyAuthSession_AsSession(obj) pytalloc_get_type(obj, struct auth_session_info)
struct auth_session_info *PyObject_AsSession(PyObject *obj);
#endif /* _PYAUTH_H */