Use getuid instead of geteuid

If someone gives the pacman binary setuid permissions, the geteuid check
allows it to start running but subsequently fail. As we do not support
setting pacman setuid, use getuid to check permissions instead.

FS#37174.

Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Vladimir A. Nazarenko 2013-10-20 15:57:24 +11:00 committed by Allan McRae
parent 8f5dbd5614
commit 7e767b7e90
1 changed files with 1 additions and 1 deletions

View File

@ -1031,7 +1031,7 @@ int main(int argc, char *argv[])
size_t i;
struct sigaction new_action, old_action;
const int signals[] = { SIGHUP, SIGINT, SIGTERM, SIGSEGV };
uid_t myuid = geteuid();
uid_t myuid = getuid();
/* Set signal handlers */
/* Set up the structure to specify the new action. */