[Linuxptp-devel] [PATCH RFC 3/4] pmc: Add support for dropping root privileges.

2018-08-10 Thread Miroslav Lichvar
Signed-off-by: Miroslav Lichvar --- pmc.8 | 8 pmc.c | 5 + 2 files changed, 13 insertions(+) diff --git a/pmc.8 b/pmc.8 index db472d3..81278f4 100644 --- a/pmc.8 +++ b/pmc.8 @@ -140,6 +140,14 @@ options. The name of the section is the name of the configured port (e.g. .B

[Linuxptp-devel] [PATCH RFC 4/4] phc2sys: Add support for dropping root privileges.

2018-08-10 Thread Miroslav Lichvar
Signed-off-by: Miroslav Lichvar --- phc2sys.8 | 8 phc2sys.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/phc2sys.8 b/phc2sys.8 index 45cb0e3..4fe1967 100644 --- a/phc2sys.8 +++ b/phc2sys.8 @@ -401,6 +401,14 @@ Same as option .B \-z (see above). +.TP +.B user +The name

[Linuxptp-devel] [PATCH RFC 1/4] util: Add function to drop root privileges.

2018-08-10 Thread Miroslav Lichvar
Switch the user/group ID to the specified user in order to drop the root privileges, but keep the capability to adjust the clock and bind to a privileged port using the libcap library. Signed-off-by: Miroslav Lichvar --- incdefs.sh | 11 - makefile | 4 util.c | 67

[Linuxptp-devel] [PATCH RFC 0/4] Support for dropping root privileges

2018-08-10 Thread Miroslav Lichvar
This patchset implements a support for dropping all root privileges except adjusting the clock and binding to a privileged port, using the libcap library. A new option is added to ptp4l/phc2sys/pmc to specify the username to which should be the identity switched. The UDS transport requires a

[Linuxptp-devel] [PATCH RFC 2/4] ptp4l: Add support for dropping root privileges

2018-08-10 Thread Miroslav Lichvar
If a username is specified with the user option, switch to the user between opening the PHC and opening the ports. Signed-off-by: Miroslav Lichvar --- clock.c | 5 + config.c | 1 + ptp4l.8 | 7 +++ 3 files changed, 13 insertions(+) diff --git a/clock.c b/clock.c index