From a760f169f4936d7e2677db9229181e2c5ac23bcd Mon Sep 17 00:00:00 2001 From: Nadezhda Ivanova Date: Fri, 20 Nov 2009 13:22:38 +0200 Subject: Some changes to allow processing of ldap controls on modify requests. ldap_backend used to filter out ldap controls on modify. Also, modified python binding for ldap_modify to allow writing tests for such controls. --- source4/scripting/python/pyglue.c | 6 ++++++ source4/scripting/python/samba/__init__.py | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index b138e3eeec..9f01102316 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -566,6 +566,12 @@ void initglue(void) PyModule_AddObject(m, "DS_DC_FUNCTION_2008", PyInt_FromLong(DS_DC_FUNCTION_2008)); PyModule_AddObject(m, "DS_DC_FUNCTION_2008_R2", PyInt_FromLong(DS_DC_FUNCTION_2008_R2)); + /* "LDAP_SERVER_SD_FLAGS_OID" */ + PyModule_AddObject(m, "SECINFO_OWNER", PyInt_FromLong(SECINFO_OWNER)); + PyModule_AddObject(m, "SECINFO_GROUP", PyInt_FromLong(SECINFO_GROUP)); + PyModule_AddObject(m, "SECINFO_DACL", PyInt_FromLong(SECINFO_DACL)); + PyModule_AddObject(m, "SECINFO_SACL", PyInt_FromLong(SECINFO_SACL)); + /* one of the most annoying things about python scripts is that they don't die when you hit control-C. This fixes that sillyness. As we do all database operations using diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py index 06e276c2d0..f74304c01c 100644 --- a/source4/scripting/python/samba/__init__.py +++ b/source4/scripting/python/samba/__init__.py @@ -241,7 +241,7 @@ class Ldb(ldb.Ldb): """ self.add_ldif(open(ldif_path, 'r').read()) - def add_ldif(self, ldif,controls=None): + def add_ldif(self, ldif, controls=None): """Add data based on a LDIF string. :param ldif: LDIF text. @@ -250,13 +250,13 @@ class Ldb(ldb.Ldb): assert changetype == ldb.CHANGETYPE_NONE self.add(msg,controls) - def modify_ldif(self, ldif): + def modify_ldif(self, ldif, controls=None): """Modify database based on a LDIF string. :param ldif: LDIF text. """ for changetype, msg in self.parse_ldif(ldif): - self.modify(msg) + self.modify(msg, controls) def set_domain_sid(self, sid): """Change the domain SID used by this LDB. @@ -423,3 +423,9 @@ DS_DC_FUNCTION_2003 = glue.DS_DC_FUNCTION_2003 DS_DC_FUNCTION_2008 = glue.DS_DC_FUNCTION_2008 DS_DC_FUNCTION_2008_R2 = glue.DS_DC_FUNCTION_2008_R2 +#LDAP_SERVER_SD_FLAGS_OID flags +SECINFO_OWNER = glue.SECINFO_OWNER +SECINFO_GROUP = glue.SECINFO_GROUP +SECINFO_DACL = glue.SECINFO_DACL +SECINFO_SACL = glue.SECINFO_SACL + -- cgit