summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-10-06 02:05:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:54 -0500
commit4fd4aa1152732311178f1b1c70880d9efeccbaf6 (patch)
treedeb6fc82c64b94747708ec71b352f3905e32e0e2 /source3/python
parent1cc0c7414aedaa933b0552aa15ee2e2a74664026 (diff)
downloadsamba-4fd4aa1152732311178f1b1c70880d9efeccbaf6.tar.gz
samba-4fd4aa1152732311178f1b1c70880d9efeccbaf6.tar.bz2
samba-4fd4aa1152732311178f1b1c70880d9efeccbaf6.zip
r2828: Fix for bugzilla #1864 from Brett again.
Add sd->type field to security descriptor Python representation. (This used to be commit b157a1b7c3e15a960fbc943d37abbb1bf5053a63)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_ntsec.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/python/py_ntsec.c b/source3/python/py_ntsec.c
index 5ce5e8fc1b..907e9d08c1 100644
--- a/source3/python/py_ntsec.c
+++ b/source3/python/py_ntsec.c
@@ -182,6 +182,10 @@ BOOL py_from_SECDESC(PyObject **dict, SEC_DESC *sd)
PyDict_SetItemString(*dict, "revision", obj);
Py_DECREF(obj);
+ obj = PyInt_FromLong(sd->type);
+ PyDict_SetItemString(*dict, "type", obj);
+ Py_DECREF(obj);
+
if (py_from_SID(&obj, sd->owner_sid)) {
PyDict_SetItemString(*dict, "owner_sid", obj);
Py_DECREF(obj);
@@ -209,6 +213,7 @@ BOOL py_to_SECDESC(SEC_DESC **sd, PyObject *dict, TALLOC_CTX *mem_ctx)
{
PyObject *obj;
uint16 revision;
+ uint16 type = SEC_DESC_SELF_RELATIVE;
DOM_SID owner_sid, group_sid;
SEC_ACL sacl, dacl;
BOOL got_dacl = False, got_sacl = False;
@@ -222,6 +227,12 @@ BOOL py_to_SECDESC(SEC_DESC **sd, PyObject *dict, TALLOC_CTX *mem_ctx)
revision = PyInt_AsLong(obj);
+ if ((obj = PyDict_GetItemString(dict, "type"))) {
+ if (obj != Py_None) {
+ type = PyInt_AsLong(obj);
+ }
+ }
+
if ((obj = PyDict_GetItemString(dict, "owner_sid"))) {
if (obj != Py_None) {
@@ -276,7 +287,7 @@ BOOL py_to_SECDESC(SEC_DESC **sd, PyObject *dict, TALLOC_CTX *mem_ctx)
{
size_t sd_size;
- *sd = make_sec_desc(mem_ctx, revision, SEC_DESC_SELF_RELATIVE,
+ *sd = make_sec_desc(mem_ctx, revision, type,
got_owner_sid ? &owner_sid : NULL,
got_group_sid ? &group_sid : NULL,
got_sacl ? &sacl : NULL,