[BUG] error authenticating captive portal when password contains the British pound
I have come across a slightly obscure error.
When a user has the British pound symbol £ (ASCII 156 i believe) in their password, the captive portal crashes giving a python error (MOD_PYTHON ERROR)
The error code is:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 6: ordinal not in range(128)
(Note position 6 was where I used the £ sign in the password for testing)
Full error page below:
Code:
MOD_PYTHON ERROR
ProcessId: 9359
Interpreter: 'localhost'
ServerName: 'localhost'
DocumentRoot: '/var/www/'
URI: '/capture/handler.py/authpost'
Location: '/capture'
Directory: None
Filename: '/usr/share/untangle/web/capture/handler.py'
PathInfo: '/authpost'
Phase: 'PythonHandler'
Handler: 'mod_python.publisher'
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
result = object(arg)
File "/usr/lib/python2.5/site-packages/mod_python/publisher.py", line 213, in handler
published = publish_object(req, object)
File "/usr/lib/python2.5/site-packages/mod_python/publisher.py", line 425, in publish_object
return publish_object(req,util.apply_fs_data(object, req.form, req=req))
File "/usr/lib/python2.5/site-packages/mod_python/util.py", line 554, in apply_fs_data
return object(**args)
File "/usr/share/untangle/web/capture/handler.py", line 82, in authpost
authResult = captureNode.userAuthenticate(address, username, password)
File "/usr/lib/python2.5/jsonrpc/proxy.py", line 62, in __call__
postdata = dumps({"method": self.__serviceName, 'params': args, 'id': ServiceProxy.__request_id })
File "/usr/lib/python2.5/jsonrpc/json.py", line 80, in dumps
return unicode("".join([part for part in dumpParts (obj)]))
File "/usr/lib/python2.5/jsonrpc/json.py", line 100, in dumpParts
for part in dumpParts (value):
File "/usr/lib/python2.5/jsonrpc/json.py", line 114, in dumpParts
for part in dumpParts (item):
File "/usr/lib/python2.5/jsonrpc/json.py", line 104, in dumpParts
yield u'"' + StringEscapeRE.sub(escapeChar, obj) +u'"'
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 6: ordinal not in range(128)
MODULE CACHE DETAILS
Accessed: Thu Feb 21 13:46:18 2013
Generation: 3
_mp_c987cf865de2aaf876a5e472306c64ad {
FileName: '/usr/share/untangle/web/capture/handler.py'
Instance: 1
Generation: 1
Modified: Thu Jan 31 16:58:06 2013
Imported: Mon Feb 18 07:22:08 2013