From 64c906b801534eb11cf76f33d9bbd5a2395787a0 Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 30 Jul 2021 07:15:41 -0400 Subject: [PATCH] [client] main: prevent the user from launching looking glass as setuid We don't want to encourage craziness of people making the client suid to bypass permission issues on the shm file. Note: I see no evidence of this happening in the wild, but let's be proactive. --- client/src/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/main.c b/client/src/main.c index 4fb10a3b..6ff0144d 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1196,6 +1196,12 @@ int main(int argc, char * argv[]) return -1; } + if (getuid() != geteuid()) + { + DEBUG_ERROR("Do not run looking glass as setuid!"); + return -1; + } + DEBUG_INFO("Looking Glass (%s)", BUILD_VERSION); DEBUG_INFO("Locking Method: " LG_LOCK_MODE);