[FIX]Fixed the issue of session storage directory created with wrong username when someone restart the server using sudo.
bzr revid: msh@openerp.com-20130521105206-8oka7n7t9z13uiwo
This commit is contained in:
parent
c8136cee66
commit
0dc578fc9c
|
@ -488,9 +488,13 @@ class DisableCacheMiddleware(object):
|
|||
|
||||
def session_path():
|
||||
try:
|
||||
username = getpass.getuser()
|
||||
except Exception:
|
||||
username = "unknown"
|
||||
import pwd
|
||||
username = pwd.getpwuid(os.getuid()).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)
|
||||
|
|
Loading…
Reference in New Issue