Bug 35794 - Don't overwrite a /usr/share/applications/defaults.list symlink
Summary: Don't overwrite a /usr/share/applications/defaults.list symlink
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-03-30 04:04 UTC by Martin Pitt
Modified: 2011-03-31 06:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch against git head (1.09 KB, patch)
2011-03-30 04:07 UTC, Martin Pitt
Details | Splinter Review

Description Martin Pitt 2011-03-30 04:04:04 UTC
Original bug: https://bugs.launchpad.net/bugs/703106

Debian's and Ubuntu's desktop-file-utils package creates /usr/share/applications/defaults.list as a symlink to /etc/gnome/defaults.list. Unfortunately, the xdg-update-menu program, when called to install a .desktop file with new mime types, overwrites this symlink with a file. It does this by reading the defaults.list, writing to a temporary file, making edits, then copying it back. it doesn't notice if the defaults.list file is a symlink, and overwrites it with a file.
Comment 1 Martin Pitt 2011-03-30 04:07:28 UTC
Created attachment 45039 [details] [review]
patch against git head

Joe Ebel sent a straightforward patch to this, here is a git-formatted version against master.
Comment 2 Rex Dieter 2011-03-30 09:35:38 UTC
I'm working on fixing mime handling, and part of that involves making xdg-utils not touch defaults.list at all, but apply modifications to mimeapps.list instead.

See also,
http://www.freedesktop.org/wiki/Specifications/mime-actions-spec

In particular,
"However, note that the next section provides another solution for ISV applications which want to ensure they become the default application after being installed: they can edit [or create] the global mimeapps.list file in /usr/share/applications. This is also a solution for system administrators who wish to set up a default application ordering for their users."

That said, the same issue would apply to mimeapps.list too I suppose, so thanks for the patch.
Comment 3 Rex Dieter 2011-03-31 06:09:16 UTC
On second thought, I'll go ahead and apply the patch, making such an invasive change this late in the 1.1 dev cycle is not a good idea.
Comment 5 Martin Pitt 2011-03-31 06:30:38 UTC
Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.