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
opening repo: opendir() fails when path contains non-ASCII chars or spaces #4378
Comments
What version of libostree are you using? This might be the same issue fixed in ostreedev/ostree#2293. |
@smcv Does this help? |
Yes, that's libostree, and that version does not have the fix I linked to. |
This seems to have been an OSTree bug that's now fixed, so closing. |
raspbian-autopush
pushed a commit
to raspbian-packages/ostree
that referenced
this issue
Mar 27, 2022
Currently if a file path contains a special character such as '\', and that character is encoded into a file:// URI that is passed to ostree_repo_pull_with_options(), the percent encoding will remain in the path passed to g_file_new() (in the case of backslash %5C) and the pull will then fail with a file not found error. This is an important edge case to handle because by default on many Linux distributions a filesystem with no label is mounted at a path based on its UUID, and this is then passed to systemd-escape by Flatpak (when --enable-auto-sideloading was used at compile time) to create a symbolic link such as this which contains backslashes: $ ls -l /run/flatpak/sideload-repos/ total 0 lrwxrwxrwx 1 mwleeds mwleeds 55 Mar 9 14:21 'automount-run-media-mwleeds-29419e8f\x2dc680\x2d4e95\x2d9a31\x2d2cc907d421cb' -> /run/media/mwleeds/29419e8f-c680-4e95-9a31-2cc907d421cb And Flatpak then passes libostree a file:// URI containing that path, to implement sideloading (pulling content from the USB drive). This results in an error like: Error: While pulling app/org.videolan.VLC/x86_64/stable from remote flathub: /run/flatpak/sideload-repos/automount-run-media-mwleeds-29419e8f%5Cx2dc680%5Cx2d4e95%5Cx2d9a31%5Cx2d2cc907d421cb/.ostree/repo: opendir(/run/flatpak/sideload-repos/automount-run-media-mwleeds-29419e8f%5Cx2dc680%5Cx2d4e95%5Cx2d9a31%5Cx2d2cc907d421cb/.ostree/repo): No such file or directory This patch avoids such errors by using g_file_new_for_uri() instead of g_file_new_for_path(), so that GLib handles the %-decoding for us. Bug: https://community.endlessos.com/t/can-not-install-vlc-from-usb-drive-3-9-3/16353 Bug: flatpak/flatpak#4378 Origin: upstream, 2021.1, commit:19577522f8eacd868cf25d53e1ac0e7f424e952b Gbp-Pq: Name Fix-translation-of-file-URIs-into-paths.patch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Linux distribution and version
Debian 10
Flatpak version
Flatpak 1.10.2
flatpak-builder 1.0.5
Description of the problem
My understanding is that when using
--install
flag on flatpak-builder, it adds a local remote to flatpak. If the directory whereflatpak.{yaml,json}
is located contains non-ASCII characters or spaces, adding the local remote fails. This sucks for non-English speakers and non-technical people who might use spaces in their folder names.Steps to reproduce
/home/user/работа/
,/tmp/GüntherJauch/
,/mnt/施氏食獅史/flatpak
,/home/user/work for client/
)hello.sh
andflatpak.yaml
as described in https://docs.flatpak.org/en/latest/first-build.htmlflatpak-builder build-dir flatpak.yml --install --user
The text was updated successfully, but these errors were encountered: