Bug 107416 - xdg-mime can't handle desktop file with spaces in their name
Summary: xdg-mime can't handle desktop file with spaces in their name
Status: RESOLVED MOVED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.1.0 rc3
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-29 09:33 UTC by Jean
Modified: 2019-02-16 13:40 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean 2018-07-29 09:33:38 UTC
If a directory is named "bar foo baz" in an "applications" directory and there exist
a "foo" directory in the current working directory and the directory "foo" has
a filename or subdirectory called "a foo b", a call to `xdg-mime query default <mimetype>` for a non-existent mimetype would freeze. The freezing would make some other programs that rely on xdg-mime freeze as well.

When xdg-mime enter the function `search_desktop_file`, it searches each subdirectory with `for f in $dir/*/; do`, which expands to `for f in $dir/bar foo baz/; do`, it will then search recursively "foo" and will go into a loop.

Using the command `find` might solve this issue.
Comment 1 GitLab Migration User 2019-02-16 13:40:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/131.


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.