The NTS-KE helper doesn't need to bind sockets or adjust the clock.
Don't start the privops helper, or keep the capabilities, when dropping
root privileges in its context.
clock_control ? "cap_sys_time=ep" : "") >= sizeof (cap_text))
assert(0);
+ /* Helpers don't need any capabilities */
+ if (context != SYS_MAIN_PROCESS)
+ cap_text[0] = '\0';
+
if ((cap = cap_from_text(cap_text)) == NULL) {
LOG_FATAL("cap_from_text() failed");
}
#ifdef FEAT_PRIVDROP
void SYS_MacOSX_DropRoot(uid_t uid, gid_t gid, SYS_ProcessContext context)
{
- PRV_StartHelper();
+ if (context == SYS_MAIN_PROCESS)
+ PRV_StartHelper();
UTI_DropRoot(uid, gid);
}
/* On NetBSD the helper is used only for socket binding, but on FreeBSD
it's used also for setting and adjusting the system clock */
- PRV_StartHelper();
+ if (context == SYS_MAIN_PROCESS)
+ PRV_StartHelper();
UTI_DropRoot(uid, gid);
void
SYS_Solaris_DropRoot(uid_t uid, gid_t gid, SYS_ProcessContext context)
{
- PRV_StartHelper();
+ if (context == SYS_MAIN_PROCESS)
+ PRV_StartHelper();
UTI_DropRoot(uid, gid);
}
#endif