summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2020-03-15 10:32:11 +1300
committerNoel Power <npower@samba.org>2020-03-23 19:12:43 +0000
commit4764e8b4c7e459f6aa5861d26ffaec3a3026d77f (patch)
treea9627bbb9177daf4fb2e33686e81c10abecf4759 /source3/passdb
parentcc79726d95108e3d8ef612a863c2f9fffd768636 (diff)
downloadsamba-4764e8b4c7e459f6aa5861d26ffaec3a3026d77f.tar.gz
py3: Remove #define PyInt_AsLong PyLong_AsLong
This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/py_passdb.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index b5156833df5..0525c44dfaf 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -73,7 +73,7 @@ static int py_samu_set_logon_time(PyObject *obj, PyObject *value, void *closure)
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_logon_time(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_logon_time(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -98,7 +98,7 @@ static int py_samu_set_logoff_time(PyObject *obj, PyObject *value, void *closure
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_logoff_time(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_logoff_time(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -123,7 +123,7 @@ static int py_samu_set_kickoff_time(PyObject *obj, PyObject *value, void *closur
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_kickoff_time(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_kickoff_time(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -148,7 +148,7 @@ static int py_samu_set_bad_password_time(PyObject *obj, PyObject *value, void *c
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_bad_password_time(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_bad_password_time(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -173,7 +173,7 @@ static int py_samu_set_pass_last_set_time(PyObject *obj, PyObject *value, void *
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_pass_last_set_time(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_pass_last_set_time(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -198,7 +198,7 @@ static int py_samu_set_pass_can_change_time(PyObject *obj, PyObject *value, void
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_pass_can_change_time(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_pass_can_change_time(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -830,7 +830,7 @@ static int py_samu_set_acct_ctrl(PyObject *obj, PyObject *value, void *closure)
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_acct_ctrl(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_acct_ctrl(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -855,7 +855,7 @@ static int py_samu_set_logon_divs(PyObject *obj, PyObject *value, void *closure)
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_logon_divs(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_logon_divs(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -880,7 +880,7 @@ static int py_samu_set_hours_len(PyObject *obj, PyObject *value, void *closure)
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_hours_len(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_hours_len(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -937,7 +937,7 @@ static int py_samu_set_hours(PyObject *obj, PyObject *value, void *closure)
for (i=0; i < hours_len; i++) {
PY_CHECK_TYPE(&PyLong_Type, PyList_GET_ITEM(value,i), return -1;);
- hours[i] = PyInt_AsLong(PyList_GET_ITEM(value, i));
+ hours[i] = PyLong_AsLong(PyList_GET_ITEM(value, i));
}
status = pdb_set_hours(sam_acct, hours, hours_len, PDB_CHANGED);
@@ -968,7 +968,7 @@ static int py_samu_set_bad_password_count(PyObject *obj, PyObject *value, void *
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_bad_password_count(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_bad_password_count(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -993,7 +993,7 @@ static int py_samu_set_logon_count(PyObject *obj, PyObject *value, void *closure
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_logon_count(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_logon_count(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -1018,7 +1018,7 @@ static int py_samu_set_country_code(PyObject *obj, PyObject *value, void *closur
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_country_code(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_country_code(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -1043,7 +1043,7 @@ static int py_samu_set_code_page(PyObject *obj, PyObject *value, void *closure)
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- if (!pdb_set_code_page(sam_acct, PyInt_AsLong(value), PDB_CHANGED)) {
+ if (!pdb_set_code_page(sam_acct, PyLong_AsLong(value), PDB_CHANGED)) {
talloc_free(frame);
return -1;
}
@@ -1268,7 +1268,7 @@ static int py_groupmap_set_gid(PyObject *obj, PyObject *value, void *closure)
GROUP_MAP *group_map = (GROUP_MAP *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- group_map->gid = PyInt_AsLong(value);
+ group_map->gid = PyLong_AsLong(value);
talloc_free(frame);
return 0;
}
@@ -1332,7 +1332,7 @@ static int py_groupmap_set_sid_name_use(PyObject *obj, PyObject *value, void *cl
GROUP_MAP *group_map = (GROUP_MAP *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyLong_Type, value, return -1;);
- group_map->sid_name_use = PyInt_AsLong(value);
+ group_map->sid_name_use = PyLong_AsLong(value);
talloc_free(frame);
return 0;
}
@@ -2652,7 +2652,7 @@ static PyObject *py_pdb_set_account_policy(PyObject *self, PyObject *args)
for (i=0; i<count; i++) {
if ((py_value = PyDict_GetItemString(py_acct_policy, names[i])) != NULL) {
type = account_policy_name_to_typenum(names[i]);
- status = methods->set_account_policy(methods, type, PyInt_AsLong(py_value));
+ status = methods->set_account_policy(methods, type, PyLong_AsLong(py_value));
if (!NT_STATUS_IS_OK(status)) {
PyErr_Format(py_pdb_error, "Error setting account policy (%s), (%d,%s)",
names[i],
@@ -3320,13 +3320,13 @@ static PyObject *py_pdb_set_trusted_domain(PyObject *self, PyObject *args)
td_info.trust_auth_outgoing.length = len;
py_tmp = PyDict_GetItemString(py_td_info, "trust_direction");
- td_info.trust_direction = PyInt_AsLong(py_tmp);
+ td_info.trust_direction = PyLong_AsLong(py_tmp);
py_tmp = PyDict_GetItemString(py_td_info, "trust_type");
- td_info.trust_type = PyInt_AsLong(py_tmp);
+ td_info.trust_type = PyLong_AsLong(py_tmp);
py_tmp = PyDict_GetItemString(py_td_info, "trust_attributes");
- td_info.trust_attributes = PyInt_AsLong(py_tmp);
+ td_info.trust_attributes = PyLong_AsLong(py_tmp);
py_tmp = PyDict_GetItemString(py_td_info, "trust_forest_trust_info");
PyBytes_AsStringAndSize(py_tmp, (char **)&td_info.trust_forest_trust_info.data, &len);