Fix: getgrnam is not MT-Safe, use getgrnam_r
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread.c
index b42b282e10cfbc98e262eca77ad6fd6dbeac1213..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;
This page took 0.025189 seconds and 5 git commands to generate.