X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=dfe608cba27e29259ff29ca953edf8e6596d5cf6;hb=1d76b9222464f9e10128ae867cd56a9317da5d65;hp=7dca8ad05203b68944bd4fdd3e20e1dda2152d05;hpb=373d38732a83167f19c3be89cf9ff238743cdeb0;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 7dca8ad05..dfe608cba 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -3134,10 +3135,25 @@ static int process_client_msg(struct command_ctx *cmd_ctx) { int ret = LTTCOMM_OK; int need_tracing_session = 1; + int need_domain; DBG("Processing client command %d", cmd_ctx->lsm->cmd_type); - if (opt_no_kernel && cmd_ctx->lsm->domain.type == LTTNG_DOMAIN_KERNEL) { + switch (cmd_ctx->lsm->cmd_type) { + case LTTNG_CREATE_SESSION: + case LTTNG_DESTROY_SESSION: + case LTTNG_LIST_SESSIONS: + case LTTNG_LIST_DOMAINS: + case LTTNG_START_TRACE: + case LTTNG_STOP_TRACE: + need_domain = 0; + break; + default: + need_domain = 1; + } + + if (opt_no_kernel && need_domain + && cmd_ctx->lsm->domain.type == LTTNG_DOMAIN_KERNEL) { ret = LTTCOMM_KERN_NA; goto error; } @@ -3165,8 +3181,8 @@ static int process_client_msg(struct command_ctx *cmd_ctx) /* Commands that DO NOT need a session. */ switch (cmd_ctx->lsm->cmd_type) { - case LTTNG_CALIBRATE: case LTTNG_CREATE_SESSION: + case LTTNG_CALIBRATE: case LTTNG_LIST_SESSIONS: case LTTNG_LIST_TRACEPOINTS: need_tracing_session = 0; @@ -3191,6 +3207,9 @@ static int process_client_msg(struct command_ctx *cmd_ctx) break; } + if (!need_domain) { + goto skip_domain; + } /* * Check domain type for specific "pre-action". */ @@ -3284,6 +3303,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx) default: break; } +skip_domain: /* * Check that the UID or GID match that of the tracing session.