Fix nsSaslMapping object class before configuring SASL mappings.

This is a workaround for <https://fedorahosted.org/389/ticket/47490>.

https://fedorahosted.org/freeipa/ticket/3778
This commit is contained in:
Jan Cholasta 2013-08-27 07:57:07 +00:00 committed by Petr Viktorin
parent e68bef0b1c
commit 5a8e326aeb

View File

@ -252,6 +252,17 @@ class KrbInstance(service.Service):
# we need to remove any existing SASL mappings in the directory as otherwise they
# they may conflict.
# FIXME: https://fedorahosted.org/389/ticket/47490
entry = self.admin_conn.get_entry(
DN(('cn', 'schema')), ['objectClasses'])
entry['objectClasses'].append(
"( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' "
"DESC 'Netscape defined objectclass' SUP top "
"MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ "
"nsSaslMapFilterTemplate ) MAY ( nsSaslMapPriority ) "
"X-ORIGIN 'Netscape Directory Server' )")
self.admin_conn.update_entry(entry)
try:
res = self.admin_conn.get_entries(
DN(('cn', 'mapping'), ('cn', 'sasl'), ('cn', 'config')),