summaryrefslogtreecommitdiff
path: root/source3/passdb/py_passdb.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-19 15:50:49 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-19 16:35:11 +1000
commit22cce0015146c24692209dd9cc5ad0d2dc0f8ce3 (patch)
tree93a9c89563344b7add5426b17687c659e9b91aaa /source3/passdb/py_passdb.c
parent149845fb18e016f8e8e8a415f936b62278b83fc0 (diff)
downloadsamba-22cce0015146c24692209dd9cc5ad0d2dc0f8ce3.tar.gz
samba-22cce0015146c24692209dd9cc5ad0d2dc0f8ce3.tar.bz2
samba-22cce0015146c24692209dd9cc5ad0d2dc0f8ce3.zip
s3-passdb: Fix the get/set routines for pw_history for samu
Return pw_history with current string length (which is a multiple of PW_HISTORY_ENTRY_LEN) and same thing for setting the pw_history. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/passdb/py_passdb.c')
-rw-r--r--source3/passdb/py_passdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index 878886d6d5..9192ab3ce7 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -658,7 +658,7 @@ static PyObject *py_samu_get_pw_history(PyObject *obj, void *closure)
Py_RETURN_NONE;
}
- py_nt_pw_his = PyString_FromStringAndSize(nt_pw_his, hist_len);
+ py_nt_pw_his = PyString_FromStringAndSize(nt_pw_his, hist_len*PW_HISTORY_ENTRY_LEN);
return py_nt_pw_his;
}
@@ -670,7 +670,7 @@ static int py_samu_set_pw_history(PyObject *obj, PyObject *value, void *closure)
uint32_t hist_len;
PyString_AsStringAndSize(value, &nt_pw_his, &len);
- hist_len = len;
+ hist_len = len / PW_HISTORY_ENTRY_LEN;
if (!pdb_set_pw_history(sam_acct, (uint8_t *)nt_pw_his, hist_len, PDB_CHANGED)) {
return -1;
}