[Nuxeo-tickets] [Nuxeo Repository] #1861: Problem with checkUnderBase of LDAPBackingDirectory

Nuxeo Repository trac at nuxeo.com
Tue Nov 20 11:39:44 CET 2007


#1861: Problem with checkUnderBase of LDAPBackingDirectory
--------------------------+-------------------------------------------------
 Reporter:  tracguest     |       Owner:  madarche
     Type:  defect        |      Status:  new     
 Priority:  P2            |   Milestone:          
Component:  CPSDirectory  |     Version:  3.4.3   
 Severity:  normal        |    Keywords:          
--------------------------+-------------------------------------------------
 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

 }}}

-- 
Ticket URL: <https://svn.nuxeo.org/trac/pub/ticket/1861>
Nuxeo Repository <http://www.cps-project.org/>
Nuxeo Repository



This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.