settings-ui crashes if account password has unicode

Bug #955139 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
High
Mike Milner

Bug Description

andreas@nsn7:~$ landscape-client-settings-ui
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/landscape/ui/controller/app.py", line 77, in setup_ui
    self.on_succeed, self.on_fail)
  File "/usr/lib/python2.7/dist-packages/landscape/ui/controller/configuration.py", line 67, in persist
    self._configuration.persist()
  File "/usr/lib/python2.7/dist-packages/landscape/ui/model/configuration/state.py", line 509, in persist
    self._current_state = self._current_state.persist()
  File "/usr/lib/python2.7/dist-packages/landscape/ui/model/configuration/state.py", line 358, in persist
    return self._persistable_helper.persist()
  File "/usr/lib/python2.7/dist-packages/landscape/ui/model/configuration/state.py", line 289, in persist
    self._save_to_config()
  File "/usr/lib/python2.7/dist-packages/landscape/ui/model/configuration/state.py", line 285, in _save_to_config
    self._state._proxy.write()
  File "/usr/lib/python2.7/dist-packages/landscape/ui/model/configuration/proxy.py", line 61, in write
    self._interface.write()
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.UnicodeEncodeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.7/dist-packages/landscape/ui/model/configuration/mechanism.py", line 59, in write
    self._config.write()
  File "/usr/lib/python2.7/dist-packages/landscape/deployment.py", line 224, in write
    config_parser.write(config_file)
  File "/usr/lib/python2.7/ConfigParser.py", line 412, in write
    key = " = ".join((key, str(value).replace('\n', '\n\t')))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

After this, it crashes everytime when openking, because the unicode password was stored in debconf or somewhere else. It's not in the config file.

I suspect account names with unicode, or anything else entered by users in unicode, could also crash it.

Tags: client-ui

Related branches

Mike Milner (milner)
Changed in landscape-client:
assignee: nobody → Mike Milner (milner)
status: New → In Progress
Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.