From 7e767b7e90755f5b8c90b37e68ae14098fba5520 Mon Sep 17 00:00:00 2001 From: "Vladimir A. Nazarenko" Date: Sun, 20 Oct 2013 15:57:24 +1100 Subject: 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 Signed-off-by: Allan McRae --- src/pacman/pacman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index f22f40f3..3c9457a9 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -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. */ -- cgit v1.2.3-70-g09d2