Open rene00 opened 9 years ago
This patch allows me to log into Gate One with an unicode CAS username.
--- lib/python2.7/site-packages/gateone/auth/authentication.py 2014-09-16 15:11:29.000000000 +0000
+++ lib/python2.7/site-packages/gateone/auth/authentication.py.344cac79-eefe-1f53-eec9-5406cc9136a5 2014-09-26 05:32:59.669244454 +0000
@@ -153,8 +153,8 @@
user.update(additional_attributes(user))
# Make a directory to store this user's settings/files/logs/etc
try:
- user_dir = os.path.join(self.settings['user_dir'], user['upn'])
- if not os.path.exists(user_dir):
+ user_dir = os.path.join(self.settings['user_dir'], user['upn'].decode('utf-8'))
+ if not os.path.exists(user_dir.encode('utf-8')):
logging.info(_("Creating user directory: %s" % user_dir))
mkdir_p(user_dir)
os.chmod(user_dir, 0o700)
@@ -165,7 +165,7 @@
"your system's locale to something that supports Unicode "
"characters. "))
return
- session_file = os.path.join(user_dir, 'session')
+ session_file = os.path.join(user_dir.encode('utf-8'), 'session')
session_file_exists = os.path.exists(session_file)
if session_file_exists:
session_data = open(session_file).read()
My session dir /var/lib/gateone/users/tùxtàilôr_
is created as expected. I'm running ext4 so cant comment on how any other filesystem will handle the UTF-8 encoding.
The CAS authentication module does not appear to support unicode usernames.
20access.conf
After CAS URL redirect, I get this stacktrace.
Some system details.