Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12488 closed defect (fixed)

Internal Server Error when group_validusers is not set

Reported by: Joshua Kocinski Owned by: bebbo
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Using the trunk version with trac 1.0.8 on CentOS 6.6. The trac instance is brand new and has no other configuration applied besides that needed to get DirectoryAuthPlugin working. "group_validusers" is not set. When logging in, I see an "Internal Server Error" page. Checking the log, I see this:

2015-08-19 13:38:44,989 Trac[auth] INFO: get users
2015-08-19 13:38:44,991 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/Trac-1.0.8-py2.6.egg/trac/web/main.py", line 551, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.8-py2.6.egg/trac/web/main.py", line 244, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.6/site-packages/TracAccountManager-0.4.4-py2.6.egg/acct_mgr/web_ui.py", line 381, in process_request
    if req.path_info.startswith('/login') and req.authname == 'anonymous':
  File "/usr/lib/python2.6/site-packages/Trac-1.0.8-py2.6.egg/trac/web/api.py", line 355, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.8-py2.6.egg/trac/web/main.py", line 158, in authenticate
    authname = authenticator.authenticate(req)
  File "/usr/lib/python2.6/site-packages/TracAccountManager-0.4.4-py2.6.egg/acct_mgr/util.py", line 82, in wrap
    return func(self, *args, **kwds)
  File "/usr/lib/python2.6/site-packages/TracAccountManager-0.4.4-py2.6.egg/acct_mgr/web_ui.py", line 338, in authenticate
    user = self._remote_user(req)
  File "/usr/lib/python2.6/site-packages/TracAccountManager-0.4.4-py2.6.egg/acct_mgr/web_ui.py", line 684, in _remote_user
    if acctmgr.check_password(user, password) == True:
  File "/usr/lib/python2.6/site-packages/TracAccountManager-0.4.4-py2.6.egg/acct_mgr/api.py", line 259, in check_password
    valid = store.check_password(user, password)
  File "/usr/lib/python2.6/site-packages/TracDirectoryAuth-2.0.1dev_r14839-py2.6.egg/tracext/dirauth/auth.py", line 228, in check_password
    self.get_users()
  File "/usr/lib/python2.6/site-packages/TracDirectoryAuth-2.0.1dev_r14839-py2.6.egg/tracext/dirauth/auth.py", line 128, in get_users
    users = lcnx.search_s(self.base_dn, ldap.SCOPE_SUBTREE,
AttributeError: 'DirAuthStore' object has no attribute 'base_dn'

In auth.py, I see that get_users is doing this:

                users = lcnx.search_s(self.base_dn, ldap.SCOPE_SUBTREE,
                                      "objectClass=person",
                                      [self.user_attr, self.email_attr,
                                      self.proxy_attr, self.name_attr])

Elsewhere in the code, I see searches run like this instead:

        attrs = [self.user_attr, self.email_attr, self.proxy_attr, self.name_attr]
        lfilter = '(&(%s=%s)(objectClass=person))' % (self.user_attr, user)
        users = self._dir_search(self.dir_basedn, self.dir_scope,
                                 lfilter, attrs, NOCACHE)

It seems that get_users should do something similar. I am attaching a patch of the changes I made to auth.py which solves the error (though I now get a "Size Limit exceeded" error for that same search.

Thanks in advance,

Joshua Kocinski

Attachments (1)

auth.py_patch.diff (654 bytes) - added by Joshua Kocinski 9 years ago.
patch

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Joshua Kocinski

Attachment: auth.py_patch.diff added

patch

comment:1 Changed 9 years ago by bebbo

In 14887:

refs #12488
replaced old name base_dn with new name dir_basedn

comment:2 Changed 9 years ago by bebbo

Resolution: fixed
Status: newclosed

comment:3 Changed 9 years ago by bebbo

though I now get a "Size Limit exceeded" error for that same search.

there are too many entries below your specified base_dn.

Try using a more specific base to search users, e.g. ou=People,dc=foo,dc=bar instead of dc=foo,dc=bar.

You may also check the sizelimit configuration on the LDAP server.

Last edited 9 years ago by bebbo (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bebbo.
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.