Fix: sessiond: list-triggers: don't return internal triggers
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-events.c
index c5ee4b11ed02052a77f014103b675e93336d6f71..1093784113cd4e2b35cc5093ab3dd7d5b5bc6b69 100644 (file)
@@ -3814,9 +3814,11 @@ int client_handle_message_handshake(struct notification_client *client,
                        &client->communication.inbound.creds);
        client->gid = LTTNG_SOCK_GET_GID_CRED(
                        &client->communication.inbound.creds);
-       DBG("Received handshake from client (uid = %u, gid = %u) with version %i.%i",
+       client->is_sessiond = LTTNG_SOCK_GET_PID_CRED(&client->communication.inbound.creds) == getpid();
+       DBG("Received handshake from client: uid = %u, gid = %u, protocol version = %i.%i, client is sessiond = %s",
                        client->uid, client->gid, (int) client->major,
-                       (int) client->minor);
+                       (int) client->minor,
+                       client->is_sessiond ? "true" : "false");
 
        if (handshake_client->major !=
                        LTTNG_NOTIFICATION_CHANNEL_VERSION_MAJOR) {
@@ -4414,6 +4416,14 @@ int notification_client_list_send_evaluation(
                        goto skip_client;
                }
 
+               if (lttng_trigger_is_hidden(trigger) && !client->is_sessiond) {
+                       /*
+                        * Notifications resulting from an hidden trigger are
+                        * only sent to the session daemon.
+                        */
+                       continue;
+               }
+
                if (source_object_creds) {
                        if (client->uid != lttng_credentials_get_uid(source_object_creds) &&
                                        client->gid != lttng_credentials_get_gid(source_object_creds) &&
This page took 0.023376 seconds and 4 git commands to generate.