From: David Goulet Date: Thu, 19 Jan 2012 18:43:57 +0000 (-0500) Subject: Don't init kernel tracer if not root (UID=0) X-Git-Tag: v2.0-pre17~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d1f1c568e4e28b57156da4fce6b815a56166ecc6;p=lttng-tools.git Don't init kernel tracer if not root (UID=0) No point of trying to init kernel tracer if the session daemon is not root. At this time, only UID=0 can load kernel modules and interact with the lttng kernel tracer. Reported-by: Daniel Thibault Signed-off-by: David Goulet --- diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 4828f1c17..7d8546d8e 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -3273,6 +3273,11 @@ static int process_client_msg(struct command_ctx *cmd_ctx) */ switch (cmd_ctx->lsm->domain.type) { case LTTNG_DOMAIN_KERNEL: + if (!is_root) { + ret = LTTCOMM_KERN_NA; + goto error; + } + /* Kernel tracer check */ if (kernel_tracer_fd == 0) { /* Basically, load kernel tracer modules */