diff options
author | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2009-11-20 13:22:38 +0200 |
---|---|---|
committer | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2009-11-20 13:22:38 +0200 |
commit | a760f169f4936d7e2677db9229181e2c5ac23bcd (patch) | |
tree | 545c9c43890aa7d1d8cf810eb1d70e85cfd695c5 /source4/scripting/python | |
parent | 07e971f1c169387af806af05aa60b6d021feb898 (diff) | |
download | samba-a760f169f4936d7e2677db9229181e2c5ac23bcd.tar.gz samba-a760f169f4936d7e2677db9229181e2c5ac23bcd.tar.bz2 samba-a760f169f4936d7e2677db9229181e2c5ac23bcd.zip |
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.
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/pyglue.c | 6 | ||||
-rw-r--r-- | source4/scripting/python/samba/__init__.py | 12 |
2 files changed, 15 insertions, 3 deletions
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 + |