From 8c58f78f3304c18368e1a5655716ff0807ef1218 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sun, 29 Jan 2017 21:26:54 +0200 Subject: [PATCH] check both uid and euid for root --- src/apps_plugin.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/apps_plugin.c b/src/apps_plugin.c index c17560c1..dc571233 100644 --- a/src/apps_plugin.c +++ b/src/apps_plugin.c @@ -3013,16 +3013,13 @@ static void parse_args(int argc, char **argv) } static int am_i_running_as_root() { - if(getuid() != 0) { - if(debug) - info("I am not running as root."); - return 0; + if(getuid() == 0 || geteuid() == 0) { + if(debug) info("I am running as root."); + return 1; } - if(debug) - info("I am running as root."); - - return 1; + if(debug) info("I am not running as root."); + return 0; } #ifdef HAVE_CAPABILITY -- 2.39.2