This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "python/py_lsa.h"
-PyObject *new_lsa_policy_hnd_object(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+PyObject *new_lsa_policy_hnd_object(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *pol)
{
lsa_policy_hnd_object *o;
goto done;
}
- ntstatus = cli_lsa_open_policy(cli, mem_ctx, True,
- desired_access, &hnd);
+ ntstatus = rpccli_lsa_open_policy(
+ cli->pipe_list, mem_ctx, True, desired_access, &hnd);
if (!NT_STATUS_IS_OK(ntstatus)) {
PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));
goto done;
}
- result = new_lsa_policy_hnd_object(cli, mem_ctx, &hnd);
+ result = new_lsa_policy_hnd_object(cli->pipe_list, mem_ctx, &hnd);
done:
if (!result) {
/* Call rpc function */
- result = cli_lsa_close(hnd->cli, hnd->mem_ctx, &hnd->pol);
+ result = rpccli_lsa_Close(hnd->cli, hnd->mem_ctx, &hnd->pol);
/* Cleanup samba stuff */
const char **names;
DOM_SID *sids;
TALLOC_CTX *mem_ctx = NULL;
- uint32 *name_types;
+ enum lsa_SidType *name_types;
if (!PyArg_ParseTuple(args, "O", &py_names))
return NULL;
/* Convert list to char ** array */
num_names = PyList_Size(py_names);
- names = (const char **)talloc(mem_ctx, num_names * sizeof(char *));
+ names = (const char **)_talloc(mem_ctx, num_names * sizeof(char *));
for (i = 0; i < num_names; i++) {
PyObject *obj = PyList_GetItem(py_names, i);
/* Just a single element */
num_names = 1;
- names = (const char **)talloc(mem_ctx, sizeof(char *));
+ names = (const char **)_talloc(mem_ctx, sizeof(char *));
names[0] = PyString_AsString(py_names);
}
- ntstatus = cli_lsa_lookup_names(hnd->cli, mem_ctx, &hnd->pol,
- num_names, names, &sids, &name_types);
+ ntstatus = rpccli_lsa_lookup_names(
+ hnd->cli, mem_ctx, &hnd->pol, num_names, names,
+ NULL, 1, &sids, &name_types);
if (!NT_STATUS_IS_OK(ntstatus) && NT_STATUS_V(ntstatus) != 0x107) {
PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));
/* Convert dictionary to char ** array */
num_sids = PyList_Size(py_sids);
- sids = (DOM_SID *)talloc(mem_ctx, num_sids * sizeof(DOM_SID));
+ sids = (DOM_SID *)_talloc(mem_ctx, num_sids * sizeof(DOM_SID));
memset(sids, 0, num_sids * sizeof(DOM_SID));
/* Just a single element */
num_sids = 1;
- sids = (DOM_SID *)talloc(mem_ctx, sizeof(DOM_SID));
+ sids = (DOM_SID *)_talloc(mem_ctx, sizeof(DOM_SID));
if (!string_to_sid(&sids[0], PyString_AsString(py_sids))) {
PyErr_SetString(PyExc_ValueError, "string_to_sid failed");
}
}
- ntstatus = cli_lsa_lookup_sids(hnd->cli, mem_ctx, &hnd->pol,
- num_sids, sids, &domains, &names,
- &types);
+ ntstatus = rpccli_lsa_lookup_sids(
+ hnd->cli, mem_ctx, &hnd->pol, num_sids, sids, &domains,
+ &names, &types);
if (!NT_STATUS_IS_OK(ntstatus)) {
PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));
if (!PyArg_ParseTuple(args, ""))
return NULL;
- ntstatus = cli_lsa_enum_trust_dom(
+ ntstatus = rpccli_lsa_enum_trust_dom(
hnd->cli, hnd->mem_ctx, &hnd->pol, &enum_ctx,
&num_domains, &domain_names, &domain_sids);