* stratumweight directive:: Specify how important is stratum when selecting source
* lock_all directive:: Require that chronyd be locked into RAM.
* tempcomp directive:: Specify temperature sensor and compensation coefficients
+* user directive:: Specify user for dropping root privileges
@end menu
@c }}}
frequency will not be adjusted. When it is 27 degrees (27000), the clock will
be set to run 0.183ppm faster than it would be without the compensation, etc.
+@c }}}
+@c {{{ user
+@node user directive
+@subsection user
+The @code{user} directive sets the name of the user to which will
+@code{chronyd} drop root privileges after the initialisation. So far, it works
+only on Linux when compiled with capabilities support.
+
+By default, root privileges are not dropped.
@c }}}
@c }}}
@c {{{ S:Running chronyc
static void parse_tempcomp(const char *);
static void parse_include(const char *);
static void parse_leapsectz(const char *);
+static void parse_user(const char *);
/* ================================================== */
/* Configuration variables */
/* Name of a system timezone containing leap seconds occuring at midnight */
static char *leapsec_tz = NULL;
+/* Name of the user to which will be dropped root privileges. */
+static char *user = NULL;
+
/* ================================================== */
typedef struct {
{"leapsectz", 9, parse_leapsectz},
{"linux_hz", 8, parse_linux_hz},
{"linux_freq_scale", 16, parse_linux_freq_scale},
+ {"user", 4, parse_user},
{"sched_priority", 14, parse_sched_priority},
{"lock_all", 8, parse_lockall}
};
/* ================================================== */
+static void
+parse_user(const char *line)
+{
+ /* This must allocate enough space! */
+ user = MallocArray(char, 1 + strlen(line));
+ sscanf(line, "%s", user);
+}
+
+/* ================================================== */
+
void
CNF_ProcessInitStepSlew(void (*after_hook)(void *), void *anything)
{
*k2 = tempcomp_k2;
}
+/* ================================================== */
+
+char *
+CNF_GetUser(void)
+{
+ return user;
+}