Modify

Opened 5 years ago

Closed 5 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: John Hampton
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 5 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 5 years ago by mgavin@…

this is similar to #9219

comment:3 Changed 5 years ago by branson

Resolution: fixed
Status: newclosed

fixed as part of #9219

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain John Hampton.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.