The pmc clients should not need to modify the permissions of their
socket (following the uds_file_mode setting), they can rely on their
umask.
Make the chmod() call on the bound socket only in the server.
This removes a race condition between the bind() and chmod() calls that
could potentially be exploited by ptp4l running under a non-root user.
It could replace the socket with a symlink in order to make the client
running under root to change the mode of a different file.
Signed-off-by: Miroslav Lichvar <mlichvar@...>
Reviewed-by: Jacob Keller <jacob.e.keller@...>