[Portland-bugs] [Bug 109205] New: Endless recursion in xdg-open due to incorrect handling of spaces in directory names
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Jan 1 15:48:36 UTC 2019
https://bugs.freedesktop.org/show_bug.cgi?id=109205
Bug ID: 109205
Summary: Endless recursion in xdg-open due to incorrect
handling of spaces in directory names
Product: Portland
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: xdg-utils
Assignee: portland-bugs at lists.freedesktop.org
Reporter: sophie.hirn at wyvernscale.com
xdg-open can be brought to recurse endlessly into a crash with the following
setup:
1. Inside the search path for .desktop files, place a directory with name
(e.g.) `Grinding Gear Games`
2. Create a directory named `Games` in your home directory.
3. Create a subdirectory named `Grinding Gear Games` somewhere inside the
`~/Games` directory.
Now, running e.g. `xdg-open https://en.wikipedia.org` from your home directory
will result in an endless recursion and inevitable crash.
I've already found the offending line, it's `scripts/xdg-open.in:330`, which
reads `for d in $dir/*/; do`.
The spaces in the directory name mentioned above lead the search into `~/Games`
due to improper space handling, and the directory `~/Games/<...>/Grinding Gear
Games` makes the search go back to `~/Games` again.
However, I haven't found a POSIX-compliant way of fixing the problem without
restructuring the entire function yet, all my attempts relied either on
bash-specific behaviour or GNU extensions to `find`.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/portland-bugs/attachments/20190101/85517e2a/attachment.html>
More information about the Portland-bugs
mailing list