Fix: sessiond: list-triggers: don't return internal triggers
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jul 2021 17:00:56 +0000 (13:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 12 Jul 2021 21:38:52 +0000 (17:38 -0400)
commit5682b2e6462875214549f5b5a1d9eb1d8df0950e
tree8594ac7e153360a36eae8feea07bcfe8bc6ccc2b
parentbb17eb585257d944c7857d9400a4db247c49dcc1
Fix: sessiond: list-triggers: don't return internal triggers

The session daemon uses triggers internally. For instance, the trigger
and notification subsystem is used to implement the automatic rotation
of sessions based on a size threshold.

Currently, a user of the C API will see those internal triggers if it is
running as the same user as the session daemon. This can be unexpected
by user code that assumes it will be alone in creating triggers.
Moreover, it is possible for external users to unregister those triggers
which would cause bugs.

As the triggers gain more capabilities, it is likely that the session
daemon will keep using them to implement features internally. Thus,
an internal "is_hidden" property is introduced in lttng_trigger.

A "hidden" trigger is a trigger that is not returned by the listings.
It is used to hide triggers that are used internally by the session
daemon so that they can't be listed nor unregistered by external
clients.

This is a property that can only be set internally by the session
daemon. As such, it is not serialized nor set by a
"create_from_buffer" constructor.

The hidden property is preserved by copies.

Note that notifications originating from an "hidden" trigger will not
be sent to clients that are not within the session daemon's process.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I61b7949075172fcd428289e2eb670d03c19bdf71
include/lttng/trigger/trigger-internal.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/notification-thread-events.c
src/bin/lttng-sessiond/notification-thread-internal.h
src/bin/lttng-sessiond/rotate.c
src/common/trigger.c
This page took 0.027133 seconds and 5 git commands to generate.