Modify

Opened 7 years ago

Closed 7 years ago

#1392 closed defect (duplicate)

Internal error when logging in using tracd

Reported by: Peter Owned by: mgood
Priority: high Component: AccountManagerPlugin
Severity: critical Keywords: tracd LoginModule
Cc: Trac Release: 0.10

Description

After entering my login data on the login modul and submitting i get the following error message:

Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 182, in dispatch
    req.authname = self.authenticate(req)
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 146, in authenticate
    authname = authenticator.authenticate(req)
  File "build/bdist.freebsd-6.2-RELEASE-p3-i386/egg/acct_mgr/web_ui.py", line 334, in wrap
  File "build/bdist.freebsd-6.2-RELEASE-p3-i386/egg/acct_mgr/web_ui.py", line 344, in authenticate
  File "build/bdist.freebsd-6.2-RELEASE-p3-i386/egg/acct_mgr/web_ui.py", line 371, in _remote_user
  File "build/bdist.freebsd-6.2-RELEASE-p3-i386/egg/acct_mgr/api.py", line 104, in check_password
  File "build/bdist.freebsd-6.2-RELEASE-p3-i386/egg/acct_mgr/htfile.py", line 72, in check_password
  File "build/bdist.freebsd-6.2-RELEASE-p3-i386/egg/acct_mgr/htfile.py", line 176, in _check_userline
NameError: global name 'user' is not defined

I'm running a fresh Trac installation with tracd version 0.10.3.1, WebAdmin 0.1.2dev-r4429 and Acct_Mgr 0.1.3dev-r2128. I'm running python 2.4.4
with setuptools-0.6c5-py2.4. I also tried WebAdmin r4240 and Acct_Mgr r2121, but with no success.
Authentication with htdigest works great when using the trac built-in login mechanism.

Relating trac.ini entries:

[account-manager]
htdigest_realm = trac
password_file = /usr/local/share/trac/digest.auth
password_store = HtDigestStore

[components]
acct_mgr.* = enabled
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.db.sessionstore = enabled
acct_mgr.htfile.abstractpasswordfilestore = enabled
acct_mgr.htfile.htdigeststore = enabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.http.httpauthstore = enabled
acct_mgr.pwhash.htdigesthashmethod = enabled
acct_mgr.pwhash.htpasswdhashmethod = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
acct_mgr.web_ui.registrationmodule = enabled
trac.db.mysql_backend.mysqlconnector = disabled
trac.db.postgres_backend.postgresqlconnector = disabled
trac.web.auth.loginmodule = disabled
webadmin.* = enabled

My digest.auth looks like

username:trac:32e053b200f9b48c5878fc6b14c196c5

Is this a problem with the tracd? I ran trac with accountmanager on apache without problems. But in this case i can only use tracd and don't want to pass on the web based login module

Regards
Peter

Attachments (1)

trac-accountmanager-svn-0.10_ticket_1392.diff (1.2 KB) - added by eddymul@… 7 years ago.
Patch agains acct_mgr/htfile.py r2137. Passes tests.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by dr2chase

I can confirm that if a user parameter is added here, to the HtPasswdStore version, and to the call, the problem goes away.

    def _check_userline(self, password, prefix, suffix):
        return suffix == htdigest(user, self.realm, password)

(That is, I did that change locally, the problem went away.)

comment:2 Changed 7 years ago by beau@…

I'm running into this too with Python 2.4, Trac 0.10, and the latest Webadmin and AccountManager as of 3/28/2007.

I'm using the CGI, however, and not tracd.

comment:3 follow-up: Changed 7 years ago by anonymous

Here's the diff, hope this helps someone until it's fixed:

71c71
<                     return self._check_userline(user, password, prefix,
---
>                     return self._check_userline(password, prefix,
175c175
<     def _check_userline(self, user, password, prefix, suffix):
---
>     def _check_userline(self, password, prefix, suffix):

comment:4 Changed 7 years ago by anonymous

Sorry, should have mentioned that's in htfile.py.

Changed 7 years ago by eddymul@…

Patch agains acct_mgr/htfile.py r2137. Passes tests.

comment:5 in reply to: ↑ 3 Changed 7 years ago by izekia@…

Replying to anonymous:

Here's the diff, hope this helps someone until it's fixed:

71c71
<                     return self._check_userline(user, password, prefix,
---
>                     return self._check_userline(password, prefix,
175c175
<     def _check_userline(self, user, password, prefix, suffix):
---
>     def _check_userline(self, password, prefix, suffix):

also need to patch line 137

comment:6 Changed 7 years ago by mgood

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

Looks like #1410 was a duplicate of this one, but I fixed that one yesterday.

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 mgood. 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.