summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-02 15:16:13 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-02 13:27:54 +0200
commit1e5098d5e1bb4dd2df6af690ad5555e1b4b52a8d (patch)
treea7e789f71a174afb4d51984f7137938b96defce5
parent64f494de5e8e468a3adde62b02843d734d6cc483 (diff)
downloadsamba-1e5098d5e1bb4dd2df6af690ad5555e1b4b52a8d.tar.gz
samba-1e5098d5e1bb4dd2df6af690ad5555e1b4b52a8d.tar.bz2
samba-1e5098d5e1bb4dd2df6af690ad5555e1b4b52a8d.zip
s3-pysmbd: Add hook for get_nt_acl()
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Aug 2 13:27:55 CEST 2012 on sn-devel-104
-rw-r--r--source3/smbd/pysmbd.c26
1 files changed, 26 insertions, 0 deletions
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 }
};