diff options
author | netblue30 <netblue30@yahoo.com> | 2016-04-07 17:37:36 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-04-07 17:37:36 -0400 |
commit | 752c3a43a322b40c1a43012735aa797d9e3c7435 (patch) | |
tree | 0835b4d1bed77eb61cd1f6ef179541310d470881 /src/firemon/firemon.c | |
parent | added dnsmasq profile (diff) | |
download | firejail-752c3a43a322b40c1a43012735aa797d9e3c7435.tar.gz firejail-752c3a43a322b40c1a43012735aa797d9e3c7435.tar.zst firejail-752c3a43a322b40c1a43012735aa797d9e3c7435.zip |
grsecurity fixes
Diffstat (limited to 'src/firemon/firemon.c')
-rw-r--r-- | src/firemon/firemon.c | 12 |
1 files changed, 6 insertions, 6 deletions
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) { | |||
112 | unsigned pid = 0; | 112 | unsigned pid = 0; |
113 | int i; | 113 | int i; |
114 | 114 | ||
115 | struct stat s; | ||
116 | if (getuid() != 0 &&stat("/proc/sys/kernel/grsecurity", &s) == 0) { | ||
117 | fprintf(stderr, "Error: on Grsecurity systems only root user can run this program\n"); | ||
118 | exit(1); | ||
119 | } | ||
120 | |||
121 | // handle CTRL-C | 115 | // handle CTRL-C |
122 | signal (SIGINT, my_handler); | 116 | signal (SIGINT, my_handler); |
123 | signal (SIGTERM, my_handler); | 117 | signal (SIGTERM, my_handler); |
@@ -143,6 +137,12 @@ int main(int argc, char **argv) { | |||
143 | return 0; | 137 | return 0; |
144 | } | 138 | } |
145 | else if (strcmp(argv[i], "--netstats") == 0) { | 139 | else if (strcmp(argv[i], "--netstats") == 0) { |
140 | struct stat s; | ||
141 | if (getuid() != 0 && stat("/proc/sys/kernel/grsecurity", &s) == 0) { | ||
142 | fprintf(stderr, "Error: this feature is not available on Grsecurity systems\n"); | ||
143 | exit(1); | ||
144 | } | ||
145 | |||
146 | netstats(); | 146 | netstats(); |
147 | return 0; | 147 | return 0; |
148 | } | 148 | } |