Edgewall Software

Opened 11 years ago

Last modified 11 years ago

#10935 closed defect

Trac should read the REMOTE_USER as UTF-8 — at Version 1

Reported by: bert Owned by:
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Thijs Triemstra)

When Trac reads the REMOTE_USER from the environment it is not prepared for UTF-8 names (for example when the user is autheticated via SSL certificate and has a name with a german umlaut)

The property Request.remote_user() (in web/api.py) should read

    @property
    def remote_user(self):
        """ Name of the remote user.
        
        Will be `None` if the user has not logged in using HTTP authentication.
        """
        #return self.environ.get('REMOTE_USER')
        return unicode(self.environ.get('REMOTE_USER'), 'utf-8')

to avoid that. Otherwise the sqlite code used in Trac will brake and a backtrace instead of any webpage will be returned.

This is a one-line diff we had to apply on all Trac versions so far and also on 1.0 now.

Please integrate in the next version.

(Note that most other strings in the same file are treated as UTF-8 already)

Change History (1)

comment:1 by Thijs Triemstra, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.