summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-10-20 20:43:26 +0000
committerTim Potter <tpot@samba.org>2002-10-20 20:43:26 +0000
commit7c6400a78f8939d673f5df4f0e2c73f859f4ff23 (patch)
tree2814227d9e5ca137d471a241b31421536cc28be4 /source3/python
parent605ab784015fd5688ec43a5cce1ea5962b27139b (diff)
downloadsamba-7c6400a78f8939d673f5df4f0e2c73f859f4ff23.tar.gz
samba-7c6400a78f8939d673f5df4f0e2c73f859f4ff23.tar.bz2
samba-7c6400a78f8939d673f5df4f0e2c73f859f4ff23.zip
Added stubs for query/set security descriptors on files. Not even close to
working yet. (This used to be commit b7ef2e8b41bd6a7225b9f21c65c42b8ef0f82a32)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_samba.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/source3/python/py_samba.c b/source3/python/py_samba.c
index c0ade12f65..32b99ca7e9 100644
--- a/source3/python/py_samba.c
+++ b/source3/python/py_samba.c
@@ -31,6 +31,58 @@ static PyObject *lsa_open_policy(PyObject *self, PyObject *args,
return NULL;
}
+static PyObject *samba_query_secdesc(PyObject *self, PyObject *args,
+ PyObject *kw)
+{
+ static char *kwlist[] = { NULL };
+ PyObject *py_secdesc;
+ SEC_DESC *secdesc = NULL;
+
+ /* Parse parameters */
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw, "", kwlist))
+ return NULL;
+
+ /* FIXME: Fetch security descriptor with cli_query_secdesc*/
+
+ if (!py_from_SECDESC(&py_secdesc, secdesc)) {
+ PyErr_SetString(
+ PyExc_TypeError,
+ "Invalid security descriptor returned");
+ return NULL;
+ }
+
+ return py_secdesc;
+
+}
+
+static PyObject *samba_set_secdesc(PyObject *self, PyObject *args,
+ PyObject *kw)
+{
+ static char *kwlist[] = { "security_descriptor", NULL };
+ PyObject *py_secdesc;
+ SEC_DESC *secdesc;
+ TALLOC_CTX *mem_ctx = talloc_init();
+
+ /* Parse parameters */
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw, "O", kwlist, &py_secdesc))
+ return NULL;
+
+ if (!py_to_SECDESC(&secdesc, py_secdesc, mem_ctx)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Invalid security descriptor");
+ return NULL;
+ }
+
+ /* FIXME: call cli_set_secdesc() to set security descriptor */
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyMethodDef samba_methods[] = {
{ NULL }
};