Modify

Opened 5 years ago

Closed 5 years ago

#9711 closed defect (worksforme)

Backslash in username breaks plugin

Reported by: wwerner@… Owned by: Colin Guthrie
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords: IndexError, backslash
Cc: Trac Release: 0.12

Description

I'm using Trac 0.12 with IIS7 (with IIS6 enabled) and isapi_wsgi on Windows 7

I'm using the builtin IIS authentication and it provides me with the domain as well as username, e.g. ABC\wwerner

This is fine for most everything else, but when I click on "Work Log" in the nav bar and then click on my username, I get an IndexError.

I'm not at all married to the idea of having the domain with the username and would actually prefer the ability to somehow change the name that trac gets - at the very least strip the domain and backslash.

Here's the information that it provides me with:

How to Reproduce

While doing a GET operation on /worklog/users/DTC/uwwerne, Trac issued an internal error.

Request parameters:

{}

User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7

System Information

Trac 0.12.2
Genshi 0.6
Mercurial 2.0.2
Pygments 1.4
pysqlite 2.6.0
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
setuptools 0.6c11
SQLite 3.6.21
jQuery 1.4.2

Enabled Plugins

estimationtools 0.4.5
roadmaphours 0.5
timingandestimationplugin 1.2.4
tracdiscussion 0.8
tracmarkdownmacro 0.11.1
tracmercurial 0.12.0.28
tracsubticketsplugin 0.1.0
worklog 0.2

===

Thanks

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by wwerner@…

Resolution: worksforme
Status: newclosed

Using code from this link I was able to add this code:

def application(environ, start_response):
    if "\\" in environ['REMOTE_USER']:
        environ['REMOTE_USER'] = environ['REMOTE_USER'].replace("\\", ".")
    #Stuff that's already there

to my trac_wsgi.py script

This actually fixed a number of other related issues. Additionally, I could go ahead and put a dictionary of usernames to their "friendly names" here.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Colin Guthrie.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.