bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

Consistently use cleanup_fdp() to close fds when the result is ignored

Open smcv opened this issue 1 year ago • 1 comments

This avoids leaving dangling references to fds that no longer exist, clarifying ownership.

This commit does not cover the socket pairs used to transfer the pid of a descendant process (see #665 for that) and privilege-separated operations (see #666).

cc @refi64

smcv avatar Oct 30 '24 15:10 smcv

This avoids leaving dangling references to fds that no longer exist

... except actually no it doesn't, because cleanup_fdp() doesn't set *fdp = -1. Maybe it should, or maybe we should have a different helper function.

smcv avatar Oct 30 '24 15:10 smcv