Merge remote-tracking branch 'origin/master' into kernel-update

This commit is contained in:
Arne Fitzenreiter
2012-07-21 23:54:31 +02:00
13 changed files with 517 additions and 378 deletions

View File

@@ -32,7 +32,8 @@ SUID_PROGS = setdmzholes setportfw setxtaccess \
wirelessctrl getipstat getiptstate qosctrl launch-ether-wake \
redctrl syslogdctrl extrahdctrl sambactrl upnpctrl tripwirectrl \
smartctrl clamavctrl addonctrl pakfire mpfirectrl wlanapctrl \
setaliases urlfilterctrl updxlratorctrl fireinfoctrl rebuildroutes
setaliases urlfilterctrl updxlratorctrl fireinfoctrl rebuildroutes \
getconntracktable
SUID_UPDX = updxsetperms
install : all
@@ -160,3 +161,6 @@ fireinfoctrl: fireinfoctrl.c setuid.o ../install+setup/libsmooth/varval.o
rebuildroutes: rebuildroutes.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ rebuildroutes.c setuid.o ../install+setup/libsmooth/varval.o -o $@
getconntracktable: getconntracktable.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ getconntracktable.c setuid.o ../install+setup/libsmooth/varval.o -o $@

View File

@@ -0,0 +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 <stdio.h>
#include <stdlib.h>
#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;
}