xdg-desktop-menu uninstall hangs if menu file names have spaces
Bug #1432932 reported by
Mark Malakanov
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xdg-utils |
Fix Released
|
Medium
|
|||
xdg-utils (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
xdg-desktop-menu uninstall hangs if menu file names have spaces
for example when uninstalling a custom menu it hangs on processing "$HOME/
Changed in xdg-utils: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
no longer affects: | xdg-utils |
Changed in xdg-utils: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
To post a comment you must log in.
Steps to reproduce:
1. Create a .desktop file with a vendor prefix and a space in the name. e.g., "foo-bar baz.desktop".
2. Run: xdg-desktop-menu install --mode user "foo-bar baz.desktop"
Expected result: The file is copied to "~/.local/ share/applicati ons/foo- bar baz.desktop".
Actual result: baz.desktop'
xdg-desktop-menu: filename 'baz.desktop' does not have a proper vendor prefix
A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated
with a dash ("-"). An example filename is 'example-
Use --novendor to override or 'xdg-desktop-menu --manual' for additional info.
This is because it thinks I am passing two separate filenames ("foo-bar" and "baz.desktop") even though I correctly used quotes on the command line. This is caused by line 998 of the script, which concatenates all arguments ending in .desktop onto $desktop_files, separating each argument with a space. After that point, it is impossible to tell which spaces separate arguments and which are part of the filename.
(Note that if all of the space-separated parts of the filename contain a "-", you don't see the above error, it just fails silently because it can't find the files it is trying to copy.)