privsep: enforce message boundaries with MSG_EOR on our messages (#533)
privsep: enforce message boundaries with MSG_EOR on our messages
The nature of the SOCK_SEQPACKET, that privsep modules uses, is stream.
See:
https://pubs.opengroup.org/onlinepubs/
9799919799/functions/V2_chap02.html#tag_16_10_06
To guarantee that a reader will never read two messages in one read
operation, the writer shall put end of record markers.
The problem exposed itself in FreeBSD 15.0 that started to follow the
specification better than before.
Other SOCK_SEQPACKET usage considerations: a) as long as our reader
provides a receive buffer that would fit the largest message our writer
would ever send, we are good with regards to not a reading a partial
message b) as long as our writer always write full messages with one
write, we don't need use of MSG_WAITALL in reader.
Fixes #530
Co-authored-by: Roy Marples <roy@marples.name>