X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.c;h=9e5ec509135bd6d2818b6d6635ea6cdd0acf82ea;hb=97cf926dbf759c1590424cb58b2e5fdb970ae468;hp=c5ee4b11ed02052a77f014103b675e93336d6f71;hpb=34bf4f69e49d8a69331a6aa6826ef1f155e20ede;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index c5ee4b11e..9e5ec5091 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -2125,7 +2125,7 @@ find_tracer_event_source_element(struct notification_thread_state *state, source_element = NULL; end: - return NULL; + return source_element; } static @@ -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) &&