X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fclient.cpp;h=97a6d9b724c56afe9c24f9839444b19c5af8c8e7;hb=6c1db447784d69988f661477ad9eea7c0fddfa82;hp=1f94bdad8954f94a7aa06c1576dec4668b6141e0;hpb=f149493493fbd8a3efa4748832c03278c96c38ca;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/client.cpp b/src/bin/lttng-sessiond/client.cpp index 1f94bdad8..97a6d9b72 100644 --- a/src/bin/lttng-sessiond/client.cpp +++ b/src/bin/lttng-sessiond/client.cpp @@ -1003,6 +1003,13 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int *sock, bool need_domain; bool need_consumerd; + if (!lttcomm_sessiond_command_is_valid((lttcomm_sessiond_command) cmd_ctx->lsm.cmd_type)) { + ERR("Unknown client command received: command id = %" PRIu32, + cmd_ctx->lsm.cmd_type); + ret = LTTNG_ERR_UND; + goto error; + } + DBG("Processing client command '%s\' (%d)", lttcomm_sessiond_command_str((lttcomm_sessiond_command) cmd_ctx->lsm.cmd_type), cmd_ctx->lsm.cmd_type); @@ -2396,7 +2403,6 @@ init_setup_error: static int create_client_sock(void) { int ret, client_sock; - const mode_t old_umask = umask(0); /* Create client tool unix socket */ client_sock = lttcomm_create_unix_sock( @@ -2430,7 +2436,6 @@ static int create_client_sock(void) DBG("Created client socket (fd = %i)", client_sock); ret = client_sock; end: - umask(old_umask); return ret; }