Ticket #1861 (new defect)

Opened 10 months ago

Last modified 5 months ago

Problem with checkUnderBase of LDAPBackingDirectory

Reported by: tracguest Assigned to: madarche
Priority: P2 Milestone: CPS 3.4.7
Component: CPSDirectory Version: 3.4.3
Severity: normal Keywords:
Cc:

Description

Description : la méthode checkUnderBase renvoie l'erreur key error :isCanonicalDN(dn). On a constaté que si le dn comporte des espaces le bug se manifeste.

Solution : on a patché la méthode en formattant le dn voila le patch :

def adie_checkUnderBase(self, dn):
        """Check that dn is under the base."""
        URL=dn
	URL=URL.split(" ")
	print URL
	i=0
	URL_Valid=''
        for i in range(len(URL)):
            URL_Valid+=URL[i]
        dn=URL_Valid
        if not isCanonicalDN(dn):
            raise KeyError("DN '%s' is not canonical" % dn)
        if not (','+dn).endswith(','+self.ldap_base):
            raise ValueError("DN '%s' must be under base '%s'" %
                             (dn, self.ldap_base))

from Products.CPSDirectory import LDAPBackingDirectory
LDAPBackingDirectory.checkUnderBase = adie_checkUnderBase

Attachments

LDAPBackingDirectoryPatch.py (2.4 kB) - added by tracguest on 11/20/07 11:40:20.

Change History

11/20/07 11:40:20 changed by tracguest

  • attachment LDAPBackingDirectoryPatch.py added.

04/17/08 18:12:43 changed by madarche

  • milestone set to CPS 3.4.6.

Please give the example of a DN with spaces in it.