summaryrefslogtreecommitdiff
path: root/addons/web/http.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2013-06-13 19:39:00 +0200
committerChristophe Simonis <chs@openerp.com>2013-06-13 19:39:00 +0200
commita61e7cb0c80ae773cab9753bd8a4e7e888bbf415 (patch)
tree019a235869a5e087055700895d4584c80e2f9afb /addons/web/http.py
parent5ed0ac2614b9430e61dae472d657a21c037d6ee9 (diff)
parent180e6e41d81e28df43b41e3cb6131225d4169a28 (diff)
[MERGE] forward port of branch saas-1 up to revid 4887 chs@openerp.com-20130612153934-qyp6pb3bc4za4taf
bzr revid: chs@openerp.com-20130613172414-dln3g4j0ykcwaa02 bzr revid: chs@openerp.com-20130613173900-xl7rh321nnw2b04b
Diffstat (limited to 'addons/web/http.py')
-rw-r--r--addons/web/http.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/http.py b/addons/web/http.py
index 2dc41c8cad9..5872e80685b 100644
--- a/addons/web/http.py
+++ b/addons/web/http.py
@@ -537,9 +537,13 @@ class DisableCacheMiddleware(object):
def session_path():
try:
- username = getpass.getuser()
- except Exception:
- username = "unknown"
+ import pwd
+ username = pwd.getpwuid(os.geteuid()).pw_name
+ except ImportError:
+ try:
+ username = getpass.getuser()
+ except Exception:
+ username = "unknown"
path = os.path.join(tempfile.gettempdir(), "oe-sessions-" + username)
try:
os.mkdir(path, 0700)