X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fhealth-relayd.c;fp=src%2Fbin%2Flttng-relayd%2Fhealth-relayd.c;h=9b4eefcd55f93e7ad6e9e5e018a398b76fc75f5a;hp=ba996621b0058ca62f94a7d1c4b001a5737b1b2e;hb=28ab59d0baef178a8629ec9fb517ba75efb46ea8;hpb=b1093e5fa7d006fb463b2754119c6d2796bb7d82 diff --git a/src/bin/lttng-relayd/health-relayd.c b/src/bin/lttng-relayd/health-relayd.c index ba996621b..9b4eefcd5 100644 --- a/src/bin/lttng-relayd/health-relayd.c +++ b/src/bin/lttng-relayd/health-relayd.c @@ -105,8 +105,15 @@ static int create_lttng_rundir_with_perm(const char *rundir) int is_root = !getuid(); if (is_root) { - ret = chown(rundir, 0, - utils_get_group_id(tracing_group_name)); + gid_t gid; + + ret = utils_get_group_id(tracing_group_name, true, &gid); + if (ret) { + /* Default to root group. */ + gid = 0; + } + + ret = chown(rundir, 0, gid); if (ret < 0) { ERR("Unable to set group on %s", rundir); PERROR("chown"); @@ -256,8 +263,15 @@ void *thread_manage_health(void *data) is_root = !getuid(); if (is_root) { /* lttng health client socket path permissions */ - ret = chown(health_unix_sock_path, 0, - utils_get_group_id(tracing_group_name)); + gid_t gid; + + ret = utils_get_group_id(tracing_group_name, true, &gid); + if (ret) { + /* Default to root group. */ + gid = 0; + } + + ret = chown(health_unix_sock_path, 0, gid); if (ret < 0) { ERR("Unable to set group on %s", health_unix_sock_path); PERROR("chown");