From 1e5098d5e1bb4dd2df6af690ad5555e1b4b52a8d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 2 Aug 2012 15:16:13 +1000 Subject: s3-pysmbd: Add hook for get_nt_acl() Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Aug 2 13:27:55 CEST 2012 on sn-devel-104 --- source3/smbd/pysmbd.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/smbd/pysmbd.c') diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index 1dd3d62e19..9a44d259ab 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -305,6 +305,29 @@ static PyObject *py_smbd_set_nt_acl(PyObject *self, PyObject *args) Py_RETURN_NONE; } +/* + set a simple ACL on a file, as a test + */ +static PyObject *py_smbd_get_nt_acl(PyObject *self, PyObject *args) +{ + char *fname; + int security_info_sent; + PyObject *py_sd; + struct security_descriptor *sd; + TALLOC_CTX *tmp_ctx = talloc_new(NULL); + + if (!PyArg_ParseTuple(args, "si", &fname, &security_info_sent)) + return NULL; + + sd = get_nt_acl_no_snum(tmp_ctx, fname); + + py_sd = py_return_ndr_struct("samba.dcerpc.security", "security_descriptor", sd, sd); + + talloc_free(tmp_ctx); + + return py_sd; +} + static PyMethodDef py_smbd_methods[] = { { "have_posix_acls", (PyCFunction)py_smbd_have_posix_acls, METH_VARARGS, @@ -315,6 +338,9 @@ static PyMethodDef py_smbd_methods[] = { { "set_nt_acl", (PyCFunction)py_smbd_set_nt_acl, METH_VARARGS, NULL }, + { "get_nt_acl", + (PyCFunction)py_smbd_get_nt_acl, METH_VARARGS, + NULL }, { NULL } }; -- cgit