From: Jérémie Galarneau Date: Mon, 17 Aug 2020 20:06:16 +0000 (-0400) Subject: Revert "Fix: sessiond: erroneous user check logic in session_access_ok" X-Git-Tag: v2.13.0-rc1~495 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=86eff0042bf0b9e6277b281c4f3a680d997790d2;p=lttng-tools.git Revert "Fix: sessiond: erroneous user check logic in session_access_ok" This reverts commit 4064563ea326f6f26d2c458009beb9ebdb3ba840. Signed-off-by: Jérémie Galarneau Change-Id: Ifbcfd0c18631cfca70b2ea85b16824bb26a2a446 --- diff --git a/src/bin/lttng-sessiond/session.c b/src/bin/lttng-sessiond/session.c index 3358648f6..95395c282 100644 --- a/src/bin/lttng-sessiond/session.c +++ b/src/bin/lttng-sessiond/session.c @@ -1303,13 +1303,7 @@ int session_access_ok(struct ltt_session *session, uid_t uid, gid_t gid) { assert(session); - if (uid == 0) { - return 1; - } - - return uid == session->uid && gid == session->gid; - - if ((uid != session->uid || gid != session->gid) && uid != 0) { + if (uid != session->uid && gid != session->gid && uid != 0) { return 0; } else { return 1;