summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-08 14:21:42 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-08 16:45:27 +0200
commit100565b8cce0c0e843bdd4158bc4047f346037fd (patch)
tree4c4def0fdeafd56c2ebc5465c89191126aae5f65
parent604b380203912c6ba126596d1c0a67bc7a5f6cd0 (diff)
downloadsamba-100565b8cce0c0e843bdd4158bc4047f346037fd.tar.gz
s4:pycredentials: PyArg_ParseTuple("i") requires an 'int' argument.
If we pass variable references we don't get implicit casting! metze
-rw-r--r--source4/auth/credentials/pycredentials.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index 5083174ba13..b77d476bb80 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -60,8 +60,12 @@ static PyObject *py_creds_set_username(py_talloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
- if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+ int _obt = obt;
+
+ if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
return NULL;
+ }
+ obt = _obt;
return PyBool_FromLong(cli_credentials_set_username(PyCredentials_AsCliCredentials(self), newval, obt));
}
@@ -76,8 +80,12 @@ static PyObject *py_creds_set_password(py_talloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
- if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+ int _obt = obt;
+
+ if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
return NULL;
+ }
+ obt = _obt;
return PyBool_FromLong(cli_credentials_set_password(PyCredentials_AsCliCredentials(self), newval, obt));
}
@@ -91,8 +99,12 @@ static PyObject *py_creds_set_domain(py_talloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
- if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+ int _obt = obt;
+
+ if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
return NULL;
+ }
+ obt = _obt;
return PyBool_FromLong(cli_credentials_set_domain(PyCredentials_AsCliCredentials(self), newval, obt));
}
@@ -106,8 +118,12 @@ static PyObject *py_creds_set_realm(py_talloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
- if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+ int _obt = obt;
+
+ if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
return NULL;
+ }
+ obt = _obt;
return PyBool_FromLong(cli_credentials_set_realm(PyCredentials_AsCliCredentials(self), newval, obt));
}
@@ -135,8 +151,12 @@ static PyObject *py_creds_set_workstation(py_talloc_Object *self, PyObject *args
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
- if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+ int _obt = obt;
+
+ if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
return NULL;
+ }
+ obt = _obt;
return PyBool_FromLong(cli_credentials_set_workstation(PyCredentials_AsCliCredentials(self), newval, obt));
}
@@ -171,8 +191,12 @@ static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
{
char *newval;
enum credentials_obtained obt = CRED_SPECIFIED;
- if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+ int _obt = obt;
+
+ if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
return NULL;
+ }
+ obt = _obt;
cli_credentials_parse_string(PyCredentials_AsCliCredentials(self), newval, obt);
Py_RETURN_NONE;