From: Mathieu Desnoyers Date: Wed, 22 Jun 2011 19:56:47 +0000 (-0400) Subject: Don't allow enable/disable on metadata channel/events X-Git-Tag: v2.0-pre1~50 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c6485006a92b1b86fbb48c2b277732d3405295c9;p=lttng-modules.git Don't allow enable/disable on metadata channel/events Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-events.c b/ltt-events.c index a94e8f9a..42d486c1 100644 --- a/ltt-events.c +++ b/ltt-events.c @@ -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;