X-Git-Url: http://git.samba.org/idra/samba.git/?p=idra%2Fsamba.git;a=blobdiff_plain;f=source3%2Fpassdb%2Fpy_passdb.c;h=9192ab3ce78449b3d9720e7bc69cb411b2d24a1b;hp=878886d6d520ab3f49b33509730a568237969750;hb=22cce0015146c24692209dd9cc5ad0d2dc0f8ce3;hpb=149845fb18e016f8e8e8a415f936b62278b83fc0 diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index 878886d6d52..9192ab3ce78 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; }