X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fhealth.c;h=9474a8560a7b540fd3bb22284300cee6f64c28be;hb=5f405a7eb51398255f9f871058cfc7024b80c2b0;hp=e8c42e4bd7fa6f2b8b7394e9af43461be4b26fb4;hpb=9d2bf9edc4aeb620bc7a0b7c240f7713cbbaf134;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/health.c b/src/bin/lttng-sessiond/health.c index e8c42e4bd..9474a8560 100644 --- a/src/bin/lttng-sessiond/health.c +++ b/src/bin/lttng-sessiond/health.c @@ -95,8 +95,15 @@ static void *thread_manage_health(void *data) if (is_root) { /* lttng health client socket path permissions */ - ret = chown(config.health_unix_sock_path.value, 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(config.health_unix_sock_path.value, 0, gid); if (ret < 0) { ERR("Unable to set group on %s", config.health_unix_sock_path.value); PERROR("chown"); @@ -265,7 +272,7 @@ bool launch_health_management_thread(void) notifiers = zmalloc(sizeof(*notifiers)); if (!notifiers) { - goto error; + goto error_alloc; } sem_init(¬ifiers->ready, 0, 0); @@ -287,5 +294,6 @@ bool launch_health_management_thread(void) return true; error: cleanup_health_management_thread(notifiers); +error_alloc: return false; }