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:37:18 +0000 (17:37 -0400)
commitf2bda80eb1fe2f73dda9a7590d9960cdccb0f733
tree59364e6784cdeafa80eb90405d55e93275faae73
parentba66a850c5f540a0c3f61ce9344fd7127b567676
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.025925 seconds and 4 git commands to generate.