The group-by-session-name feature assumes sessions are named for peers
more recent than 2.3. Enforce this assumption at session creation
time.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
ret = -ENAMETOOLONG;
ERR("Length of session name (%" PRIu32 " bytes) received in create_session command exceeds maximum length (%d bytes)", header.session_name_len, LTTNG_NAME_MAX);
goto error;
+ } else if (header.session_name_len == 0) {
+ ret = -EINVAL;
+ ERR("Illegal session name length of 0 received");
+ goto error;
}
if (header.hostname_len > LTTNG_HOST_NAME_MAX) {
ret = -ENAMETOOLONG;
ret = -ENAMETOOLONG;
ERR("Session name too long");
goto error;
+ } else if (len == 0) {
+ ret = -EINVAL;
+ ERR("Session name can't be of length 0");
+ goto error;
}
strncpy(session_name, session_info.session_name, LTTNG_NAME_MAX);
*/
lttng_uuid sessiond_uuid;
LTTNG_OPTIONAL(time_t) creation_time;
+ /* Must _not_ be empty for 2.4+ peers. */
char session_name[LTTNG_NAME_MAX];
char hostname[LTTNG_HOST_NAME_MAX];
char base_path[LTTNG_PATH_MAX];