Files
flatpak/common
Sebastian Wick c97905c818 utils: Only remove cached files in the cache directory
The function flatpak_switch_symlink_and_remove is used to implement a
cache for ld.so (regenerate_ld_cache). If the active symlink changes to
a new cache file, the old cache file is supposed to get removed.

The symlink still points to the old cache file, so we would remove the
file that it points to and then point at the new file.

Because the symlink is under the app's control, the symlink can point
anywhere, and the removal happens in the host context, which allows an
app to remove arbitrary files on the host.

The filename of the cache files are checksums, which means that we can
ensure that the link is a file in the same directory of the link by
checking that it only contains the chars a-zA-Z0-9.

(cherry picked from commit FIXME)
2026-04-07 16:21:15 -04:00
..
2026-04-07 16:17:51 -04:00
2019-02-25 18:12:30 +00:00
2021-02-09 09:36:59 +01:00
2023-09-04 13:25:32 +01:00
2018-05-24 11:59:52 +00:00
2018-10-08 08:36:23 +00:00
2019-04-08 12:50:42 +00:00