]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
misc-progs: Drop unused upnpctrl
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Jan 2021 17:17:33 +0000 (17:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 6 Jan 2021 14:50:07 +0000 (14:50 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/common/misc-progs
config/rootfiles/core/154/update.sh
src/misc-progs/Makefile
src/misc-progs/upnpctrl.c [deleted file]

index 90f0b2228aba0e54fa66d5730aafc32ac825a1d1..a335dba7ab1b6dda16e5b27605f5742d92f42a44 100644 (file)
@@ -33,7 +33,6 @@ usr/local/bin/timectrl
 #usr/local/bin/torctrl
 usr/local/bin/unboundctrl
 usr/local/bin/updxlratorctrl
-usr/local/bin/upnpctrl
 usr/local/bin/urlfilterctrl
 #usr/local/bin/wiohelper
 #usr/local/bin/wioscan
index 37348e0dfd429fca84424659695cec4e890c6bfd..a1523f742bab58359a4d0b235472f7cfc0a6a34a 100644 (file)
@@ -32,6 +32,8 @@ for (( i=1; i<=$core; i++ )); do
 done
 
 # Remove files
+rm -vf \
+       /usr/local/bin/upnpctrl
 
 # Stop services
 
index 87b52ec747e1a90e6c469d38ee9b1e2027c4b367..896b1e916258c1e5b1cc3fe048025ee15b02756d 100644 (file)
@@ -28,7 +28,7 @@ SUID_PROGS = squidctrl sshctrl ipfirereboot \
        rebuildhosts backupctrl collectdctrl \
        logwatch wioscan wiohelper openvpnctrl firewallctrl \
        wirelessctrl getipstat qosctrl launch-ether-wake \
-       redctrl syslogdctrl extrahdctrl sambactrl upnpctrl \
+       redctrl syslogdctrl extrahdctrl sambactrl \
        smartctrl clamavctrl addonctrl pakfire mpfirectrl wlanapctrl \
        setaliases urlfilterctrl updxlratorctrl fireinfoctrl rebuildroutes \
        getconntracktable wirelessclient torctrl ddnsctrl unboundctrl \
diff --git a/src/misc-progs/upnpctrl.c b/src/misc-progs/upnpctrl.c
deleted file mode 100644 (file)
index f42502d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include "setuid.h"
-
-#define BUFFER_SIZE 1024
-
-char command[BUFFER_SIZE]; 
-
-int main(int argc, char *argv[])
-{
-
-        if (!(initsetuid()))
-                exit(1);
-
-        // Check what command is asked
-        if (argc==1)
-        {
-            fprintf (stderr, "Missing smbctrl command!\n");
-            return 1;
-        }
-
-        if (strcmp(argv[1], "upnpstart")==0)
-        {
-            snprintf(command, BUFFER_SIZE-1, "route add -net 239.0.0.0 netmask 255.0.0.0 %s", argv[3]);
-            safe_system(command);
-            printf(command);
-            snprintf(command, BUFFER_SIZE-1, "/usr/sbin/upnpd %s %s", argv[2], argv[3] );
-            safe_system(command);
-            printf(command);
-            return 0;
-        }
-
-        if (strcmp(argv[1], "upnpstop")==0)
-        {
-            snprintf(command, BUFFER_SIZE-1, "killall upnpd");
-            safe_system(command);
-            printf(command);
-            snprintf(command, BUFFER_SIZE-1, "route del -net 239.0.0.0 netmask 255.0.0.0 %s", argv[3]);
-            safe_system(command);
-            printf(command);
-            return 0;
-        }
-        if (strcmp(argv[1], "upnpxml")==0)
-        {
-            snprintf(command, BUFFER_SIZE-1, "sed 's/\<friendlyName\>.*\<\/friendlyName\>/\<friendlyName\>%s\<\/friendlyName\>/gi' %s/%s > tmp && mv tmp %s/%s", argv[2], argv[3], argv[4], argv[3], argv[4]);
-            safe_system(command);
-            printf(command);
-            return 0;
-        }
-}