librunas: clone another process also if not root
[lttng-tools.git] / lttng-sessiond / main.c
index fbf8d7975330414cf6589d2aa80f707f25dde88e..10139448aee3dcbe811c75adb3ca55a99c9b5d4d 100644 (file)
@@ -43,6 +43,7 @@
 #include <lttng/lttng-consumer.h>
 
 #include <lttngerr.h>
+#include <runas.h>
 
 #include "channel.h"
 #include "compat/poll.h"
@@ -1744,7 +1745,7 @@ static int mount_debugfs(char *path)
        int ret;
        char *type = "debugfs";
 
-       ret = mkdir_recursive(path, S_IRWXU | S_IRWXG, geteuid(), getegid());
+       ret = mkdir_recursive_run_as(path, S_IRWXU | S_IRWXG, geteuid(), getegid());
        if (ret < 0) {
                PERROR("Cannot create debugfs path");
                goto error;
@@ -1899,7 +1900,7 @@ static int create_ust_session(struct ltt_session *session,
                goto error;
        }
 
-       ret = mkdir_recursive(lus->pathname, S_IRWXU | S_IRWXG,
+       ret = mkdir_recursive_run_as(lus->pathname, S_IRWXU | S_IRWXG,
                        session->uid, session->gid);
        if (ret < 0) {
                if (ret != -EEXIST) {
@@ -1949,7 +1950,7 @@ static int create_kernel_session(struct ltt_session *session)
                session->kernel_session->consumer_fd = kconsumer_data.cmd_sock;
        }
 
-       ret = mkdir_recursive(session->kernel_session->trace_path,
+       ret = mkdir_recursive_run_as(session->kernel_session->trace_path,
                        S_IRWXU | S_IRWXG, session->uid, session->gid);
        if (ret < 0) {
                if (ret != -EEXIST) {
This page took 0.024881 seconds and 4 git commands to generate.