From 604b5ef6ea93da7bd6c994fe5240edcdebc839b6 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Thu, 10 Nov 2016 17:39:49 +0800 Subject: [PATCH] Revert to getuid() --- src/acl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/acl.c b/src/acl.c index e686693b..86e37ff1 100644 --- a/src/acl.c +++ b/src/acl.c @@ -128,7 +128,7 @@ init_firewall() char cli[256]; FILE *fp; - if (geteuid() != 0) + if (getuid() != 0) return -1; sprintf(cli, "firewall-cmd --version 2>&1"); @@ -165,7 +165,7 @@ reset_firewall() int ret = 0; char cli[256]; - if (geteuid() != 0) + if (getuid() != 0) return -1; if (mode == IPTABLES_MODE) { @@ -189,7 +189,7 @@ set_firewall_rule(char *addr, int add) char cli[256]; struct cork_ip ip; - if (geteuid() != 0) + if (getuid() != 0) return -1; if (cork_ip_init(&ip, addr))