Repository navigation
Conversation
The loop that looks up the XDG user dirs for "--sandbox" runs eval XDG_DIR="$(xdg-user-dir $DIR)", so the path is parsed again as shell code. If a dir has a space in its name, the word after the space is run as a command and XDG_DIR keeps whatever it held before: - With the pt_BR default Desktop, "Área de trabalho" (Russian "Рабочий стол" and Greek have a space too), it prints "de: not found" and DESKTOP falls back to ~/Desktop, which doesn't exist. Allowing the app to access the Desktop gives it --add-file ~/Desktop:rw instead of the real folder. - A dir later in the loop gets the previous dir's path. With XDG_PICTURES_DIR="$HOME/My Pictures", PICTURES becomes ~/Music, so the prompts ask about ~/Music twice and allowing Pictures gives the app read-write access to ~/Music. The same loop is in the launcher script that replaces the AppImage, so the error is printed every time the sandboxed app starts. The second line, eval $DIR="$XDG_DIR", would split the path the same way once the first one is fixed. xdg-user-dir already prints the full path, so a plain command substitution is enough, and eval "$DIR=\$XDG_DIR" (as 7d957c4 did for _read) assigns the value without parsing it again. Both work in POSIX sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.