Don't allow enable/disable on metadata channel/events
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Jun 2011 19:56:47 +0000 (15:56 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Jun 2011 19:56:47 +0000 (15:56 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-events.c

index a94e8f9a1dde6a6e315133e59c66e3659455f99d..42d486c195d73c8cdfd265b6a54a5d2bd20950ec 100644 (file)
@@ -139,6 +139,8 @@ int ltt_channel_enable(struct ltt_channel *channel)
 {
        int old;
 
+       if (channel == channel->session->metadata)
+               return -EPERM;
        old = xchg(&channel->enabled, 1);
        if (old)
                return -EEXIST;
@@ -149,6 +151,8 @@ int ltt_channel_disable(struct ltt_channel *channel)
 {
        int old;
 
+       if (channel == channel->session->metadata)
+               return -EPERM;
        old = xchg(&channel->enabled, 0);
        if (!old)
                return -EEXIST;
@@ -159,6 +163,8 @@ int ltt_event_enable(struct ltt_event *event)
 {
        int old;
 
+       if (event->chan == event->chan->session->metadata)
+               return -EPERM;
        old = xchg(&event->enabled, 1);
        if (old)
                return -EEXIST;
@@ -169,6 +175,8 @@ int ltt_event_disable(struct ltt_event *event)
 {
        int old;
 
+       if (event->chan == event->chan->session->metadata)
+               return -EPERM;
        old = xchg(&event->enabled, 0);
        if (!old)
                return -EEXIST;
This page took 0.02697 seconds and 4 git commands to generate.