trigger: internal: add credentials information
[lttng-tools.git] / src / bin / lttng-sessiond / rotate.c
index e2a3ef9eaac221ef97cc611004db602d7af347f0..30ec241249e5a1020b88b63ee01845122fbb9b2a 100644 (file)
@@ -17,6 +17,7 @@
 #include <common/time.h>
 #include <common/hashtable/utils.h>
 #include <common/kernel-ctl/kernel-ctl.h>
+#include <common/credentials.h>
 #include <sys/eventfd.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -46,6 +47,10 @@ int subscribe_session_consumed_size_rotation(struct ltt_session *session, uint64
        enum lttng_condition_status condition_status;
        enum lttng_notification_channel_status nc_status;
        struct lttng_action *action;
+       const struct lttng_credentials session_creds = {
+               .uid = session->uid,
+               .gid = session->gid,
+       };
 
        session->rotate_condition = lttng_condition_session_consumed_size_create();
        if (!session->rotate_condition) {
@@ -88,6 +93,9 @@ int subscribe_session_consumed_size_rotation(struct ltt_session *session, uint64
                goto end;
        }
 
+       lttng_trigger_set_credentials(
+                       session->rotate_trigger, &session_creds);
+
        nc_status = lttng_notification_channel_subscribe(
                        rotate_notification_channel, session->rotate_condition);
        if (nc_status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
This page took 0.033 seconds and 4 git commands to generate.