Don't init kernel tracer if not root (UID=0)
authorDavid Goulet <dgoulet@efficios.com>
Thu, 19 Jan 2012 18:43:57 +0000 (13:43 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 19 Jan 2012 18:43:57 +0000 (13:43 -0500)
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 <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
lttng-sessiond/main.c

index 4828f1c179a914c87c5db77c2413cf9284536ed8..7d8546d8e81d95c1f85887f2b7ecb23adf01d997 100644 (file)
@@ -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 */
This page took 0.030156 seconds and 4 git commands to generate.