X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=283868970f74e9eb2317e9a7e883c99d3b55f8bf;hb=3fa913274cd98e148113a27747ae755a15b3fc5b;hp=8e794bdf4365be1779c2f0bb94c5e99dae5b03ee;hpb=b09c7c76bc6f409ed9c303c81cba168234700568;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 8e794bdf4..283868970 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -769,12 +769,18 @@ static void update_ust_app(int app_sock) { struct ltt_session *sess, *stmp; + session_lock_list(); + /* For all tracing session(s) */ cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) { + session_lock(sess); if (sess->ust_session) { ust_app_global_update(sess->ust_session, app_sock); } + session_unlock(sess); } + + session_unlock_list(); } /* @@ -3471,11 +3477,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx) session_lock_list(); nr_sessions = lttng_sessions_count(cmd_ctx->creds.uid, cmd_ctx->creds.gid); - if (nr_sessions == 0) { - ret = LTTCOMM_NO_SESSION; - session_unlock_list(); - goto error; - } + ret = setup_lttng_msg(cmd_ctx, sizeof(struct lttng_session) * nr_sessions); if (ret < 0) { session_unlock_list(); @@ -3911,7 +3913,7 @@ static int check_existing_daemon(void) * Set the tracing group gid onto the client socket. * * Race window between mkdir and chown is OK because we are going from more - * permissive (root.root) to les permissive (root.tracing). + * permissive (root.root) to less permissive (root.tracing). */ static int set_permissions(char *rundir) { @@ -3932,6 +3934,13 @@ static int set_permissions(char *rundir) perror("chown"); } + /* Ensure tracing group can search the run dir */ + ret = chmod(rundir, S_IRWXU | S_IXGRP); + if (ret < 0) { + ERR("Unable to set permissions on %s", rundir); + perror("chmod"); + } + /* lttng client socket path */ ret = chown(client_unix_sock_path, 0, gid); if (ret < 0) { @@ -3991,7 +4000,7 @@ static int create_lttng_rundir(const char *rundir) DBG3("Creating LTTng run directory: %s", rundir); - ret = mkdir(rundir, S_IRWXU | S_IRWXG ); + ret = mkdir(rundir, S_IRWXU); if (ret < 0) { if (errno != EEXIST) { ERR("Unable to create %s", rundir); @@ -4033,7 +4042,7 @@ static int set_consumer_sockets(struct consumer_data *consumer_data, DBG2("Creating consumer directory: %s", path); - ret = mkdir(path, S_IRWXU | S_IRWXG); + ret = mkdir(path, S_IRWXU); if (ret < 0) { if (errno != EEXIST) { ERR("Failed to create %s", path);