diff --git a/common/flatpak-context.c b/common/flatpak-context.c index 9226b045..64b7a71d 100644 --- a/common/flatpak-context.c +++ b/common/flatpak-context.c @@ -44,6 +44,7 @@ #include "flatpak-error.h" #include "flatpak-metadata-private.h" #include "flatpak-usb-private.h" +#include "flatpak-utils-base-private.h" #include "flatpak-utils-private.h" /* Same order as enum */ @@ -4051,6 +4052,8 @@ flatpak_context_export (FlatpakContext *context, const char *rest = NULL; const char *config_key = NULL; g_autofree char *subpath = NULL; + g_autofree char *canonical_path = NULL; + g_autofree char *canonical_home = NULL; if (!get_xdg_user_dir_from_string (filesystem, &config_key, &rest, &path)) { @@ -4061,7 +4064,10 @@ flatpak_context_export (FlatpakContext *context, if (path == NULL) continue; /* Unconfigured, ignore */ - if (strcmp (path, g_get_home_dir ()) == 0) + canonical_path = flatpak_canonicalize_filename (path); + canonical_home = flatpak_canonicalize_filename (g_get_home_dir ()); + + if (strcmp (canonical_path, canonical_home) == 0) { /* xdg-user-dirs sets disabled dirs to $HOME, and its in general not a good idea to set full access to $HOME other than explicitly, so we ignore