diff options
author | Simo Sorce <idra@samba.org> | 2011-09-26 11:30:05 -0400 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-09-26 18:25:26 +0200 |
commit | f7419172f03089276cab71c41419a5c57508d42e (patch) | |
tree | 1fb9960270a0395fe6e3220d3caeeaad2e0d0cb6 /source3/passdb | |
parent | 0ff0b37f43d6a3ad52b1c954bc8f921222424c0d (diff) | |
download | samba-f7419172f03089276cab71c41419a5c57508d42e.tar.gz samba-f7419172f03089276cab71c41419a5c57508d42e.tar.bz2 samba-f7419172f03089276cab71c41419a5c57508d42e.zip |
s3-passdb: Cleanup use of fstring and move to talloc.
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/py_passdb.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index f02230fd01..48b151387a 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -2062,7 +2062,7 @@ static PyObject *py_pdb_get_aliasinfo(pytalloc_Object *self, PyObject *args) TALLOC_CTX *tframe; PyObject *py_alias_sid; struct dom_sid *alias_sid; - struct acct_info alias_info; + struct acct_info *alias_info; PyObject *py_alias_info; if (!PyArg_ParseTuple(args, "O!:get_aliasinfo", dom_sid_Type, &py_alias_sid)) { @@ -2078,7 +2078,13 @@ static PyObject *py_pdb_get_aliasinfo(pytalloc_Object *self, PyObject *args) alias_sid = pytalloc_get_ptr(py_alias_sid); - status = methods->get_aliasinfo(methods, alias_sid, &alias_info); + alias_info = talloc_zero(tframe, struct acct_info); + if (!alias_info) { + PyErr_NoMemory(); + return NULL; + } + + status = methods->get_aliasinfo(methods, alias_sid, alias_info); if (!NT_STATUS_IS_OK(status)) { PyErr_Format(py_pdb_error, "Unable to get alias information, (%d,%s)", NT_STATUS_V(status), @@ -2094,9 +2100,12 @@ static PyObject *py_pdb_get_aliasinfo(pytalloc_Object *self, PyObject *args) return NULL; } - PyDict_SetItemString(py_alias_info, "acct_name", PyString_FromString(alias_info.acct_name)); - PyDict_SetItemString(py_alias_info, "acct_desc", PyString_FromString(alias_info.acct_desc)); - PyDict_SetItemString(py_alias_info, "rid", PyInt_FromLong(alias_info.rid)); + PyDict_SetItemString(py_alias_info, "acct_name", + PyString_FromString(alias_info->acct_name)); + PyDict_SetItemString(py_alias_info, "acct_desc", + PyString_FromString(alias_info->acct_desc)); + PyDict_SetItemString(py_alias_info, "rid", + PyInt_FromLong(alias_info->rid)); talloc_free(tframe); |