mirror of
https://github.com/samba-team/samba.git
synced 2025-02-10 13:57:47 +03:00
Added stubs for query/set security descriptors on files. Not even close to
working yet. (This used to be commit b7ef2e8b41bd6a7225b9f21c65c42b8ef0f82a32)
This commit is contained in:
parent
605ab78401
commit
7c6400a78f
@ -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 }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user