Fix: getgrnam is not MT-Safe, use getgrnam_r
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread.c
index 9809e6190cd60cbb453cea62b704a62e6da84cc5..7998f7e21fbcf73818472312889a6794abe095d3 100644 (file)
@@ -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;
 }
This page took 0.024497 seconds and 4 git commands to generate.