From: David Goulet Date: Thu, 11 Apr 2013 18:04:17 +0000 (-0400) Subject: Fix: validate buffer type for UST channel creation X-Git-Tag: v2.2.0-rc2~54 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2e8269f7b53395c9c67a73756aa71b6baaff23aa;p=lttng-tools.git Fix: validate buffer type for UST channel creation Fixes #499 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 1621bc626..bb5b3d1de 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -282,6 +282,16 @@ int channel_ust_create(struct ltt_ust_session *usess, goto error; } + /* Validate buffer type. */ + switch (type) { + case LTTNG_BUFFER_PER_PID: + case LTTNG_BUFFER_PER_UID: + break; + default: + ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; + goto error; + } + /* Create UST channel */ uchan = trace_ust_create_channel(attr, usess->pathname); if (uchan == NULL) {