clock: Add support for dropping root privileges.
Add "user" option to specify the user to which ptp4l should switch after
opening the PHC device and before binding the network/UDS ports. Create
the directory that will contain the UDS-RW/RO sockets if it does not
exist and change its ownership to allow the UDS sockets to be bound and
unlinked there.
The default is to keep the identity of the user which started ptp4l.
In the jbod mode, or with a bond interface, the PHC devices need to
have the permissions set for the non-root user to be able to open them
(e.g. by adding the user to a system group owning the PHC devices).
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
3 files changed