Text files containing 'gtk' are seen as Glade project (application/x-glade) files

Bug #995067 reported by Doug McMahon
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
shared-mime-info (Ubuntu)
Fix Released
Low
Unassigned
Precise
Fix Released
Low
Unassigned

Bug Description

Impact: the patch applied before precise to make gtkbuilder files to open with glade was not any restrictive and match any text file containing "gtk" in its first 256 chars to be listed as a glade file

Development Fix: the bug is fixed in quantal

Stable Fix: the fix is a small change to restrict the string from "gtk" to variant for what glade writes

Regression Potential: very limited, it's just glade file detection rules

Test Case:

- install glade if it's not installed
- create a file "bug" containing "this file shows the gtk matching issue"
- browse the directory containing it in nautilus
-> with the buggy version it has a glade icon and opens with glade (first item in the right click menu), with the fix it's displayed as text and open in gedit
- browse /usr/share/gnome-control-center/ui and right click on display-capplet.ui or online-accounts.ui (they are different cases of glade formatting), the first entry should be glade (before or after the update, i.e it should not regress on those)

Revision history for this message
Doug McMahon (mc3man) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nautilus (Ubuntu):
status: New → Confirmed
Revision history for this message
Florian Diesch (diesch) wrote :

This is caused by the MIME type definition for application/x-glade in /usr/share/mime/packages/freedesktop.org.xml (package shared-mime-info):

 <magic priority="50">
      <match value="&lt;glade-interface" type="string" offset="0:256"/>
      <match value="gtk" type="string" offset="0:256"/>
 </magic>

This means that every file that has the string "gtk" in its first 256 bytes has the MIME type application/x-glade - which is a bit too general.

affects: nautilus (Ubuntu) → shared-mime-info (Ubuntu)
Revision history for this message
Doug McMahon (mc3man) wrote :

Florian - thanks for the explanation - makes sense now why position of 1st gtk mattered.

Changed in shared-mime-info (Ubuntu):
importance: Undecided → Low
Changed in shared-mime-info (Ubuntu Precise):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package shared-mime-info - 1.0-0ubuntu5

---------------
shared-mime-info (1.0-0ubuntu5) quantal; urgency=low

  * debian/patches/gtkbuilder.patch:
    - be a bit stricter on the glade matching rules (lp: #995067)
 -- Sebastien Bacher <email address hidden> Wed, 30 May 2012 17:18:08 +0200

Changed in shared-mime-info (Ubuntu):
status: Confirmed → Fix Released
description: updated
description: updated
Changed in shared-mime-info (Ubuntu Precise):
status: Confirmed → Fix Committed
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Doug, or anyone else affected,

Accepted shared-mime-info into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Doug McMahon (mc3man) wrote :

Fixes all previous local issues with text files & passes the described test case completely
For the final test, (context menu on a .ui), did have to try a new user where it was fine, defaulted to glade so no apparent regression
I may have switched defaults previously on main user to gedit

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for testing, if that worked with a new account it's likely the default was just changed for your user as a local config

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package shared-mime-info - 1.0-0ubuntu4.1

---------------
shared-mime-info (1.0-0ubuntu4.1) precise-proposed; urgency=low

  * debian/patches/gtkbuilder.patch:
    - be a bit stricter on the glade matching rules (lp: #995067)
 -- Sebastien Bacher <email address hidden> Wed, 30 May 2012 17:18:08 +0200

Changed in shared-mime-info (Ubuntu Precise):
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.