X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt-sessiond%2Fmain.c;h=98738928464290a8b1406bf21be06e54c26c9b68;hb=6beb22421cf1641eb09813c167741e27cf5f58dc;hp=cbd6a3f3f6a7469ddc2be72fb5b313555bf37989;hpb=333f285e479a22c99122aa92b988b10c597551e4;p=lttng-tools.git diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index cbd6a3f3f..987389284 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -35,7 +35,6 @@ #include #include /* URCU list library (-lurcu) */ -#include /* UST control lib (-lust) */ #include #include "liblttsessiondcomm.h" @@ -46,6 +45,7 @@ #include "session.h" #include "traceable-app.h" #include "lttng-kconsumerd.h" +#include "libustctl.h" /* * TODO: @@ -224,7 +224,7 @@ static int ust_connect_app(pid_t pid) sock = ustctl_connect_pid(lta->pid); if (sock < 0) { - ERR("Fail connecting to the PID %d\n", pid); + ERR("Fail connecting to the PID %d", pid); } return sock; @@ -634,11 +634,14 @@ static int create_trace_dir(struct ltt_kernel_session *session) /* Create all channel directories */ cds_list_for_each_entry(chan, &session->channel_list.head, list) { DBG("Creating trace directory at %s", chan->pathname); + // TODO: recursive create dir ret = mkdir(chan->pathname, S_IRWXU | S_IRWXG ); if (ret < 0) { - perror("mkdir trace path"); - ret = -errno; - goto error; + if (ret != EEXIST) { + perror("mkdir trace path"); + ret = -errno; + goto error; + } } } @@ -1197,6 +1200,8 @@ static void *thread_manage_clients(void *data) continue; } + // TODO: Validate cmd_ctx including sanity check for security purpose. + /* * This function dispatch the work to the kernel or userspace tracer * libs and fill the lttcomm_lttng_msg data structure of all the needed @@ -1511,8 +1516,11 @@ static int set_kconsumerd_sockets(void) ret = mkdir(KCONSUMERD_PATH, S_IRWXU | S_IRWXG); if (ret < 0) { - ERR("Failed to create " KCONSUMERD_PATH); - goto error; + if (errno != EEXIST) { + ERR("Failed to create " KCONSUMERD_PATH); + goto error; + } + ret = 0; } /* Create the kconsumerd error unix socket */