Opened 13 years ago

Last modified 11 years ago

#4700 new defect


Reported by: nlp@… Owned by: Emmanuel Blot
Priority: normal Component: LdapPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


When I sets group_bind = true, Trac returns an error:

Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/", line 367, in send_error


File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/", line 708, in render_template

data = self.populate_data(req, data)

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/", line 618, in populate_data


File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/", line 194, in getattr

value = self.callbacks[name](self)

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/", line 476, in prepare_request

for category, name, text in contributor.get_navigation_items(req):

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/ticket/", line 163, in get_navigation_items

if 'TICKET_CREATE' in req.perm:

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/", line 524, in has_permission

return self._has_permission(action, resource)

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/", line 538, in _has_permission

check_permission(action, perm.username, resource, perm)

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/", line 425, in check_permission


File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/", line 282, in check_permission


File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/", line 357, in get_user_permissions

for perm in

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/", line 170, in get_user_permissions


File "build/bdist.linux-x86_64/egg/ldapplugin/", line 108, in get_permission_groups

ldapgroups = self._get_user_groups(username)

File "build/bdist.linux-x86_64/egg/ldapplugin/", line 149, in _get_user_groups

ldap_groups = self._ldap.get_groups()

File "build/bdist.linux-x86_64/egg/ldapplugin/", line 541, in get_groups

groups = self.get_dn(self.basedn, 'objectclass=' + self.groupname)

File "build/bdist.linux-x86_64/egg/ldapplugin/", line 564, in get_dn

sr = self._search(basedn, filterstr, dn?, ldap.SCOPE_SUBTREE)

File "build/bdist.linux-x86_64/egg/ldapplugin/", line 647, in _search


File "build/bdist.linux-x86_64/egg/ldapplugin/", line 632, in _open

self._ds.simple_bind_s(self.bind_user, self.bind_passwd)

File "/usr/lib/python2.5/site-packages/ldap/", line 197, in simple_bind_s

msgid = self.simple_bind(who,cred,serverctrls,clientctrls)

File "/usr/lib/python2.5/site-packages/ldap/", line 191, in simple_bind

return self._ldap_call(self._l.simple_bind,who,cred,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))

File "/usr/lib/python2.5/site-packages/ldap/", line 96, in _ldap_call

result = func(*args,kwargs)

TypeError: argument 2 must be string or read-only buffer, not None

Attachments (0)

Change History (1)

comment:1 Changed 11 years ago by

You may enter a password for your bind user.
See LdapPlugin#AuthenticatedLDAPconnections

group_bind = true
bind_user = user
bind_passwd = passwd

Here is also a patch to warn user when using bind with bind_user only (missing bind_passwd):

  • ldapplugin/

    637637                                       (protocol,, self.port))
    638638            self._ds.protocol_version = ldap.VERSION3
    639639            if self.bind:
    640                 if not self.bind_user:
     640                if not self.bind_user or not self.bind_passwd:
    641641                    raise TracError("Bind enabled but credentials not defined")
    642642                head = self.bind_user[:self.bind_user.find(',')]
    643643                if ( head.find('=') == -1 ):

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Emmanuel Blot.

Add Comment

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

Note: See TracTickets for help on using tickets.