Modify

Opened 5 years ago

#5790 new defect

wrong behaviour with empty base-dn

Reported by: anonymous Owned by: eblot
Priority: normal Component: LdapPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When leaving base-dn empty and group-rdn and user-rdn set ldapplugin does not work. It produces wrong dn's then. I made a hack in api.py of version 0.6.0. I fixed it in methods user_attrdn an group_attrdn starting at line 477 of api.py

    def group_attrdn(self, group):
        """Build the dn for a group"""
        if self.group_rdn:
            if self.basedn:
                return "%s=%s,%s,%s" % \
                   (self.groupattr, group, self.group_rdn, self.basedn)
            else:
                return "%s=%s,%s" % \
                   (self.groupattr, group, self.group_rdn)
        else:
            if self.basedn:
                return "%s=%s,%s" % (self.groupattr, group, self.basedn)
            else:
                return "%s=%s" % (self.groupattr, group)

    def user_attrdn(self, user):
        """Build the dn for a user"""
        if self.user_rdn:
            if self.basedn:
                return "%s=%s,%s,%s" % \
                   (self.uidattr, user, self.user_rdn, self.basedn)
            else:
                return "%s=%s,%s" % \
                   (self.uidattr, user, self.user_rdn)
        else:
            if self.basedn:
                return "%s=%s,%s" % (self.uidattr, user, self.basedn)
            else:
                return "%s=%s" % (self.uidattr, user)


Attachments (0)

Change History (0)

Add Comment

Modify Ticket

Action
as new The owner will remain eblot.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.