Fix: lttng-ctl: erroneous check if user is part of the tracing group
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 3 May 2021 16:50:25 +0000 (12:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 May 2021 17:47:51 +0000 (13:47 -0400)
commitadca10efed6211c1f4c129b6233bcc96f6732364
tree34fd31acbad4b8860ef15eb790f070df7cd6803a
parentfc88a5ec6f6723c3b5e3d52ec08b19c11273cc49
Fix: lttng-ctl: erroneous check if user is part of the tracing group

in_tgroup is set to `-1` whenever the current user is not part of the
tracing group _or_ if an error occurred while looking up if the user
is part of the tracing group. In other words, the value '0' is unused.

in_tgroup must be explicitly checked against '1' and can't be assumed
to behave as a boolean value.

This is _not_ a security issue: if the user is not part of the tracing
group, she will fail to open the root session damon's socket because
of the kernel-side permission checking. However, the behaviour of the
lttng client (and error reporting) will be confusing.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I614da0123d0546c5f54f121e8ed9716d6e292400
src/lib/lttng-ctl/lttng-ctl.c
This page took 0.026458 seconds and 5 git commands to generate.