From 4564dd1feee2118e34849a4f8530b75ceb96a78a Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 15 Jul 2018 09:53:35 +0200 Subject: [PATCH] unix.7: If the buffer to receive SCM_RIGHTS FDs is too small, FDs are closed If the ancillary data buffer for receiving SCM_RIGHTS file descriptors is too small, then the excess file descriptors are automatically closed in the receiving process. Verified by experiment. Signed-off-by: Michael Kerrisk --- man7/unix.7 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man7/unix.7 b/man7/unix.7 index f03e7bd12..17a10d3db 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -381,6 +381,12 @@ Semantically, this operation is equivalent to duplicating .RB ( dup (2)) a file descriptor into the file descriptor table of another process. .IP +If the buffer used to receive the ancillary data containing +file descriptors is too small (or is absent), +then the ancillary data is truncated (or discarded) +and the excess file descriptors are automatically closed +in the receiving process. +.IP The kernel constant .BR SCM_MAX_FD defines a limit on the number of file descriptors in the array.