#include <lttng/action/action-internal.h>
#include <lttng/condition/buffer-usage.h>
#include <lttng/condition/condition-internal.h>
-#include <lttng/condition/on-event-internal.h>
-#include <lttng/condition/on-event.h>
+#include <lttng/condition/event-rule-matches-internal.h>
+#include <lttng/condition/event-rule-matches.h>
#include <lttng/domain.h>
#include <lttng/event-expr-internal.h>
#include <lttng/event-rule/event-rule-internal.h>
struct lttng_trigger *trigger, uid_t uid)
{
enum lttng_trigger_status ret = LTTNG_TRIGGER_STATUS_OK;
+ const uid_t euid = geteuid();
const struct lttng_credentials creds = {
.uid = LTTNG_OPTIONAL_INIT_VALUE(uid),
.gid = LTTNG_OPTIONAL_INIT_UNSET,
}
/* Client-side validation only to report a clearer error. */
- if (geteuid() != 0) {
+ if (euid != 0 && euid != uid) {
ret = LTTNG_TRIGGER_STATUS_PERMISSION_DENIED;
goto end;
}
/* Apply to any domain. */
type = LTTNG_DOMAIN_NONE;
break;
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
/* Return the domain of the event rule. */
- c_status = lttng_condition_on_event_get_rule(
+ c_status = lttng_condition_event_rule_matches_get_rule(
trigger->condition, &event_rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
type = lttng_event_rule_get_domain_type(event_rule);
}
switch (lttng_condition_get_type(condition)) {
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
{
struct lttng_event_rule *event_rule;
const enum lttng_condition_status condition_status =
- lttng_condition_on_event_borrow_rule_mutable(
- condition, &event_rule);
+ lttng_condition_event_rule_matches_borrow_rule_mutable(
+ condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
}
/* Generate the capture bytecode. */
- ret = lttng_condition_on_event_generate_capture_descriptor_bytecode(
+ ret = lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
condition);
if (ret != LTTNG_OK) {
goto end;
lttng_trigger_get_const_condition(trigger);
switch (lttng_condition_get_type(condition)) {
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
needs_tracer_notifier = true;
goto end;
case LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE: