X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=src%2Fmisc-progs%2Fgetconntracktable.c;h=78eb11ad85ec58558c290172a26c03006894bc6c;hp=674b211b5cc0bdeaaa3f65c8bd103fe1834b7712;hb=1294c52ca5d01e9293b37b2f301c0c873098ab83;hpb=098f2c4b401132db0ca65e7f6a178ffbf512226a diff --git a/src/misc-progs/getconntracktable.c b/src/misc-progs/getconntracktable.c index 674b211b5c..78eb11ad85 100644 --- a/src/misc-progs/getconntracktable.c +++ b/src/misc-progs/getconntracktable.c @@ -1,31 +1,31 @@ -/* IPFire helper program - getconntracktable - * - * This program is distributed under the terms of the GNU General Public - * Licence. See the file COPYING for details. - * - * The kernel's connection tracking table is not readable by - * non-root users. So this helper will just read and output it. - */ - -#include -#include -#include "setuid.h" - -int main(void) { - if (!(initsetuid())) - exit(1); - - FILE *fp = fopen("/proc/net/nf_conntrack", "r"); - if (fp == NULL) { - exit(1); - } - - /* Read content line by line and write it to stdout. */ - char linebuf[STRING_SIZE]; - while (fgets(linebuf, STRING_SIZE, fp)) { - printf("%s", linebuf); - } - - fclose(fp); - return 0; -} +/* IPFire helper program - getconntracktable + * + * This program is distributed under the terms of the GNU General Public + * Licence. See the file COPYING for details. + * + * The kernel's connection tracking table is not readable by + * non-root users. So this helper will just read and output it. + */ + +#include +#include +#include "setuid.h" + +int main(void) { + if (!(initsetuid())) + exit(1); + + FILE *fp = fopen("/proc/net/nf_conntrack", "r"); + if (fp == NULL) { + exit(1); + } + + /* Read content line by line and write it to stdout. */ + char linebuf[STRING_SIZE]; + while (fgets(linebuf, STRING_SIZE, fp)) { + printf("%s", linebuf); + } + + fclose(fp); + return 0; +}