svn commit: samba r2828 - branches/SAMBA_3_0/source/python trunk/source/python

tpot at samba.org tpot at samba.org
Wed Oct 6 02:05:39 GMT 2004


Author: tpot
Date: 2004-10-06 02:05:39 +0000 (Wed, 06 Oct 2004)
New Revision: 2828

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=2828&nolog=1

Log:
Fix for bugzilla #1864 from Brett again.

Add sd->type field to security descriptor Python representation.

Modified:
   branches/SAMBA_3_0/source/python/py_ntsec.c
   trunk/source/python/py_ntsec.c


Changeset:
Modified: branches/SAMBA_3_0/source/python/py_ntsec.c
===================================================================
--- branches/SAMBA_3_0/source/python/py_ntsec.c	2004-10-05 22:19:09 UTC (rev 2827)
+++ branches/SAMBA_3_0/source/python/py_ntsec.c	2004-10-06 02:05:39 UTC (rev 2828)
@@ -182,6 +182,10 @@
 	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 @@
 {
 	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 @@
 
 	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 @@
 	{
 		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, 

Modified: trunk/source/python/py_ntsec.c
===================================================================
--- trunk/source/python/py_ntsec.c	2004-10-05 22:19:09 UTC (rev 2827)
+++ trunk/source/python/py_ntsec.c	2004-10-06 02:05:39 UTC (rev 2828)
@@ -182,6 +182,10 @@
 	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 @@
 {
 	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 @@
 
 	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 @@
 	{
 		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, 



More information about the samba-cvs mailing list