mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 10:52:57 +02:00
misc-progs: Drop unused upnpctrl
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user