From: Andrew Bartlett Date: Tue, 1 Mar 2016 02:05:28 +0000 (+1300) Subject: pysmb: Use pytalloc_get_mem_ctx() X-Git-Tag: talloc-2.1.6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a34a1567bb9b9f4f5dc3f28d05845ed13cf31a9;p=thirdparty%2Fsamba.git pysmb: Use pytalloc_get_mem_ctx() Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/libcli/pysmb.c b/source4/libcli/pysmb.c index 5b2b99a6f97..362c6183802 100644 --- a/source4/libcli/pysmb.c +++ b/source4/libcli/pysmb.c @@ -114,7 +114,7 @@ static PyObject * py_smb_loadfile(pytalloc_Object *self, PyObject *args) io.in.fname = filename; spdata = pytalloc_get_ptr(self); - status = smb_composite_loadfile(spdata->tree, self->talloc_ctx, &io); + status = smb_composite_loadfile(spdata->tree, pytalloc_get_mem_ctx(self), &io); PyErr_NTSTATUS_IS_ERR_RAISE(status); return Py_BuildValue("s#", io.out.data, io.out.size); @@ -198,9 +198,9 @@ static PyObject *py_smb_list(pytalloc_Object *self, PyObject *args, PyObject *kw } if (user_mask == NULL) { - mask = talloc_asprintf(self->talloc_ctx, "%s\\*", base_dir); + mask = talloc_asprintf(pytalloc_get_mem_ctx(self), "%s\\*", base_dir); } else { - mask = talloc_asprintf(self->talloc_ctx, "%s\\%s", base_dir, user_mask); + mask = talloc_asprintf(pytalloc_get_mem_ctx(self), "%s\\%s", base_dir, user_mask); } dos_format(mask); @@ -339,7 +339,7 @@ static PyObject *py_smb_getacl(pytalloc_Object *self, PyObject *args, PyObject * io.ntcreatex.in.security_flags = 0; io.ntcreatex.in.fname = filename; - status = smb_raw_open(spdata->tree, self->talloc_ctx, &io); + status = smb_raw_open(spdata->tree, pytalloc_get_mem_ctx(self), &io); PyErr_NTSTATUS_IS_ERR_RAISE(status); fnum = io.ntcreatex.out.file.fnum; @@ -360,13 +360,13 @@ static PyObject *py_smb_getacl(pytalloc_Object *self, PyObject *args, PyObject * SECINFO_PROTECTED_SACL | SECINFO_UNPROTECTED_SACL; - status = smb_raw_query_secdesc(spdata->tree, self->talloc_ctx, &fio); + status = smb_raw_query_secdesc(spdata->tree, pytalloc_get_mem_ctx(self), &fio); smbcli_close(spdata->tree, fnum); PyErr_NTSTATUS_IS_ERR_RAISE(status); return py_return_ndr_struct("samba.dcerpc.security", "descriptor", - self->talloc_ctx, fio.query_secdesc.out.sd); + pytalloc_get_mem_ctx(self), fio.query_secdesc.out.sd); } /* @@ -416,7 +416,7 @@ static PyObject *py_smb_setacl(pytalloc_Object *self, PyObject *args, PyObject * io.ntcreatex.in.security_flags = 0; io.ntcreatex.in.fname = filename; - status = smb_raw_open(spdata->tree, self->talloc_ctx, &io); + status = smb_raw_open(spdata->tree, pytalloc_get_mem_ctx(self), &io); PyErr_NTSTATUS_IS_ERR_RAISE(status); fnum = io.ntcreatex.out.file.fnum;