diff options
| author | bwarsaw | 2006-10-15 22:04:16 +0000 |
|---|---|---|
| committer | bwarsaw | 2006-10-15 22:04:16 +0000 |
| commit | e7fe84dca5681a6de55262a0eddd06758cbd1ce4 (patch) | |
| tree | a4c5a0e2778269c2a77ee0fecae45ac3f8e64de0 /Mailman/SecurityManager.py | |
| parent | d75f597cb3ccfdd6de9c6bb3877e5452884002c9 (diff) | |
| download | mailman-e7fe84dca5681a6de55262a0eddd06758cbd1ce4.tar.gz mailman-e7fe84dca5681a6de55262a0eddd06758cbd1ce4.tar.zst mailman-e7fe84dca5681a6de55262a0eddd06758cbd1ce4.zip | |
Diffstat (limited to 'Mailman/SecurityManager.py')
| -rw-r--r-- | Mailman/SecurityManager.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Mailman/SecurityManager.py b/Mailman/SecurityManager.py index e97084cf1..8c55d2863 100644 --- a/Mailman/SecurityManager.py +++ b/Mailman/SecurityManager.py @@ -57,8 +57,6 @@ import logging import marshal import binascii -from urlparse import urlparse - from Mailman import Errors from Mailman import mm_cfg from Mailman import Utils @@ -225,6 +223,9 @@ class SecurityManager: return True return False + def _cookie_path(self): + return '/%s/%s' % (os.environ['SCRIPT_NAME'], self.fqdn_listname) + def MakeCookie(self, authcontext, user=None): key, secret = self.AuthContextInfo(authcontext, user) if key is None or secret is None or not isinstance(secret, str): @@ -236,10 +237,7 @@ class SecurityManager: # Create the cookie object. c = Cookie.SimpleCookie() c[key] = binascii.hexlify(marshal.dumps((issued, mac))) - # The path to all Mailman stuff, minus the scheme and host, - # i.e. usually the string `/mailman' - path = urlparse(self.web_page_url)[2] - c[key]['path'] = path + c[key]['path'] = self._cookie_path() # We use session cookies, so don't set `expires' or `max-age' keys. # Set the RFC 2109 required header. c[key]['version'] = 1 @@ -253,10 +251,7 @@ class SecurityManager: # string. c = Cookie.SimpleCookie() c[key] = '' - # The path to all Mailman stuff, minus the scheme and host, - # i.e. usually the string `/mailman' - path = urlparse(self.web_page_url)[2] - c[key]['path'] = path + c[key]['path'] = self._cookie_path() c[key]['max-age'] = 0 # Don't set expires=0 here otherwise it'll force a persistent cookie c[key]['version'] = 1 |
