Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host provided XDG_DATA_DIRS not handled correctly #911

Closed
ttimasdf opened this issue Aug 15, 2023 · 0 comments · Fixed by #912
Closed

host provided XDG_DATA_DIRS not handled correctly #911

ttimasdf opened this issue Aug 15, 2023 · 0 comments · Fixed by #912

Comments

@ttimasdf
Copy link
Contributor

distrobox/distrobox-enter

Lines 357 to 367 in cdaa860

# Ensure the standard FHS program paths are in XDG_DATA_DIRS environment
standard_paths="/usr/local/share /usr/share"
container_paths="${XDG_DATA_DIRS:=}"
# add to the XDG_DATA_DIRS only after the host's paths, and only if not already present.
for standard_path in ${standard_paths}; do
if [ -n "${container_paths##*:"${standard_path}"*}" ]; then
container_paths="${container_paths}:${standard_path}"
fi
done
result_command="${result_command}
--env \"XDG_DATA_DIRS=${container_paths}\""

When launching distrobox-enter with empty XDG_DATA_DIRS, standard paths are not added to environment variable.

++ standard_paths='/usr/local/share /usr/share'
++ container_paths=
++ for standard_path in '${standard_paths}'
++ '[' -n '' ']'
++ for standard_path in '${standard_paths}'
++ '[' -n '' ']'
++ result_command='docker exec
# skipped lines..
		--env "PATH=/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
		--env "XDG_DATA_DIRS="'
++ set +x

This happens when launching integrated VSCode app from GNOME 2 menu launcher.

environment: bash 4.2 on CentOS 7

sh-4.2$ sh --version
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant