Skip to content

Commit

Permalink
run: Ignore leftover eol-rebase data dir symlink
Browse files Browse the repository at this point in the history
If the current app data dir is removed, flatpak would try to migrate the
symlink that it had previously created, creating a symlink loop.

Fixes: #5668
  • Loading branch information
chrisawi authored and smcv committed Mar 27, 2024
1 parent 55283a0 commit d900529
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/flatpak-run.c
Original file line number Diff line number Diff line change
Expand Up @@ -3091,6 +3091,12 @@ flatpak_run_app (FlatpakDecomposed *app_ref,
{
do_migrate = FALSE; /* Don't migrate older things, they are likely symlinks to this dir */

/* Don't migrate a symlink pointing to the new data dir. It was likely left over
* from a previous migration and would end up pointing to itself */
if (g_file_info_get_is_symlink (previous_app_id_dir_info) &&
g_strcmp0 (g_file_info_get_symlink_target (previous_app_id_dir_info), app_id) == 0)
break;

if (!flatpak_file_rename (previous_app_id_dir, real_app_id_dir, cancellable, &local_error))
{
g_warning (_("Failed to migrate old app data directory %s to new name %s: %s"),
Expand Down

0 comments on commit d900529

Please sign in to comment.