fireinfo: Run action that was set on the webinterface immediately.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Jan 2011 23:30:14 +0000 (00:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Jan 2011 23:30:14 +0000 (00:30 +0100)
config/rootfiles/common/misc-progs
config/rootfiles/core/44/filelists/files
html/cgi-bin/fireinfo.cgi
src/misc-progs/Makefile
src/misc-progs/fireinfoctrl.c [new file with mode: 0644]

index 7746d03e0e5439bfbbd633c3a54bde1d5863544a..6e5d7caec192ef14668720b40f7fbf9f62ea7745 100644 (file)
@@ -4,6 +4,7 @@ usr/local/bin/backupctrl
 #usr/local/bin/clamavctrl
 usr/local/bin/dhcpctrl
 usr/local/bin/extrahdctrl
+usr/local/bin/fireinfoctrl
 usr/local/bin/getipstat
 usr/local/bin/getiptstate
 #usr/local/bin/iowrap
index 765ee74dcc6270452ab0c21c46de21e3fbf2a46a..c4eca7310d588dbee640fadefdd4a02493278b73 100644 (file)
@@ -39,6 +39,7 @@ var/ipfire/langs/en.pl
 var/ipfire/langs/fr.pl
 var/ipfire/langs/es.pl
 var/ipfire/menu.d/10-system.menu
+usr/local/bin/fireinfoctrl
 usr/local/bin/timectrl
 usr/local/bin/rebuild-initrd
 usr/local/bin/scanhd
index 4b972529e16544ebb08c1343b4e63f540740606b..31f899f8274b6c618780657d3037f9485e89bd0b 100644 (file)
@@ -55,6 +55,7 @@ if ("$fireinfosettings{'ACTION'}" eq "trigger") {
                unlink "$configfile";
                $fireinfosettings{'ENABLE_FIREINFO'} = 'off';
        }
+       system("/usr/local/bin/fireinfoctrl &");
 }
 
 &Header::openpage('Fireinfo', 1, '');
index 7b1e4578d58ee4f7085acf8fc793e2a57feecc55..348f91c7437111fe42b03edf77fd4bb3cf6248f5 100644 (file)
@@ -32,7 +32,7 @@ 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
+       setaliases urlfilterctrl updxlratorctrl fireinfoctrl
 SUID_UPDX = updxsetperms
 
 install : all
@@ -154,3 +154,7 @@ setaliases: setaliases.c setuid.o ../install+setup/libsmooth/varval.o
 
 updxsetperms: updxsetperms.c setuid.o ../install+setup/libsmooth/varval.o
        $(COMPILE) -I../install+setup/libsmooth/ updxsetperms.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+
+fireinfoctrl: fireinfoctrl.c setuid.o ../install+setup/libsmooth/varval.o
+       $(COMPILE) -I../install+setup/libsmooth/ fireinfoctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+
diff --git a/src/misc-progs/fireinfoctrl.c b/src/misc-progs/fireinfoctrl.c
new file mode 100644 (file)
index 0000000..963459a
--- /dev/null
@@ -0,0 +1,23 @@
+/* IPFire helper program - fireinfoctrl\r
+ *\r
+ * This program is distributed under the terms of the GNU General Public\r
+ * Licence.  See the file COPYING for details.\r
+ *\r
+ * (c) IPFire Team, 2011\r
+ *\r
+ * Simple program that calls "sendprofile" as the root user.\r
+ * \r
+ */\r
+         \r
+#include <stdlib.h>\r
+#include "setuid.h"\r
+\r
+int main(void)\r
+{\r
+       if (!(initsetuid()))\r
+               exit(1);\r
+                       \r
+       safe_system("/usr/bin/sendprofile");\r
+       \r
+       return 0;\r
+}\r