From 752c3a43a322b40c1a43012735aa797d9e3c7435 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 7 Apr 2016 17:37:36 -0400 Subject: grsecurity fixes --- src/firemon/firemon.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/firemon') diff --git a/src/firemon/firemon.c b/src/firemon/firemon.c index 9c3558362..3140c5f70 100644 --- a/src/firemon/firemon.c +++ b/src/firemon/firemon.c @@ -112,12 +112,6 @@ int main(int argc, char **argv) { unsigned pid = 0; int i; - struct stat s; - if (getuid() != 0 &&stat("/proc/sys/kernel/grsecurity", &s) == 0) { - fprintf(stderr, "Error: on Grsecurity systems only root user can run this program\n"); - exit(1); - } - // handle CTRL-C signal (SIGINT, my_handler); signal (SIGTERM, my_handler); @@ -143,6 +137,12 @@ int main(int argc, char **argv) { return 0; } else if (strcmp(argv[i], "--netstats") == 0) { + struct stat s; + if (getuid() != 0 && stat("/proc/sys/kernel/grsecurity", &s) == 0) { + fprintf(stderr, "Error: this feature is not available on Grsecurity systems\n"); + exit(1); + } + netstats(); return 0; } -- cgit v1.2.3-70-g09d2