ubiquity crash when hostname is too long

Bug #1262528 reported by Bin Li
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Here is the trace log in precise-updates.

Exception in GTK frontend (invoking crash handler):
Traceback (most recent call last):
File "/usr/lib/ubiquity/plugins/ubi-usersetup.py", line 394, in info_loop
   self.hostname_error(make_error_string(self.controller, errors))
File "/usr/lib/ubiquity/plugins/ubi-usersetup.py", line 69, in make_error_string
   return "\n".join([controller.get_string(error) for error in errors])
TypeError: sequence item 0: expected string, NoneType found.

After dig the source code I found the error was set wrong, without prefix 'ubiquity/text/', so that when use controller.get_string() it can't find the correct name and return None, after that the installer crash.

=== modified file 'ubiquity/plugins/ubi-usersetup.py'
--- ubiquity/plugins/ubi-usersetup.py 2012-09-25 22:34:33 +0000
+++ ubiquity/plugins/ubi-usersetup.py 2013-12-19 07:30:34 +0000
@@ -42,13 +42,13 @@
     errors = []
     for result in validation.check_hostname(misc.utf8(hostname)):
         if result == validation.HOSTNAME_LENGTH:
- errors.append('hostname_error_length')
+ errors.append('ubiquity/text/hostname_error_length')
         elif result == validation.HOSTNAME_BADCHAR:
- errors.append('hostname_error_badchar')
+ errors.append('ubiquity/text/hostname_error_badchar')
         elif result == validation.HOSTNAME_BADHYPHEN:
- errors.append('hostname_error_badhyphen')
+ errors.append('ubiquity/text/hostname_error_badhyphen')
         elif result == validation.HOSTNAME_BADDOTS:
- errors.append('hostname_error_baddots')
+ errors.append('ubiquity/text/hostname_error_baddots')
     return errors

 def check_username(username):

Tags: patch
Revision history for this message
Bin Li (binli) wrote :

Here is the patch to fix the check_hostname function.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "check_hostname.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

It appears like this is fixed in wily, at least. Closing as Fix Released.

Changed in ubiquity (Ubuntu):
status: New → 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.