Fix: validate buffer type for UST channel creation
authorDavid Goulet <dgoulet@efficios.com>
Thu, 11 Apr 2013 18:04:17 +0000 (14:04 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 11 Apr 2013 18:04:17 +0000 (14:04 -0400)
Fixes #499

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/channel.c

index 1621bc626bba7d72b52098b8c1798ee859d80c70..bb5b3d1de32cc00c19cba668a060d26982dc774f 100644 (file)
@@ -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) {
This page took 0.025266 seconds and 4 git commands to generate.