|
|
@@ -2577,6 +2577,11 @@ int exec_str(int idx, char *cmd) {
|
|
|
static void cmd_exec(int idx, char *par) {
|
|
|
putlog(LOG_CMDS, "*", "#%s# exec %s", dcc[idx].nick, par);
|
|
|
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (!conf.bot->hub && !isowner(dcc[idx].nick)) {
|
|
|
putlog(LOG_WARN, "*", "%s attempted 'exec' %s", dcc[idx].nick, par);
|
|
|
dprintf(idx, "exec is only available to permanent owners on leaf bots\n");
|
|
|
@@ -2590,12 +2595,24 @@ static void cmd_exec(int idx, char *par) {
|
|
|
|
|
|
static void cmd_w(int idx, char *par) {
|
|
|
putlog(LOG_CMDS, "*", "#%s# w", dcc[idx].nick);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (!exec_str(idx, "w"))
|
|
|
dprintf(idx, "Exec failed\n");
|
|
|
}
|
|
|
|
|
|
static void cmd_ps(int idx, char *par) {
|
|
|
putlog(LOG_CMDS, "*", "#%s# ps %s", dcc[idx].nick, par);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (strchr(par, '|') || strchr(par, '<') || strchr(par, ';') || strchr(par, '>')) {
|
|
|
putlog(LOG_WARN, "*", "%s attempted 'ps' with pipe/semicolon in parameters: %s", dcc[idx].nick, par);
|
|
|
dprintf(idx, "No.");
|
|
|
@@ -2619,6 +2636,11 @@ static void cmd_last(int idx, char *par) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
char user[20] = "";
|
|
|
|
|
|
if (par && par[0]) {
|
|
|
@@ -3732,12 +3754,24 @@ static void cmd_netw(int idx, char * par) {
|
|
|
char tmp[128] = "";
|
|
|
|
|
|
putlog(LOG_CMDS, "*", "#%s# netw", dcc[idx].nick);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
strcpy(tmp, "exec w");
|
|
|
botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
|
|
|
}
|
|
|
|
|
|
static void cmd_netps(int idx, char * par) {
|
|
|
putlog(LOG_CMDS, "*", "#%s# netps %s", dcc[idx].nick, par);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (strchr(par, '|') || strchr(par, '<') || strchr(par, ';') || strchr(par, '>')) {
|
|
|
putlog(LOG_WARN, "*", "%s attempted 'netps' with pipe/semicolon in parameters: %s", dcc[idx].nick, par);
|
|
|
dprintf(idx, "No.");
|
|
|
@@ -3752,6 +3786,12 @@ static void cmd_netps(int idx, char * par) {
|
|
|
|
|
|
static void cmd_netlast(int idx, char * par) {
|
|
|
putlog(LOG_CMDS, "*", "#%s# netlast %s", dcc[idx].nick, par);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (strchr(par, '|') || strchr(par, '<') || strchr(par, ';') || strchr(par, '>')) {
|
|
|
putlog(LOG_WARN, "*", "%s attempted 'netlast' with pipe/semicolon in parameters: %s", dcc[idx].nick, par);
|
|
|
dprintf(idx, "No.");
|
|
|
@@ -3775,6 +3815,12 @@ void crontab_show(struct userrec *u, int idx) {
|
|
|
#ifndef CYGWIN_HACKS
|
|
|
static void cmd_crontab(int idx, char *par) {
|
|
|
putlog(LOG_CMDS, "*", "#%s# crontab %s", dcc[idx].nick, par);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (!par[0]) {
|
|
|
dprintf(idx, "Usage: crontab <status|delete|show|new> [interval]\n");
|
|
|
return;
|
|
|
@@ -3859,11 +3905,17 @@ static void cmd_dns(int idx, char *par)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void cmd_netcrontab(int idx, char * par) {
|
|
|
- char *cmd = NULL;
|
|
|
-
|
|
|
+static void cmd_netcrontab(int idx, char * par)
|
|
|
+{
|
|
|
putlog(LOG_CMDS, "*", "#%s# netcrontab %s", dcc[idx].nick, par);
|
|
|
- cmd = newsplit(&par);
|
|
|
+
|
|
|
+ if (beta) {
|
|
|
+ dprintf(idx, "Sorry, this cmd is not available in the beta net.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ char *cmd = newsplit(&par);
|
|
|
+
|
|
|
if ((strcmp(cmd, "status") && strcmp(cmd, "show") && strcmp(cmd, "delete") && strcmp(cmd, "new"))) {
|
|
|
dprintf(idx, "Usage: netcrontab <status|delete|show|new> [interval]\n");
|
|
|
return;
|
|
|
@@ -4008,11 +4060,17 @@ static void rcmd_jump(char * frombot, char * fromhand, char * fromidx, char * pa
|
|
|
}
|
|
|
|
|
|
/* "Remotable" commands */
|
|
|
-void gotremotecmd (char *forbot, char *frombot, char *fromhand, char *fromidx, char *cmd) {
|
|
|
+void gotremotecmd (char *forbot, char *frombot, char *fromhand, char *fromidx, char *cmd)
|
|
|
+{
|
|
|
char *par = cmd;
|
|
|
|
|
|
cmd = newsplit(&par);
|
|
|
+
|
|
|
if (!strcmp(cmd, "exec")) {
|
|
|
+ if (beta) {
|
|
|
+ putlog(LOG_WARN, "*", "Received remote cmd '%s'; disabled on beta net.", cmd);
|
|
|
+ return;
|
|
|
+ }
|
|
|
rcmd_exec(frombot, fromhand, fromidx, par);
|
|
|
} else if (!strcmp(cmd, "curnick")) {
|
|
|
rcmd_curnick(frombot, fromhand, fromidx);
|
|
|
@@ -4021,6 +4079,10 @@ void gotremotecmd (char *forbot, char *frombot, char *fromhand, char *fromidx, c
|
|
|
} else if (!strcmp(cmd, "jump")) {
|
|
|
rcmd_jump(frombot, fromhand, fromidx, par);
|
|
|
} else if (!strcmp(cmd, "msg")) {
|
|
|
+ if (beta) {
|
|
|
+ putlog(LOG_WARN, "*", "Received remote cmd '%s'; disabled on beta net.", cmd);
|
|
|
+ return;
|
|
|
+ }
|
|
|
rcmd_msg(forbot, frombot, fromhand, fromidx, par);
|
|
|
} else if (!strcmp(cmd, "ver")) {
|
|
|
rcmd_ver(frombot, fromhand, fromidx);
|