Bug 630109

Summary: Openbox xdg-menu doe not escape quotes from .desktop files
Product: [Fedora] Fedora Reporter: Dag <den.mail>
Component: openboxAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: mlichvar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openbox-3.4.11.2-3.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-16 03:49:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
diff file for my proposed patch none

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.