[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.
This commit is contained in:
Quantum 2021-07-30 07:15:41 -04:00 committed by Geoffrey McRae
parent 72ccd44681
commit 64c906b801

View File

@ -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);