Bug 630109 - Openbox xdg-menu doe not escape quotes from .desktop files
Summary: Openbox xdg-menu doe not escape quotes from .desktop files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openbox
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-03 17:54 UTC by Dag
Modified: 2010-09-16 03:49 UTC (History)
1 user (show)

Fixed In Version: openbox-3.4.11.2-3.fc14
Clone Of:
Environment:
Last Closed: 2010-09-16 03:49:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
diff file for my proposed patch (142 bytes, patch)
2010-09-03 17:54 UTC, Dag
no flags Details | Diff

Description Dag 2010-09-03 17:54:11 UTC
Created attachment 442943 [details]
diff file for my proposed patch

Description of problem:
By default, Openbox generates menus via this file:
/usr/share/lxde/openbox/menu.xml

This file generates some menus on-the-fly by executing this command:
/usr/share/openbox/xdg-menu

This command is a python script that reads content of .desktop files in directory:
/usr/share/applications/

If one .desktop file has some fields with values inside double quotes, like this one :
/usr/share/applications/fedora-system-config-selinux.desktop

here is what's inside this file:
Name[fr]="Gestion de SELinux"

Then the xdg-menu script does not escape the double quotes causing an error in the XML generation, like this:
<item label=""Gestion de SELinux"">

Which is obviously incorrect XML causing openbox to not display the menu (ignored because of an error when parsing XML).

Version-Release number of selected component (if applicable):
openbox-3.4.11.2-1.fc13.x86_64
openbox-libs-3.4.11.2-1.fc13.x86_64

How reproducible:
Always

Steps to Reproduce:
0. init 3
1. create a new user with its empty homedir
2. Xorg &
3. export DISPLAY=':0.0'
4. openbox-session
5. right-clic somewhere on the desktop
6. go to the "applications" sub-menu : it's empty
7. check openbox-session output: it points to the double double-quotes error


Actual results:
The sub-menus generated with xdg-menu script are empty.

Expected results:
The xdg-menu script should take care of existing double-quotes from the .desktop files.

Additional info:
I've corrected this by modifying the line 32:

print ' <item label="%s">' % escape(entry.get_name().replace('"',''))

(see attachment diff file)

Bye for now.

Comment 1 Dag 2010-09-03 18:06:18 UTC
I've forgotten to put that in the steps to reproduce:

after 2. and before 3. :
su - newuser

Comment 2 Fedora Update System 2010-09-07 12:24:00 UTC
openbox-3.4.11.2-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openbox-3.4.11.2-3.fc14

Comment 3 Fedora Update System 2010-09-07 18:36:54 UTC
openbox-3.4.11.2-3.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update openbox'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/openbox-3.4.11.2-3.fc14

Comment 4 Fedora Update System 2010-09-16 03:49:08 UTC
openbox-3.4.11.2-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.