X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread.c;h=7998f7e21fbcf73818472312889a6794abe095d3;hb=ca3833f638213d2cf0604481fade27b4437dc985;hp=9809e6190cd60cbb453cea62b704a62e6da84cc5;hpb=c8a9de5a85fb150d3ceaa5ca1a8b1b2b91d050d5;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notification-thread.c b/src/bin/lttng-sessiond/notification-thread.c index 9809e6190..7998f7e21 100644 --- a/src/bin/lttng-sessiond/notification-thread.c +++ b/src/bin/lttng-sessiond/notification-thread.c @@ -239,8 +239,16 @@ int notification_channel_socket_create(void) } if (getuid() == 0) { - ret = chown(sock_path, 0, - utils_get_group_id(config.tracing_group_name.value)); + gid_t gid; + + ret = utils_get_group_id(config.tracing_group_name.value, true, + &gid); + if (ret) { + /* Default to root group. */ + gid = 0; + } + + ret = chown(sock_path, 0, gid); if (ret) { ERR("Failed to set the notification channel socket's group"); ret = -1; @@ -653,7 +661,8 @@ bool shutdown_notification_thread(void *thread_data) return true; } -bool launch_notification_thread(struct notification_thread_handle *handle) +struct lttng_thread *launch_notification_thread( + struct notification_thread_handle *handle) { struct lttng_thread *thread; @@ -672,8 +681,7 @@ bool launch_notification_thread(struct notification_thread_handle *handle) * (e.g. rotation thread). */ wait_until_thread_is_ready(handle); - lttng_thread_put(thread); - return true; + return thread; error: - return false; + return NULL; }