From 1a79ef8e43a4e406a79344341055dd9fa79ce57d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 5 Jan 2021 17:17:33 +0000 Subject: [PATCH] misc-progs: Drop unused upnpctrl Signed-off-by: Michael Tremer --- config/rootfiles/common/misc-progs | 1 - config/rootfiles/core/154/update.sh | 2 ++ src/misc-progs/Makefile | 2 +- src/misc-progs/upnpctrl.c | 54 ----------------------------- 4 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 src/misc-progs/upnpctrl.c diff --git a/config/rootfiles/common/misc-progs b/config/rootfiles/common/misc-progs index 90f0b2228a..a335dba7ab 100644 --- a/config/rootfiles/common/misc-progs +++ b/config/rootfiles/common/misc-progs @@ -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 diff --git a/config/rootfiles/core/154/update.sh b/config/rootfiles/core/154/update.sh index 37348e0dfd..a1523f742b 100644 --- a/config/rootfiles/core/154/update.sh +++ b/config/rootfiles/core/154/update.sh @@ -32,6 +32,8 @@ for (( i=1; i<=$core; i++ )); do done # Remove files +rm -vf \ + /usr/local/bin/upnpctrl # Stop services diff --git a/src/misc-progs/Makefile b/src/misc-progs/Makefile index 87b52ec747..896b1e9162 100644 --- a/src/misc-progs/Makefile +++ b/src/misc-progs/Makefile @@ -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 index f42502dddb..0000000000 --- a/src/misc-progs/upnpctrl.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include -#include -#include -#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\>/\%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; - } -} -- 2.39.5