X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=2ae0ba687e89df721bb9cb96385f2685f6b00277;hb=0316a623048b600cdd0b9dc99d5c44380493c465;hp=2f5a4e98c74978d8ac8d7480cb539bc595e2afd7;hpb=fbc9f37df245d544a7705ba576297df791220b44;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 2f5a4e98c..2ae0ba687 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4295,8 +4295,7 @@ int cmd_register_trigger(struct command_ctx *cmd_ctx, int sock, sock, trigger_payload.buffer.data, trigger_len); if (sock_recv_len < 0 || sock_recv_len != trigger_len) { ERR("Failed to receive \"register trigger\" command payload"); - /* TODO: should this be a new error enum ? */ - ret = LTTNG_ERR_INVALID_TRIGGER; + ret = LTTNG_ERR_INVALID_PROTOCOL; goto end; } @@ -4342,6 +4341,15 @@ int cmd_register_trigger(struct command_ctx *cmd_ctx, int sock, } } + /* + * The bytecode generation also serves as a validation step for the + * bytecode expressions. + */ + ret = lttng_trigger_generate_bytecode(trigger, &cmd_creds); + if (ret != LTTNG_OK) { + goto end; + } + /* * A reference to the trigger is acquired by the notification thread. * It is safe to return the same trigger to the caller since it the