Skip to content

Commit

Permalink
bus/driver: dup fds for queued messages
Browse files Browse the repository at this point in the history
Duplicate all FDs attached to a message when queuing it for sending.
Messages can be queued for arbitrary times, so we cannot rely on
borrowed FDs to be available for long enough.

Reported-by: Camron Carter <reefoe@proton.me>
Signed-off-by: David Rheinsberg <david@readahead.eu>
  • Loading branch information
dvdhrm committed Apr 11, 2024
1 parent f5cb156 commit 4800047
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bus/driver.c
Expand Up @@ -524,7 +524,7 @@ static int driver_send_reply_with_fds(Peer *peer, CDVar *var, uint32_t serial, i
data = NULL;

if (n_fds > 0) {
r = fdlist_new_with_fds(&message->fds, fds, n_fds);
r = fdlist_new_dup_fds(&message->fds, fds, n_fds);
if (r)
return error_fold(r);
}
Expand Down

0 comments on commit 4800047

Please sign in to comment.