From: Mathieu Desnoyers Date: Fri, 16 Aug 2013 20:07:54 +0000 (-0400) Subject: Fix: don't skip chmod if tracing group is not found X-Git-Tag: v2.3.0-rc3~47 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=360e82e5c9b78f970c5318b5862f1646bc9cd882;p=lttng-tools.git Fix: don't skip chmod if tracing group is not found Fixes #620 Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index d22e2a63d..69bc3a183 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4075,12 +4075,12 @@ static int set_permissions(char *rundir) ret = allowed_group(); if (ret < 0) { WARN("No tracing group detected"); - ret = 0; - goto end; + /* Setting gid to 0 if no tracing group is found */ + gid = 0; + } else { + gid = ret; } - gid = ret; - /* Set lttng run dir */ ret = chown(rundir, 0, gid); if (ret < 0) { @@ -4088,7 +4088,7 @@ static int set_permissions(char *rundir) PERROR("chown"); } - /* Ensure tracing group can search the run dir */ + /* Ensure all applications and tracing group can search the run dir */ ret = chmod(rundir, S_IRWXU | S_IXGRP | S_IXOTH); if (ret < 0) { ERR("Unable to set permissions on %s", rundir); @@ -4125,7 +4125,6 @@ static int set_permissions(char *rundir) DBG("All permissions are set"); -end: return ret; }