Modify

Opened 3 years ago

Closed 2 years ago

#9538 closed defect (fixed)

Setting base_dn as the top-most level,with referrals off, generates a KeyError: 'sAMAccountName'

Reported by: mgavin@… Owned by: pacopablo
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Even though the top-most level of the tree encompasses all containers, trying to view the user list shows a Trac error of KeyError : sAMAccountName.

This of course happens when all the users are found with the search filter (objectCategory=person) and some values returned aren't dictionaries.

At first, making a more specific base_dn worked. (eg. cn=Users,dc=my,dc=example,dc=com) But that didn't get every user.

So the line I configured was inside auth.py line 50

  • userinfo = [self._get_userinfo(u[1]) for u in users]

+ userinfo = [self._get_userinfo(u[1]) for u in users if type(u[0]) == type({})]
and now the list according to the search filter generates without errors.

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by anonymous

line 50

  • userinfo = [self._get_userinfo(u[1]) for u in users]

+ userinfo = [self._get_userinfo(u[1]) for u in users if type(u[0]) == type({})]

comment:2 Changed 3 years ago by mgavin@…

this is similar to #9219

comment:3 Changed 2 years ago by sandinak

  • Resolution set to fixed
  • Status changed from new to closed

fixed as part of #9219

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from pacopablo. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.