Skip to content
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

Replace flatpak_close_fds_workaround() with g_fdwalk_set_cloexec() #5687

Merged
merged 2 commits into from
Feb 15, 2024

Commits on Feb 15, 2024

  1. build: Consistently put libglnx.la last in lists of dependencies

    It needs to be able to satisfy dependencies of higher-level Flatpak
    static libraries.
    
    Signed-off-by: Simon McVittie <[email protected]>
    smcv committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    740f312 View commit details
    Browse the repository at this point in the history
  2. Replace flatpak_close_fds_workaround() with g_fdwalk_set_cloexec()

    flatpak_close_fds_workaround() wasn't technically async-signal-safe,
    because the requirement for sysconf() to be async-signal-safe was
    removed in POSIX.1-2008.
    
    It could also leave high fds open in some cases: in practice
    sysconf(_SC_OPEN_MAX) returns the soft resource limit, but if our
    resource limit has been reduced by an ancestor process, we could
    conceivably still have fds open and inherited above that number.
    
    We can fix this by using g_fdwalk_set_cloexec() with GLib >= 2.79.2,
    or the backport in libglnx with older GLib. This uses close_range()
    if possible, falling back to rummaging in /proc with async-signal-safe
    syscalls.
    
    Signed-off-by: Simon McVittie <[email protected]>
    smcv committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    221c15e View commit details
    Browse the repository at this point in the history