diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2013-12-02 03:42:57 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:51:05 +0200 |
commit | 5a7bec1a590e20e263d41eaf414cfe9b5ba48a75 (patch) | |
tree | 9c3ffabaed59ab3a0a5d324b5f2d74a200f4f4a2 /lib | |
parent | 7275b307b8e26e60392e600a3de0671d0aa49043 (diff) |
LDAP Sync Replication.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/openldap | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/openldap b/lib/openldap index 020017c..a90a386 100644 --- a/lib/openldap +++ b/lib/openldap @@ -16,40 +16,41 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import ldap, ldap.sasl from ldap.filter import filter_format from ldap.dn import dn2str,explode_dn,str2dn from ldap.modlist import addModlist from ldif import LDIFParser from functools import partial import re, pwd # Dirty hack to check equality between the targetted LDIF and that # currently in the directory. The value of some configuration (olc*) # attributes is automatically indexed when added; for those we'll add # explicit indices to what we find in the LDIF. indexedAttributes = frozenset([ 'olcAttributeTypes', 'olcObjectClasses', 'olcAccess', + 'olcSyncrepl', ]) # Another hack. Configuration entries sometimes pollutes the DNs with # indices, thus it's not possible to directly use them as base. # Instead, we use their parent as a pase, and search for the *unique* # match with the same ObjectClass and the matching extra attributes. # ('%s' in the attribute value is replaced with the value of the source # entry.) indexedDN = { 'olcSchemaConfig': [('cn', '{*}%s')], 'olcHdbConfig': [('olcDbDirectory', '%s' )], } # Allow for flexible ACLs for user using SASL's EXTERNAL mechanism. # "username=postfix,cn=peercred,cn=external,cn=auth" is replaced by # "gidNumber=106+uidNumber=102,cn=peercred,cn=external,cn=auth" where # 102 is postfix's UID and 106 its primary GID. # (Regular expressions are not allowed.) sasl_ext_re = re.compile( r"""(?P<start>\sby\s+dn(?:\.exact)?)= |