From: pk910 Date: Fri, 23 Dec 2011 23:43:38 +0000 (+0100) Subject: censor server password on cmd_setbot X-Git-Tag: v5.3~106 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=2a8aacd9fd5a83dbaefca813193a64da2586f453 censor server password on cmd_setbot --- diff --git a/src/cmd_global_setbot.c b/src/cmd_global_setbot.c index 9118a0d..e7d7267 100644 --- a/src/cmd_global_setbot.c +++ b/src/cmd_global_setbot.c @@ -75,6 +75,12 @@ CMD_BIND(global_cmd_setbot) { reply(getTextBot(), user, "NS_SETBOT_SETTING", argv[1]); } if(log_event) { + if(!stricmp(argv[1], "serverpass") && value) { //censor server password + char cmd_args[MAXLEN]; + sprintf(cmd_args, "%d SERVERPASS ***", botid); + free(event->arguments); + event->arguments = strdup(cmd_args); + } logEvent(event); } } else { @@ -346,12 +352,14 @@ static int global_cmd_setbot_serverpass(struct UserNode *user, MYSQL_ROW bot, ch char *val = bot[4]; int ret = 0; if(value) { + if(!strcmp(value, "*")) + value = ""; struct ClientSocket *client; for(client = getBots(0, NULL); client; client = getBots(0, client)) { if(client->clientid == atoi(bot[15])) { if(client->pass) free(client->pass); - client->pass = strdup(value); + client->pass = (value ? strdup(value) : NULL); if(client->flags & SOCKET_FLAG_READY) reply(getTextBot(), user, "NS_SETBOT_NEED_RESTART"); break;