segfault if .desktop file is not installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Messaging Menu |
Fix Released
|
High
|
Lars Karlitski | ||
indicator-messages (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
If the application's .desktop file isn't install, it will crash after creating a MessagingMenu.App object. This simple Vala program demonstrates this:
void main(string[] args) {
Gtk.init(ref args);
MessagingMe
app.register();
Gtk.main();
}
To compile:
$ valac --pkg=gtk+-3.0 --pkg=Messaging
(GTK may not be strictly required to repro this bug.)
At a minimum, I wouldn't expect the application to crash in this situation.
What would be *better* is if the caller could supply a path to a .desktop file rather than MessagingMenu expect to find it in /usr/share/
Related branches
- jenkins (community): Needs Fixing (continuous-integration)
- Charles Kerr (community): Approve
-
Diff: 62 lines (+14/-3)1 file modifiedlibmessaging-menu/messaging-menu.c (+14/-3)
Changed in indicator-messages: | |
milestone: | none → 12.10.4 |
assignee: | nobody → Lars Uebernickel (larsu) |
importance: | Undecided → High |
status: | New → In Progress |
Changed in indicator-messages: | |
status: | In Progress → Fix Committed |
Changed in indicator-messages: | |
status: | Fix Committed → Fix Released |
Changed in indicator-messages (Ubuntu): | |
importance: | Undecided → High |
status: | Triaged → Fix Committed |
Hi Jim, thanks for reporting the crash. The attached branch fixes the issue.
I disagree on allowing to pass desktop filenames. The messaging menu uses g_desktop_ app_info_ new, which follows the XDG spec for desktop files. This is useful for distributors and users to override desktop files.
Passing paths directly can also be misused easily: only correctly installed applications should ever be shown in the messaging menu, so that users can find the same application in the dash.
> We like to be able to build, run, and test our apps from the build directory.
Easiest would be to copy the desktop file into ~/.local/ share/applicati ons/ temporarily. Alternatively, you could restart indicator- messages- service with XDG_DATA_DIRS set to the source path of your application.