Code

Opened 6 years ago

Closed 3 years ago

#8658 closed Bug (wontfix)

Per request environment not cleaned between requests with mod_python

Reported by: edevil Owned by: nobody
Component: Core (Other) Version: 1.0-beta
Severity: Normal Keywords: modpython environment
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm using a single sign-on system called Shibboleth which is implemented via an Apache module that populates the request environment with information about the logged-in user (if there is one) to the underlying application, Django in this case.

What I'm seeing is, when a logged-in user appears, the vars are set and I can access them in the views with os.environ[VAR]. After that, all requests remain with those vars set, even if the Shibboleth module does not set them in the request environment.

I think this is because of this line in the modpython handler:

  os.environ.update(req.subprocess_env)

This adds the vars to the environ but does not clear them if they are not there. Maybe a copy of the original environment should be kept and restored after the request is served. Or is there a way to access the req.subprocess_env in a view?

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by jacob

  • milestone 1.0 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 6 years ago by ubernostrum

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

(In [8755]) Fixed #8658: Added cross-references to signals docs from Model.save() docs

comment:3 Changed 6 years ago by ubernostrum

  • Resolution fixed deleted
  • Status changed from closed to reopened

(wrong ticket number in commit message)

comment:4 Changed 3 years ago by lukeplant

  • Severity set to Normal
  • Type set to Bug

comment:5 Changed 3 years ago by jacob

  • Easy pickings unset
  • Resolution set to wontfix
  • Status changed from reopened to closed
  • UI/UX unset

mod_python has been deprecated and will be removed shortly so we're no longer fixing bugs related to mod_python. Switch to mod_wsgi (or another WSGI container) and all your prayers will be answered!

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


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

 
Note: See TracTickets for help on using tickets.