- cds_list_for_each_entry_safe(client_list_element, tmp,
- &client_list->list, node) {
- ret = evaluate_condition_for_client(trigger, condition,
- client_list_element->client, state);
- if (ret) {
- goto error_put_client_list;
- }
+ switch (get_condition_binding_object(condition)) {
+ case LTTNG_OBJECT_TYPE_SESSION:
+ ret = evaluate_session_condition_for_client(condition, state,
+ &evaluation, &object_uid,
+ &object_gid);
+ break;
+ case LTTNG_OBJECT_TYPE_CHANNEL:
+ ret = evaluate_channel_condition_for_client(condition, state,
+ &evaluation, &object_uid,
+ &object_gid);
+ break;
+ case LTTNG_OBJECT_TYPE_NONE:
+ ret = 0;
+ goto error_put_client_list;
+ case LTTNG_OBJECT_TYPE_UNKNOWN:
+ default:
+ ret = -1;
+ goto error_put_client_list;
+ }
+
+ if (ret) {
+ /* Fatal error. */
+ goto error_put_client_list;
+ }
+
+ LTTNG_OPTIONAL_SET(&object_creds.uid, object_uid);
+ LTTNG_OPTIONAL_SET(&object_creds.gid, object_gid);
+
+ DBG("Newly registered trigger's condition evaluated to %s",
+ evaluation ? "true" : "false");
+ if (!evaluation) {
+ /* Evaluation yielded nothing. Normal exit. */
+ ret = 0;
+ goto error_put_client_list;