Skip to content

pv-wrap: When running in Flatpak, forward inherited fds to subsandbox

Simon McVittie requested to merge wip/sr644 into main

When we are using steam-runtime-launch-client to set up a subsandbox for the pressure-vessel container, it is not enough to mark fds as non-O_CLOEXEC: we also need to instruct s-r-launch-client to forward them over D-Bus to flatpak-portal. We already did this for the fds managed by the FlatpakBwrap object, but not for other inherited fds.

Before v0.20240103.0, all fds that we wanted to send to the remote subsandbox were managed by the FlatpakBwrap object, but this was wrong because it had the side-effect of seeking log files back to byte 0 (steamrt/tasks#370). Since v0.20240103.0, we split out some of the fds into the inherit_fds array, but we did not emit --forward-fd for those.

In some situations (notably launching the SteamLinuxRuntime_sniper container for the steamwebhelper process in recent Steam client betas) this worked anyway, but it seems that this only happened by coincidence.

Addresses https://github.com/ValveSoftware/steam-runtime/issues/644 and probably https://github.com/flathub/com.valvesoftware.Steam/issues/1235.

Fixes: 8ee66f4c "pv-wrap: Don't register stdout, stderr, --pass-fd with FlatpakBwrap"

Merge request reports