From bc25cfea7c6b689b6fa0c10825b45d0d1629c53a Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 16 Aug 2010 23:02:16 +0300 Subject: [PATCH] main: Use geteuid instead of getuid The effective used ID is what matters, since if someone uses setuid bit to run the binary as root, the euid will be 0 but uid might not. Signed-off-by: Timo Kokkonen --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index c388da6..46e6861 100644 --- a/main.c +++ b/main.c @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) struct process process_list; struct parse_opts opts; - if (getuid()) { + if (geteuid()) { printf("WARNING: Running without root priviledges. " "Results may be inaccurate\n"); } -- 2.45.0