-
Notifications
You must be signed in to change notification settings - Fork 14
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
flatpak-spawn: don't use locale conversion for env and sandbox-expose #65
base: main
Are you sure you want to change the base?
Conversation
this should allow using non-ascii text in environment variables (and sandbox paths) even if the locale failed to load where the flatpak-spawn helper is run same as flatpak/flatpak#4138
Hmm. This makes sense for |
afaik |
This comment was marked as outdated.
This comment was marked as outdated.
I think this is just a workaround that happens to work when |
this is just a flag glib uses to copy the string without locale conversion before passing it to the callback on unix: https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/goption.c#L1439
|
Ah. Yes you are right about However I still disagree with |
{ "env", 0, G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK, &opt_env_cb, "Set environment variable", "VAR=VALUE" }, | ||
{ "unset-env", 0, G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK, &opt_unset_env_cb, "Unset environment variable", "VAR=VALUE" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least you would want to add a comment explaining why you use the FILENAME flag, because otherwise somebody is going to come along and "fix" it because it doesn't look like a filename.
use G_OPTION_ARG_FILENAME_ARRAY instead of G_OPTION_ARG_STRING_ARRAY + G_OPTION_FLAG_FILENAME, which is not valid
yes, but it runs on host, where thing are stable, but |
Strictly speaking, that's actually wrong, and they should be Unfortunately, When communicating with a version of Flatpak that doesn't have that new API, flatpak-spawn should check that the environment variables it's given are valid UTF-8, and if not, either warn and ignore or fail with an error. I'm not sure which one of those is better. New D-Bus APIs that fix this could add
(reminder that in GVariant text notation, (Or alternatively |
bump, bug happened again |
As Simon said:
So part of this change is incorrect. The part that happens to bypass the original issue. |
Patrick ***@***.***> wrote:
As Simon said:
> flatpak-session-helper and flatpak-portal use a{ss} to represent the environment, which cannot represent environment variable names or values that are not valid UTF-8.
So part of this change is incorrect. The part that happens to bypass the original issue.
--
Reply to this email directly or view it on GitHub:
#65 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
without this change, it's not possible for flatpak-spawn to recognize *valid* utf-8 after updating locales
|
That is a different bug. The locale should never be missing. |
yes, but if you want to test something with |
and again: this is a real bug that is probably affecting all non-ascii users. localization is never technically perfect. this is what we can do now so that english speaking users don't get browsers broken. please merge this |
this should allow using non-ascii text in environment variables (and sandbox paths) even if the locale failed to load where the flatpak-spawn helper is run
previously: flatpak/flatpak#4138, but this was on the portal side
related: flathub/org.gnome.Epiphany#21
flatpak/flatpak#5398 is one of the reasons why the locale might be unavailable