#10713 closed defect (duplicate)

DirectoryAuthPlugin: can't set dir_scope parameter in trac.ini

Reported by: sima.baymani@… Owned by: sandinak
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description (last modified by rjollos)

For my setup of the plugin, I had to change the scope to 2 (Subtree) in order for the authentication to work. I did this in the source code and verified that it worked. However, when I tried to set the dir_scope parameter in trac.ini, I get the following error:

 Trac detected an internal error:

TypeError: an integer is required

Python Traceback
Most recent call last:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/web/", line 497, in _dispatch_request
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/web/", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/wiki/", line 125, in process_request
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/", line 578, in require
    if not self._has_permission(action, resource):
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/", line 570, in _has_permission
    check_permission(action, perm.username, resource, perm)
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/", line 462, in check_permission
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/", line 296, in check_permission
  File "/usr/local/lib/python2.6/dist-packages/Trac-1.0-py2.6.egg/trac/", line 398, in get_user_permissions
    for perm in or []:
  File "/usr/local/lib/python2.6/dist-packages/TracDirectoryAuth-0.5-py2.6.egg/tracext/adauth/", line 43, in get_user_permissions
  File "/usr/local/lib/python2.6/dist-packages/TracDirectoryAuth-0.5-py2.6.egg/tracext/adauth/", line 215, in get_permission_groups
    dn = self._get_user_dn(username)
  File "/usr/local/lib/python2.6/dist-packages/TracDirectoryAuth-0.5-py2.6.egg/tracext/adauth/", line 299, in _get_user_dn
    [self.user_attr], cache)
  File "/usr/local/lib/python2.6/dist-packages/TracDirectoryAuth-0.5-py2.6.egg/tracext/adauth/", line 503, in _dir_search
    res = dir.search_s(basedn.encode(self.dir_charset), scope, filter, attrs)
  File "/usr/lib/python2.6/dist-packages/ldap/", line 516, in search_s
    return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)
  File "/usr/lib/python2.6/dist-packages/ldap/", line 828, in search_ext_s
    return self._apply_method_s(SimpleLDAPObject.search_ext_s,*args,**kwargs)
  File "/usr/lib/python2.6/dist-packages/ldap/", line 780, in _apply_method_s
    return func(self,*args,**kwargs)
  File "/usr/lib/python2.6/dist-packages/ldap/", line 509, in search_ext_s
    msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)
  File "/usr/lib/python2.6/dist-packages/ldap/", line 505, in search_ext
  File "/usr/lib/python2.6/dist-packages/ldap/", line 96, in _ldap_call
    result = func(*args,**kwargs)
TypeError: an integer is required

|Trac 	|1.0 |
|Genshi 	|0.6 (without speedups) |
|pysqlite 	|2.5.5|
|Python 	|2.6.5 (r265:79063, Oct 1 2012, 22:04:36) [GCC 4.4.3]|
|setuptools 	|0.6 |
|SQLite 	|3.6.22 |
|Subversion 	|1.6.6 (r40053) |

Maybe the parameter is not ready for use yet, in that case this isn't really a bug then.

Attachments (0)

Change History (3)

comment:1 Changed 19 months ago by anonymous

Here's the patch I'm using:

---     (revision 12445)
+++     (working copy)
@@ -33,7 +33,8 @@

     dir_uri = Option('account-manager', 'dir_uri', 'ldap://localhost', 'URI of the LDAP or Active Directory Server')
     dir_charset = Option('account-manager', 'dir_charset', 'utf-8', 'Text encoding used by the LDAP or Active Directory Server')
-    dir_scope = Option('account-manager', 'dir_scope', 1, '0=Base, 1=OneLevel, 2=Subtree')
+    #-- Setting dir_scope to 2 in order for authentication to work (SIBA)
+    dir_scope = Option('account-manager', 'dir_scope', 2, '0=Base, 1=OneLevel, 2=Subtree')
     dir_binddn = Option('account-manager', 'dir_binddn', '', 'DN used to bind to AD, leave blank for anonymous bind')
     dir_bindpw = Option('account-manager', 'dir_bindpw', '', 'Password used when binding to AD, leave blank for anonymous bind')
     dir_timeout = Option('account-manager', 'dir_timeout', 5, 'ldap response timeout in seconds')

comment:2 Changed 19 months ago by rjollos

  • Description modified (diff)

comment:3 Changed 16 months ago by rjollos

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

Duplicate of #10581, fixed in [12963].

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.