1769 lines
48 KiB
C
Executable File
1769 lines
48 KiB
C
Executable File
#include <string.h>
|
||
#include <ctype.h>
|
||
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <time.h>
|
||
#ifdef USE_DCC
|
||
#include <sys/socket.h>
|
||
#include <netinet/in.h>
|
||
#include <arpa/inet.h>
|
||
#include <sys/types.h>
|
||
#include <netinet/in.h>
|
||
#endif
|
||
|
||
#include "config.h"
|
||
|
||
#include "myfile.h"
|
||
char *nomodchan[]={
|
||
"#wildstar","" };
|
||
char *badchan[]={
|
||
"*!!*", "*warez*","*hack*","" };
|
||
|
||
#ifdef USE_DCC
|
||
extern struct aDccClient MyClient[];
|
||
extern char UPLINK[];
|
||
#endif
|
||
|
||
extern int SNOOP;
|
||
int GlineTime,LOGJOIN=0,UID_GLINE=0,SCAN_CLONES=1;
|
||
|
||
extern char *SuspendOper[];
|
||
extern time_t SuspendOperTime[];
|
||
extern char *SuspendChan[];
|
||
extern time_t SuspendChanTime[];
|
||
extern int DccCtr;
|
||
|
||
extern int NETBURST,FLOODPROTECTION;
|
||
extern char storebuf[];
|
||
extern char *operchan[],*killchan[];
|
||
extern long D_JOIN,D_NICK,D_PART,D_MODE,D_KICK,D_SERVER,D_QUIT,D_USER,D_SQUIT;
|
||
extern long N_JOIN,N_NICK,N_PART,N_MODE,N_KICK,N_SERVER,N_QUIT,N_USER,N_SQUIT;
|
||
extern long D_TOTAL,N_TOTAL,N_OTHER,D_OTHER,FLOODLOGS;
|
||
extern long D_KILL,N_KILL;
|
||
extern long D_TOPIC,N_TOPIC;
|
||
extern int DO_AUTOKICK,DO_CORE;
|
||
extern time_t S_TIME;
|
||
extern char *token[];
|
||
extern int CLONE_UP,CLONE_LO,CLONE_DIG,LOGHOST;
|
||
extern int MAX_SESSIONS,MAX_ALLOWED;
|
||
extern int SITE_CLONE,KILL_NICKFLOOD;
|
||
extern time_t NOWTIME;
|
||
extern int killstatus;
|
||
extern char buf[];
|
||
extern int botsck,sevsck;
|
||
int noopers=0,doclearkick=0,doclearops=0,docleanchan=0,docleanops=0;
|
||
char channel[255];
|
||
char comment[255],modes[10];
|
||
char orig[255];
|
||
char opcommand[512];
|
||
int status;
|
||
int showme=0;
|
||
int DO_WIBBLE=0;
|
||
int nohelp=NOHELP;
|
||
int LOG_TSC=1,WARNCLONE=3,ACT_ANAL=0,STRICT_SCAN=1,AUTOGLINE=4,KICK_ASS=0,ANAL_GLINE=1,NO_TSC=0;
|
||
int CLEAR_KICK=0;
|
||
int SECURE_OPER=0;
|
||
int IPSCAN=0;
|
||
char *opcom_command[]={"MODE","KICK",""};
|
||
char *invitekiller[]={"willy13","born2rok","babybluz","rkzmedud",
|
||
"melubue","MissPowy","BLITZKRIE",
|
||
""};
|
||
|
||
char *invitehosts[]={ "palimano.horsesale.com","stallion.horsesale.com",
|
||
"arapaho.wfire.net","nebula.wildstar.net","creek.wfire.net",
|
||
"orion.wildstar.net","BATTLESERVER.COM",
|
||
""};
|
||
|
||
parse(char *fromhost)
|
||
{
|
||
int level=0,i,j,k,m,chk,loop;
|
||
char temp[512];
|
||
char filename[80];
|
||
char mask[100];
|
||
char tbuf[1024];
|
||
struct aUser *myuser,*targuser;
|
||
/* PROCESS MSGS FROM USERS */
|
||
writelog(fromhost);
|
||
myuser = chklevel(fromhost);
|
||
if(myuser != NULL) level = myuser->level;
|
||
if(!level) level=DEFAULT_LEVEL;
|
||
k=chk_num(0);
|
||
|
||
*token[0]++;
|
||
/* remove the leading : */
|
||
if((token[3]) && (*token[3]==':')) token[3]++;
|
||
|
||
if(level < 1)
|
||
{ sprintf(tbuf,":%s NOTICE %s :ACCESS DENIED\n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
|
||
|
||
if(level < 8)
|
||
{
|
||
for(loop=0;*SuspendOper[loop];loop++)
|
||
{
|
||
if((SuspendOperTime[loop]<0) || (SuspendOperTime[loop]>NOWTIME))
|
||
{ if(!match(SuspendOper[loop],fromhost))
|
||
{ if(DccCtr<0)
|
||
{ sprintf(tbuf,":%s NOTICE %s :Your Uworld access is Suspended\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else
|
||
{ writeln(MyClient[DccCtr].fd,"Your Uworld access is suspended\n");
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
if((NETBURST) && (*token[3]!='d'))
|
||
{
|
||
sprintf(tbuf,":%s NOTICE %s :Processing Netburst [%d]\n",CHANSVR,
|
||
token[0],NETBURST);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
|
||
if((k>3) && (*token[3]=='\1'))
|
||
{ if((k>7) && (!strcmp(token[3]+1,"DCC")) && (!strcmp(token[4],"CHAT")))
|
||
{ if((level > 1) && (IsOper(token[0],fromhost)))
|
||
accept_dcc(fromhost);
|
||
else
|
||
{ sprintf(tbuf,":%s NOTICE %s :You forgot your secret key\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
return 1;
|
||
}
|
||
|
||
if((k>3) && (strcasecmp(token[3],"mycmd")) &&
|
||
(strcasecmp(fromhost,"cservice@undernet.org")) &&
|
||
(strcasecmp(token[3],"dmsg")) &&
|
||
(strcasecmp(token[3],"vrfy")) &&
|
||
(strcasecmp(token[3],"wall")) && (strcasecmp(token[3],"dccwall"))
|
||
) storecomm(fromhost);
|
||
|
||
if ((k>3) && (!match(token[3],"help"))) {
|
||
if(IsOper(token[0],fromhost))
|
||
{ strcpy(filename,HELPFILE);
|
||
catfile(filename,CHANSVR);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,":%s NOTICE %s :This service is for operators only\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
return;
|
||
}
|
||
|
||
if((k > 4) && (!strcmp(token[3],"reop")) &&
|
||
((!strcmp(token[0],"W")) || (!strcasecmp(token[0],"X"))) )
|
||
{ if(*token[4]!='#')
|
||
{ sprintf(tbuf,":%s NOTICE %s :can only reop a channel\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
if((level>6)
|
||
/*&& !match("*cservice@channels*.undernet.org",fromhost)*/
|
||
)
|
||
{
|
||
sprintf(tbuf,"MODE %s +o %s\n",token[4],token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(chkchanlevel(fromhost,token[4])>4)
|
||
{
|
||
sprintf(tbuf,"MODE %s +o %s\n",token[4],token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,
|
||
":%s NOTICE %s :sorry you dont have clearance on that channel\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
return;
|
||
}
|
||
|
||
/* VERIFY USER IS AN OPERATOR */
|
||
if((k>4) && ( !strcasecmp(token[3],"vrfy")))
|
||
{
|
||
if(VrfyOper(token[0],fromhost,token[4]))
|
||
{ sprintf(tbuf,":%s NOTICE %s :Auth Successful\n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else
|
||
{ sprintf(tbuf,":%s NOTICE %s :Auth FAILED\n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
}
|
||
|
||
if((level > 1) && (IsOper(token[0],fromhost)))
|
||
{
|
||
if(!match(token[2],"VERSION")) do_version();
|
||
|
||
if(k>3) /* Commands w/o arguments */
|
||
{
|
||
|
||
/* Toggle WIBBLE MODE ON/OFF */
|
||
if(!strcasecmp(token[3],"dowibble"))
|
||
{
|
||
DO_WIBBLE = (DO_WIBBLE)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :Wibble mode set %s\n",CHANSVR,token[0],
|
||
(DO_WIBBLE)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
if((k>4) && (!strcasecmp(token[3],"leave")) && (*token[4]=='#'))
|
||
{ sprintf(tbuf,":%s PART %s\n",CHANSVR,token[4]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
if((k>4) && (!strcasecmp(token[3],"join")) && (*token[4]=='#'))
|
||
{ sprintf(tbuf,":%s JOIN %s\n",CHANSVR,token[4]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
if(!strcasecmp(token[3],"users"))
|
||
{ showall(token[0],sevsck);
|
||
return;
|
||
}
|
||
if(!strcasecmp(token[3],"stats"))
|
||
{ dump_stats();
|
||
return;
|
||
}
|
||
|
||
/* BANS */
|
||
if(!strcasecmp(token[3],"bans"))
|
||
{
|
||
show_glines();
|
||
return;
|
||
}
|
||
|
||
if((k>4) && (!strcasecmp(token[3],"testban")))
|
||
{
|
||
sprintf(tbuf,":%s NOTICE %s :%s == %d\n",
|
||
CHANSVR,token[0],token[4],check_glines(token[4]));
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
if(!strcasecmp(token[3],"loadglines"))
|
||
{
|
||
read_glines(GLINEFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted GLINES list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
|
||
return;
|
||
}
|
||
if(!strcasecmp(token[3],"showbans"))
|
||
{
|
||
show_glines();
|
||
return;
|
||
}
|
||
|
||
if(!strcmp(token[3],"clones"))
|
||
{ status = SHOW_HOSTS;
|
||
sprintf(tbuf,":%s WHOIS %s \n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
|
||
} /* End of K>3 */
|
||
|
||
if(k>4) /* commands with 1 argument */
|
||
{
|
||
if(!strcmp(token[3],"chanlevel"))
|
||
{ sprintf(tbuf,":%s NOTICE %s :your channel access on %s is %d\n",
|
||
CHANSVR, token[0],token[4],chkchanlevel(fromhost,token[4]));
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
/* CLEAR CHANNEL */
|
||
if(!strcmp(token[3],"clearchan"))
|
||
{
|
||
if((*token[4]!='#') && (k>5))
|
||
{
|
||
comment[0]='\0';
|
||
if((k>6) && token[6])
|
||
{ for(loop=6;token[loop+1];loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
strcat(comment,token[loop]);
|
||
}
|
||
|
||
if(*token[4]=='-') *token[4]++;
|
||
strncpy(modes,token[4],9);
|
||
modes[9]='\0';
|
||
strcpy(channel,token[5]);
|
||
}
|
||
else
|
||
{
|
||
comment[0]='\0';
|
||
if((k>5) && token[5])
|
||
{ for(loop=5;token[loop+1];loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
strcat(comment,token[loop]);
|
||
}
|
||
|
||
strcpy(modes,"mob");
|
||
strcpy(channel,token[4]);
|
||
}
|
||
if(!strcasecmp(channel,"#wasteland"))
|
||
{ sprintf(tbuf,
|
||
":%s NOTICE %s :That channel is no longer withing my control\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else
|
||
DoClearchan(token[0],channel);
|
||
}
|
||
if(!strcmp(token[3],"clearops"))
|
||
{
|
||
strcpy(channel,token[4]);
|
||
DoClearOps(token[0],channel);
|
||
}
|
||
if(!strcmp(token[3],"clearbans"))
|
||
{
|
||
strcpy(channel,token[4]);
|
||
DoClearBans(token[0],channel);
|
||
}
|
||
if(!strcmp(token[3],"clearmodes"))
|
||
{
|
||
strcpy(channel,token[4]);
|
||
DoClearModes(token[0],channel);
|
||
}
|
||
|
||
|
||
if((k>5) && (!strcmp(token[3],"gline")))
|
||
{ char *gmask;
|
||
char *hstname;
|
||
char hostmask[255];
|
||
GlineTime=600;
|
||
gmask=token[4];
|
||
|
||
if((k>6) && (atoi(token[4])) )
|
||
{ GlineTime=atoi(token[4]);
|
||
|
||
if((GlineTime > 864000) && (level < 8))
|
||
{ gmask=token[0];
|
||
sprintf(tbuf,
|
||
":%s NOTICE %s :Gline timelimits are 10 days (864000) Anything more is a bit redicilous. -- BOUNCING GLINE for violation of regulations\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else
|
||
gmask=token[5];
|
||
}
|
||
|
||
if( (hstname=strchr(gmask,'@')) != NULL)
|
||
{ for(loop=0;loop<strlen(hstname);loop++)
|
||
{ if(( ( *(hstname+loop) == '*')) || ( (*(hstname+loop) == '?')))
|
||
{ sprintf(tbuf,":%s NOTICE %s :NO WILDCARDS IN HOSTNAME\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
|
||
}
|
||
}
|
||
else
|
||
{ if((strchr(gmask,'.')) || (strchr(gmask,'*')) ||
|
||
(strchr(gmask,'?')))
|
||
{ sprintf(tbuf,"NOTICE %s :Invalid Nick or Mask\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
else
|
||
{
|
||
GetUserHost(gmask,hostmask);
|
||
if(hostmask[0]=='\0')
|
||
{ sprintf(tbuf,"NOTICE %s :Invalid Nick or Mask %s\n",
|
||
token[0],gmask);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
sprintf(tbuf,":%s NOTICE %s :%s matched to %s\n",
|
||
CHANSVR,token[0],gmask,hostmask);
|
||
writeln(sevsck,tbuf);
|
||
gmask = hostmask;
|
||
}
|
||
}
|
||
|
||
/* ANTI GLINE MASK Per request of Mandar@wildstar.net */
|
||
if(!(check_gline_mask(gmask)))
|
||
{ sprintf(tbuf,":%s NOTICE %s :That site can not be GLINED\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
|
||
comment[0]='\0';
|
||
if(k>5)
|
||
{ for(loop=(gmask==token[5])?6:5;loop<k-1;loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
strcat(comment,token[loop]);
|
||
sprintf(orig,"%s!%s",token[0],fromhost);
|
||
DoGline(orig,gmask,comment);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Why would you want to do that\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
} /* End of GLINE */
|
||
if(!strcmp(token[3],"mgline"))
|
||
{ char *gmask;
|
||
char *hstname;
|
||
|
||
GlineTime=600;
|
||
gmask=token[4];
|
||
|
||
if((k>5) && (atoi(token[4])) )
|
||
{ GlineTime=atoi(token[4]);
|
||
if((GlineTime > 864000) && (level < 8))
|
||
{ gmask=token[0];
|
||
sprintf(tbuf,
|
||
":%s NOTICE %s :Gline timelimits are 10 days (864000) Anything more is a bit redicilous. -- BOUNCING GLINE for violation of regulations\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else
|
||
gmask=token[5];
|
||
}
|
||
if( (hstname=strchr(gmask,'@')) == NULL)
|
||
{ sprintf(tbuf,"NOTICE %s :You must specify a username\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
|
||
comment[0]='\0';
|
||
if(k>5)
|
||
{
|
||
for(loop=(gmask==token[5])?6:5;loop<k-1;loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
strcat(comment,token[loop]);
|
||
sprintf(orig,"%s!%s",token[0],fromhost);
|
||
DoGline(orig,gmask,comment);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Why would you want to do that\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
|
||
|
||
if(!strcmp(token[3],"rgline"))
|
||
{ char *gmask;
|
||
char *hstname;
|
||
|
||
GlineTime=900;
|
||
gmask=token[4];
|
||
|
||
if((k>5) && (atoi(token[4])) )
|
||
{ GlineTime=atoi(token[4]);
|
||
gmask=token[5];
|
||
}
|
||
if( (hstname=strchr(gmask,'@')) == NULL)
|
||
{ sprintf(tbuf,"NOTICE %s :You must specify a username\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
|
||
comment[0]='\0';
|
||
if(k>5)
|
||
{
|
||
for(loop=(gmask==token[5])?6:5;loop<k-1;loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
sprintf(orig,"%s!%s",token[0],fromhost);
|
||
DoRGline(orig,gmask,comment);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Why would you want to do that\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
|
||
if(!strcmp(token[3],"remallgline"))
|
||
{
|
||
rem_all_glines();
|
||
}
|
||
|
||
if(!strcmp(token[3],"remgline"))
|
||
{
|
||
DoRemGline(token[0],token[4]);
|
||
}
|
||
|
||
if(!strcmp(token[3],"autoban"))
|
||
{ char *gmask;
|
||
char *hstname;
|
||
GlineTime=600;
|
||
gmask=token[4];
|
||
if((k>5) && (atoi(token[4])) )
|
||
{ GlineTime=atoi(token[4]);
|
||
gmask=token[5];
|
||
}
|
||
if( (hstname=strchr(gmask,'@')) != NULL)
|
||
{ for(loop=0;loop<strlen(hstname);loop++)
|
||
{ if(( ( *(hstname+loop) == '*')) || ( (*(hstname+loop) == '?')))
|
||
{ sprintf(tbuf,":%s NOTICE %s :NO WILDCARDS IN HOSTNAME\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
|
||
}
|
||
}
|
||
comment[0]='\0';
|
||
if(k>5)
|
||
{ for(loop=5;loop<k;loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
sprintf(orig,"%s!%s",token[0],fromhost);
|
||
DoAutoban(orig,token[4],comment);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Why would you want to do that\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
|
||
if(!strcmp(token[3],"mautoban"))
|
||
{
|
||
comment[0]='\0';
|
||
if(k>5)
|
||
{ for(loop=5;loop<k;loop++)
|
||
{ strcat(comment,token[loop]);
|
||
strcat(comment," ");
|
||
}
|
||
sprintf(orig,"%s!%s",token[0],fromhost);
|
||
DoAutoban(orig,token[4],comment);
|
||
}
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Why would you want to do that\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
|
||
|
||
if(!strcmp(token[3],"remautoban"))
|
||
{
|
||
DoRemAutoban(token[0],token[4]);
|
||
}
|
||
|
||
if(!strcmp(token[3],"kiltel"))
|
||
{ status = KILTEL;
|
||
strcpy(channel,token[4]);
|
||
sprintf(tbuf,":%s WHOIS %s \n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
|
||
|
||
} /* END OF k>4 */
|
||
|
||
|
||
} /* END OF OPER COMMANDS */
|
||
|
||
if (level > 5) {
|
||
|
||
if(k>3) /* Commands w/o arguments */
|
||
{
|
||
if(!strcasecmp(token[1],"DCC"))
|
||
{ if(!strcasecmp(token[3],"dmsg")) DccMessage(token[4]);
|
||
if(!strcasecmp(token[3],"dwho")) DccWho(token[4]);
|
||
if(!strcasecmp(token[3],"umode")) DccUmode(token[4]);
|
||
if(!strcasecmp(token[3],"dccwall")) DccWall();
|
||
if(!strcasecmp(token[3],"wall")) DccWall();
|
||
if(!strcasecmp(token[3],"dlist")) DccList();
|
||
}
|
||
}
|
||
|
||
if((k>4) && (!strcmp(token[3],"info"))) do_info(token[4]);
|
||
else if((k>3) && (!strcmp(token[3],"servs"))) dump_protected(token[0]);
|
||
else if((k>3) && (!strcmp(token[3],"protect"))) add_myserv(token[0],
|
||
sevsck);
|
||
else if((k>3) && (!strcmp(token[3],"unprotect"))) rem_myserv(token[0],
|
||
sevsck);
|
||
else if(!strcmp(token[3],"scan2")) do_scan(sevsck,k);
|
||
else if((k>3) && (!strcmp(token[3],"nofloods")) )
|
||
oper_invite(token[0],"#Uworld.floods");
|
||
else if((k>4) && (!strcmp(token[3],"operin")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
{ while(*token[4]=='#') ++token[4];
|
||
if(check_operchan(token[4]))
|
||
{ char mylbuf[128];
|
||
sprintf(mylbuf,"#%s",token[4]);
|
||
oper_invite(token[0],mylbuf);
|
||
}
|
||
}
|
||
else if((k>4) && (!strcmp(token[3],"operrem")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
{ while(*token[4]=='#') ++token[4];
|
||
if(check_operchan(token[4]))
|
||
{ rem_operchan(token[4]);
|
||
sprintf(tbuf,":Chansvr MODE #%s -i\n:Chansvr PART #%s\n",
|
||
token[4],token[4]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
else if((!strcmp(token[3],"showoperchan")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
show_operchan();
|
||
else if((k>4) && (!strcmp(token[3],"operadd")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
{ char mylbuf[128];
|
||
|
||
if(level <9)
|
||
{ sprintf(tbuf,":%s NOTICE %s :Permission denied\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
while(*token[4]=='#') ++token[4];
|
||
if(!check_operchan(token[4])) add_operchan(token[4]);
|
||
sprintf(tbuf,":CHANSVR Wallops :%s OPERCHAN %s\n",
|
||
token[0],token[4]);
|
||
writeln(sevsck,tbuf);
|
||
join_opchan(token[4]);
|
||
sprintf(mylbuf,"#%s",token[4]);
|
||
oper_invite(token[0],mylbuf);
|
||
}
|
||
|
||
else if((!strcmp(token[3],"showkillchan")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
show_killchan();
|
||
|
||
else if((k>4) && (!strcmp(token[3],"remkillchan")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
{
|
||
rem_killchan(token[4]);
|
||
sprintf(buf,":%s NOTICE %s :remkillchan %s\n",
|
||
CHANSVR,token[0],token[4]);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
else if((k>4) && (!strcmp(token[3],"killchan")) &&
|
||
(IsOper(token[0],fromhost)))
|
||
{ char mylbuf[128];
|
||
add_killchan(token[4]);
|
||
sprintf(tbuf,":CHANSVR Wallops :%s BANCHAN %s\n",
|
||
token[0],token[4]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
|
||
else if((k > 4) && (!strcmp(token[3],"scan")))
|
||
{
|
||
strcpy(channel,token[0]);
|
||
strcpy(opcommand,token[4]);
|
||
status = SCAN;
|
||
sprintf(tbuf,":%s WHOIS %s\n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else if(!strcmp(token[3],"lusers")) do_lusers();
|
||
else if(!strcmp(token[3],"lastcomm"))
|
||
lastcomm((token[4])?atoi(token[4]):CMDHISTORY);
|
||
else if(!strcmp(token[3],"lastlog"))
|
||
lastcomm((token[4])?atoi(token[4]):CMDHISTORY);
|
||
|
||
if((k > 4) && (!strcmp(token[3],"opcom"))) {
|
||
|
||
for(chk=0;*opcom_command[chk];chk++)
|
||
{ if(!strcasecmp(token[4],opcom_command[chk]))
|
||
{
|
||
if(atoi(token[4]))
|
||
{ sprintf(tbuf,
|
||
":%s NOTICE %s :Sorry, numerics have been disables\n",
|
||
CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
strcpy(temp,token[4]);
|
||
for(i=5;i<k;i++) {
|
||
strcat(temp," "); strcat(temp,token[i]);
|
||
}
|
||
|
||
if((level > 6) || (IsOper(token[0],fromhost)))
|
||
{
|
||
DoOpcom(token[0],temp);
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
sprintf(tbuf,
|
||
":%s NOTICE %s :Sorry, that command is INVALID per request of MMMM!mandar@vinson.ecn.uoknor.edu\n",CHANSVR,token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
}
|
||
|
||
/* NOTE: level 7 command == opcom w/o oper check */
|
||
if(level > 7) {
|
||
if((k > 4) && (!strcmp(token[3],"spew")))
|
||
{ if(error_check(token[4])>MINCHARS) spew_nicklist(token[4],token[0]);
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Not enough characters in pattern\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
else if( (k > 3) && (!strcasecmp(token[3],"actanal")))
|
||
{
|
||
ACT_ANAL = (ACT_ANAL)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :ACT_ANAL mode set %s\n",CHANSVR,token[0],
|
||
(ACT_ANAL)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if( (k > 3) && (!strcasecmp(token[3],"ipscan")))
|
||
{
|
||
IPSCAN = (IPSCAN)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :IPSCAN mode set %s\n",CHANSVR,token[0],
|
||
(IPSCAN)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
else if( (k > 4) && (!strcasecmp(token[3],"uidgline")))
|
||
{
|
||
UID_GLINE=(atoi(token[4])>2)?atoi(token[4]):0;
|
||
sprintf(tbuf,":%s NOTICE %s :UID_GLINE mode set %d\n",CHANSVR,token[0],
|
||
UID_GLINE);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"tsc")))
|
||
{
|
||
NO_TSC = (NO_TSC)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :NO_TSC mode set %s\n",CHANSVR,token[0],
|
||
(NO_TSC)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"floodlog")))
|
||
{
|
||
FLOODLOGS = (FLOODLOGS)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :FLOODLOGS mode set %s\n",CHANSVR,token[0],
|
||
(FLOODLOGS)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"secureoper")))
|
||
{
|
||
SECURE_OPER = (SECURE_OPER)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :SECURE_OPER mode set %s\n",CHANSVR,token[0],
|
||
(SECURE_OPER)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
sprintf(tbuf,
|
||
":CHANSVR WALLOPS :SECURE_OPER MODE SET %s\n",
|
||
(SECURE_OPER)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"clearkick")))
|
||
{
|
||
CLEAR_KICK = (CLEAR_KICK)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :CLEAR_KICK mode set %s\n",CHANSVR,token[0],
|
||
(CLEAR_KICK)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if( (k > 3) && (!strcasecmp(token[3],"snoop")))
|
||
{
|
||
SNOOP = (SNOOP)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :SNOOP mode set %s\n",CHANSVR,token[0],
|
||
(SNOOP)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"kickass")))
|
||
{
|
||
KICK_ASS = (KICK_ASS)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :KICK_ASS mode set %s\n",CHANSVR,token[0],
|
||
(KICK_ASS)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
sprintf(tbuf,
|
||
":CHANSVR WALLOPS :AUTOMATED GLINES SET %s anti-clone level %d\n",
|
||
(KICK_ASS)?"ON":"OFF",AUTOGLINE);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"dogline")))
|
||
{
|
||
ANAL_GLINE = (ANAL_GLINE)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :ANAL_GLINE mode set %s\n",CHANSVR,token[0],
|
||
(ANAL_GLINE)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
sprintf(tbuf,
|
||
":CHANSVR WALLOPS :NO TOLERANCE GLINES ARMED %s anti-clone level %d\n",
|
||
(ANAL_GLINE)?"ON":"OFF",AUTOGLINE);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
else if( (k > 3) && (!strcasecmp(token[3],"strictscan")))
|
||
{
|
||
STRICT_SCAN = (STRICT_SCAN)?0:1;
|
||
sprintf(tbuf,":%s NOTICE %s :STRICT_SCAN mode set %s\n",CHANSVR,token[0],
|
||
(STRICT_SCAN)?"ON":"OFF");
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
|
||
else if(!strcmp(token[3],"reconnect")) { close(sevsck);
|
||
sevsck=sev_login(UPLINK);
|
||
do_bots();
|
||
}
|
||
else if((k > 4) && (!strcmp(token[3],"jupe")))
|
||
sev_jupe(token[4],token[0]);
|
||
else if((k > 4) && (!match(token[3],"makehelp"))) {
|
||
nohelp=0;
|
||
makehelp(sevsck,token[4],"Commander Bot");
|
||
}
|
||
}
|
||
|
||
if (level > 8) {
|
||
if(!strcmp(token[3],"nohelp")) nohelp=1;
|
||
else if((k>3) && (!strcmp(token[3],"makeop")))
|
||
{ if(MakeOper(token[4]))
|
||
sprintf(tbuf,":%s NOTICE %s :%s is considerd an Operator\n",
|
||
CHANSVR,token[0],token[4]);
|
||
else sprintf(tbuf,":%s NOTICE %s :%s not found\n",
|
||
CHANSVR,token[0],token[4]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if((k>4) && (!strcmp(token[3],"opersuspend")))
|
||
{ time_t gtime;
|
||
struct tm tblock;
|
||
if(token[5]) gtime=NOWTIME+atoi(token[5]);
|
||
else gtime=NOWTIME+19999999;
|
||
add_suspend(token[4],gtime);
|
||
tblock=*localtime(>ime);
|
||
sprintf(tbuf,"*** OPERSUSPEND [%s] by %s until %s",
|
||
token[4],token[0],asctime(&tblock));
|
||
DccGlobal(tbuf,DCC_ANY);
|
||
}
|
||
else if((k>4) && (!strcmp(token[3],"chansuspend")))
|
||
{ time_t gtime;
|
||
struct tm tblock;
|
||
if(token[5]) gtime=NOWTIME+atoi(token[5]);
|
||
else gtime=NOWTIME+19999999;
|
||
add_Csuspend(token[4],gtime);
|
||
tblock=*localtime(>ime);
|
||
sprintf(tbuf,"*** CHANNEL SUSPEND [%s] by %s until %s",
|
||
token[4],token[0],asctime(&tblock));
|
||
DccGlobal(tbuf,DCC_ANY);
|
||
}
|
||
else if(!strcmp(token[3],"nokill")) KILL_NICKFLOOD=0;
|
||
else if(!strcmp(token[3],"autokick"))
|
||
{ DO_AUTOKICK = (DO_AUTOKICK)?0:1;
|
||
sprintf(tbuf,"NOTICE %s :AUTOKICK set %s\n",
|
||
token[0],(DO_AUTOKICK)?"on":"off");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else if(!strcmp(token[3],"autocore"))
|
||
{ DO_CORE = (DO_CORE)?0:1;
|
||
sprintf(tbuf,"NOTICE %s :CORE set %s\n",
|
||
token[0],(DO_CORE)?"on":"off");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else if(!strcmp(token[3],"floodprotection"))
|
||
{ FLOODPROTECTION = (FLOODPROTECTION)?0:1;
|
||
sprintf(tbuf,"NOTICE %s :FLOODPROTECTION set %s\n",
|
||
token[0],(FLOODPROTECTION)?"on":"off");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else if(!strcmp(token[3],"logjoin"))
|
||
{ LOGJOIN = (LOGJOIN)?0:1;
|
||
sprintf(tbuf,"NOTICE %s :LOGJOIN set %s\n",
|
||
token[0],(LOGJOIN)?"on":"off");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
|
||
else if(!strcmp(token[3],"loghost"))
|
||
{ LOGHOST = (LOGHOST)?0:1;
|
||
sprintf(tbuf,"NOTICE %s :LOGHOST set %s\n",
|
||
token[0],(LOGHOST)?"on":"off");
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
else if((k > 7) && (!strcmp(token[3],"addusr")))
|
||
{ if(atoi(token[4]) < 8)
|
||
{
|
||
if(error_check(token[6]) < MINCHARS) return;
|
||
add_myuser(atoi(token[4]),token[5],token[6],token[7],
|
||
NOWTIME+3600,NULL);
|
||
}
|
||
}
|
||
else if((k > 4) && (!strcmp(token[3],"remusr")))
|
||
{
|
||
remove_myuser(token[4]);
|
||
}
|
||
else if(!strcmp(token[3],"showagl")) show_agl();
|
||
else if(!strcmp(token[3],"showmhost")) show_mhost();
|
||
else if(!strcmp(token[3],"showmhost")) show_shost();
|
||
else if(!strcmp(token[3],"showsuspend")) show_suspend();
|
||
else if(!strcmp(token[3],"showcsuspend")) show_Csuspend();
|
||
else if(!strcmp(token[3],"loadchansuspend"))
|
||
{
|
||
read_Csuspend(CHANSUSPENDFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted CHANNEL SUSPEND list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"loadkillchan")) read_killchan(KILLCHANFILE);
|
||
else if(!strcmp(token[3],"loadsuspend"))
|
||
{
|
||
read_suspend(SUSPENDFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted SUSPEND list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"loadshost"))
|
||
{
|
||
read_shost(SHOSTFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted SHOST list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"loadmhost"))
|
||
{
|
||
read_mhost(MHOSTFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted MHOST list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"loadagl"))
|
||
{
|
||
read_glinehost(AGLINEFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted AGL list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"loadnogln"))
|
||
{
|
||
read_noglines(EGLINEFILE);
|
||
sprintf(tbuf,"NOTICE %s :rebooted exempt list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"showfloods")) { showfloods(token[0]); return;}
|
||
else if(!strcmp(token[3],"loadusr"))
|
||
{ destroy_myuser();
|
||
load_myuser("user.file");
|
||
sprintf(tbuf,"NOTICE %s :rebooted user list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if(!strcmp(token[3],"dokill")) KILL_NICKFLOOD=1;
|
||
else if(!strcmp(token[3],"reboot")) reboot();
|
||
else if(!strcmp(token[3],"masskill"))
|
||
{ if(error_check(token[4])>MINCHARS) do_kill(sevsck,k);
|
||
else
|
||
{ sprintf(tbuf,"NOTICE %s :Not enough characters in pattern\n",
|
||
token[0]);
|
||
writeln(sevsck,tbuf);
|
||
}
|
||
}
|
||
else if((k > 4) && (!strcmp(token[3],"check")))
|
||
do_error_check(token[4],token[0]);
|
||
else if(!strcmp(token[3],"reconnect")) { close(sevsck);
|
||
sevsck=sev_login(UPLINK);
|
||
do_bots();
|
||
}
|
||
|
||
}
|
||
|
||
if (level > 9) {
|
||
if((k > 4) && (!strcmp(token[3],"nickserv"))) nickserv(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"dkill"))) DccKill(token[4]);
|
||
else if(!strcmp(token[3],"reload"))
|
||
{ destroy_myuser();
|
||
load_myuser("user.file");
|
||
sprintf(tbuf,"NOTICE %s :rebooted user list from file\n",token[0]);
|
||
writeln(sevsck,tbuf);
|
||
return;
|
||
}
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"killlog"))) killstatus=atoi(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"noopers"))) noopers=atoi(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"maxses"))) MAX_SESSIONS=atoi(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"maxsite"))) SITE_CLONE=atoi(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"autogline")) &&
|
||
(atoi(token[4])>3)) AUTOGLINE=atoi(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"warnclone"))) WARNCLONE=atoi(token[4]);
|
||
else if((k>4)
|
||
&& (!strcmp(token[3],"maxclients"))) MAX_ALLOWED=atoi(token[4]);
|
||
else if(!strcmp(token[3],"mycmd")) do_scmd(sevsck);
|
||
else if((k>4)&&(!strcmp(token[3],"makemybots")))
|
||
makemybots(atoi(token[4]));
|
||
else if((k>4)&&(!strcmp(token[3],"killmybots")))
|
||
killmybots(atoi(token[4]));
|
||
else if((k>4) &&
|
||
(!strcmp(token[3],"checkmask")))
|
||
{ if(check_gline_mask(token[4]))
|
||
sprintf(tbuf,":%s NOTICE %s :MASK: %s -- OK\n",CHANSVR,token[0],
|
||
token[4]);
|
||
else
|
||
sprintf(tbuf,":%s NOTICE %s :MASK: %s -- INVALID\n",CHANSVR,token[0],
|
||
token[4]);
|
||
writeln(sevsck,tbuf);
|
||
return 0;
|
||
}
|
||
else if(!strcmp(token[3],"showhost")) show_hosts(token[0],0);
|
||
else if(!strcmp(token[3],"nickdump")) dump_nicklist(NULL,"NICK_LIST");
|
||
else if((k > 5) && (!strcmp(token[3],"filenick")))
|
||
dump_nicklist(token[4],token[5]);
|
||
else if(!strcmp(token[3],"numnuk")) num_nuk(token[4]);
|
||
else if(!strcmp(token[3],"numnuk2")) num_nuk2(token[4]);
|
||
else if(!strcmp(token[3],"numnuk3")) num_nuk3(token[4]);
|
||
else if(!strcmp(token[3],"kill")) mass_kill(k);
|
||
else if(!strcmp(token[3],"deop")) mass_deop(k);
|
||
else if(!strcmp(token[3],"dome")) do_scmd(botsck);
|
||
else if(!strcmp(token[3],"exit"))
|
||
{ sprintf(tbuf,"ACK.. Forced exit by %s!\n",token[0]);
|
||
DccGlobal(tbuf,DCC_ANY);
|
||
exit(0);
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
sevstuff(sck,fromhost)
|
||
int sck;
|
||
char *fromhost;
|
||
{
|
||
int j,k,i,level;
|
||
char temp[255];
|
||
int stat,myrand;
|
||
int offset;
|
||
static time_t last_wibble=0;
|
||
struct aUser *targuser;
|
||
|
||
offset=0;
|
||
k=chk_num(0);
|
||
temp[0]='\0';
|
||
|
||
if(!strcmp(token[0],"NICK"))
|
||
{ /* NEW USER */
|
||
add_newuser(token,k,0);
|
||
}
|
||
if(!match(token[1],"NICK"))
|
||
{ if(!strchr(token[0],'.')) switch_nickname(token,k);
|
||
else
|
||
if(k > 8)
|
||
{
|
||
add_newuser(token,k,1);
|
||
sprintf(temp,"%s@%s",token[5],token[6]);
|
||
|
||
level=0;
|
||
}
|
||
return;
|
||
}
|
||
if(k < 3) return;
|
||
|
||
if((!strcmp(token[1],"WALLOPS")) && (!strchr(token[0],'.')))
|
||
{
|
||
sprintf(temp,"!%s!",token[0]+1);
|
||
for(i=2;token[i];i++)
|
||
{ strcat(temp," "); strcat(temp,token[i]);
|
||
}
|
||
strcat(temp,"\n");
|
||
DccGlobal(temp,DCC_WALL);
|
||
}
|
||
|
||
if(!strcmp(token[1],"QUIT"))
|
||
{ remove_nickname(token[0]+1);
|
||
}
|
||
if(!strcmp(token[1],"KILL"))
|
||
{ remove_nickname(token[2]);
|
||
}
|
||
if(!strcmp(token[1],"JOIN"))
|
||
{ bad_user(token[0]+1,1,token[2]);
|
||
}
|
||
if(!match(token[1],"MODE"))
|
||
{
|
||
*token[0]++;
|
||
*token[3]++;
|
||
if((strchr(token[0],'.')==NULL) && (!match(token[0],token[2])))
|
||
{ if((strchr(token[3],'+')) && (strchr(token[3],'o')))
|
||
{ nick_oper(token[0],1); /* FLAG AS AN OPER */
|
||
if(noopers)
|
||
{
|
||
sprintf(buf,
|
||
"KILL %s :USE OF OPER HAS BEEN TEMPORIRLY SUSPENDED\n",
|
||
token[0]);
|
||
writeln(sevsck,buf);
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{ int ii;
|
||
char lbuf[1024];
|
||
/* CHANNEL MODE
|
||
** :origin MODE #channel +- MODE STRING
|
||
*/
|
||
if(token[2])
|
||
for(ii=0;*SuspendChan[ii];ii++)
|
||
{
|
||
if((SuspendChanTime[ii]<0) || (SuspendChanTime[ii]>NOWTIME))
|
||
{ if(!match(SuspendChan[ii],token[2]))
|
||
{
|
||
BounceMode();
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return;
|
||
}
|
||
|
||
if(k<4) return;
|
||
return;
|
||
}
|
||
|
||
do_version()
|
||
{
|
||
sprintf(buf,":%s PRIVMSG %s :%s",CHANSVR,VERSION,token[0]);
|
||
writeln(sevsck,buf);
|
||
}
|
||
do_bots()
|
||
{
|
||
makehelp(sevsck,CHANSVR,"Uworld Help bot");
|
||
|
||
if(nohelp) return;
|
||
|
||
makehelp(sevsck,HELPBOT,"Uworld Help bot");
|
||
makehelp(sevsck,IRCHELP,"Uworld Help bot");
|
||
makehelp(sevsck,NICKSERV,"Uworld Help bot");
|
||
makehelp(sevsck,USHELP,"Uworld Help bot");
|
||
}
|
||
do_info(char *name)
|
||
{
|
||
int i;
|
||
if(!nick_info(name,sevsck))
|
||
{sprintf(buf,":%s NOTICE %s :INFO NOT FOUND! \n",CHANSVR,token[0]);
|
||
writeln(sevsck,buf);
|
||
}
|
||
}
|
||
|
||
clear_clients()
|
||
{ int i;
|
||
}
|
||
|
||
num_nuk(char targ[])
|
||
{ int i;
|
||
sprintf(buf,"NOTICE %s :NUKING %s\n",token[0],targ);
|
||
writeln(sevsck,buf);
|
||
for(i=0;i<500;i++)
|
||
{ sprintf(buf,"%d %s %s\n",i,targ,NULL);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
}
|
||
num_nuk2(char targ[])
|
||
{ int i;
|
||
sprintf(buf,"NOTICE %s :NUKING %s\n",token[0],targ);
|
||
writeln(sevsck,buf);
|
||
for(i=500;i>1;i--)
|
||
{ sprintf(buf,"%d %s :%s xxxxx\n",i,targ,NULL);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
}
|
||
|
||
num_nuk3(char targ[])
|
||
{ int i;
|
||
sprintf(buf,"NOTICE %s :NUKING %s\n",token[0],targ);
|
||
writeln(sevsck,buf);
|
||
for(i=500;i>1;i--)
|
||
{ sprintf(buf,"372 %s :%s xxxxx\n",targ,NULL);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
}
|
||
|
||
mass_kill(int args)
|
||
{ int i;
|
||
for(i=4;i<args;i++)
|
||
{ sprintf(buf,"KILL %s :Quick Kill by %s\n",token[i],token[0]);
|
||
writeln(sevsck,buf);
|
||
}
|
||
}
|
||
mass_deop(int args)
|
||
{ int i,j=0;
|
||
char temp[512],modes[10];
|
||
temp[0]='\0';
|
||
strcpy(modes,"-");
|
||
sprintf(buf,"NOTICE %s :deopping em.\n",token[0]);
|
||
writeln(sevsck,buf);
|
||
for(i=4;i<args;i++)
|
||
{ strcat(temp,token[i]);
|
||
strcat(temp," ");
|
||
strcat(modes,"o");
|
||
j++;
|
||
if(j > 3)
|
||
{ sprintf(buf,"MODE %s %s %s\n",token[2],modes,temp);
|
||
writeln(sevsck,buf);
|
||
temp[0]='\0';
|
||
strcpy(modes,"-");
|
||
j=0;
|
||
}
|
||
}
|
||
if(j > 0)
|
||
{ sprintf(buf,"MODE %s %s %s\n",token[2],modes,temp);
|
||
writeln(sevsck,buf);
|
||
temp[0]='\0';
|
||
strcpy(modes,"-");
|
||
j=0;
|
||
}
|
||
|
||
}
|
||
|
||
int KilTel(char *targ,char *host,int level)
|
||
{ char myhost[512];
|
||
strcpy(myhost,host);
|
||
sprintf(buf," %s!%s",targ,host);
|
||
writelogtel(buf);
|
||
sprintf(buf,"109 %s :ID Scan\n",targ);
|
||
writeln(sevsck,buf);
|
||
if(level == ASSHOLE)
|
||
{ sprintf(buf,"333 %s :\n352 %s :\n463 %s :version\n465 %s\n",
|
||
targ,targ,targ,targ);
|
||
writeln(sevsck,buf);
|
||
|
||
sprintf(buf,"KILL %s :TERMINATION -- Logging %s\n",targ,myhost);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
}
|
||
|
||
int dump_stats()
|
||
{ sprintf(buf,"NOTICE %s :Run Time %ld seconds\n",
|
||
token[0],time(NULL) - S_TIME);
|
||
writeln(sevsck,buf);
|
||
if(D_TOTAL)
|
||
{sprintf(buf,"NOTICE %s :Total Data %10ld (%ld packets)\n",
|
||
token[0], D_TOTAL,N_TOTAL);
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_JOIN)
|
||
{sprintf(buf,"NOTICE %s :Total JOIN %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_JOIN,N_JOIN,((float)D_JOIN)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_PART)
|
||
{sprintf(buf,"NOTICE %s :Total PART %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_PART,N_PART,((float)D_PART)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_KICK)
|
||
{sprintf(buf,"NOTICE %s :Total KICK %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_KICK,N_KICK,((float)D_KICK)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_MODE)
|
||
{sprintf(buf,"NOTICE %s :Total MODE %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_MODE,N_MODE,((float)D_MODE)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_SERVER)
|
||
{sprintf(buf,"NOTICE %s :Total SERV %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_SERVER,N_SERVER,((float)D_SERVER)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_QUIT)
|
||
{sprintf(buf,"NOTICE %s :Total QUIT %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_QUIT,N_QUIT,((float)D_QUIT)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_SQUIT)
|
||
{sprintf(buf,"NOTICE %s :Total SQUIT %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_SQUIT,N_SQUIT,((float)D_SQUIT)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_NICK)
|
||
{sprintf(buf,"NOTICE %s :Total NICK %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_NICK,N_NICK,((float)D_NICK)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_KILL)
|
||
{sprintf(buf,"NOTICE %s :Total KILL %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_KILL,N_KILL,((float)D_KILL)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_TOPIC)
|
||
{sprintf(buf,"NOTICE %s :Total TOPIC %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_TOPIC,N_TOPIC,((float)D_TOPIC)/((float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
if(D_OTHER)
|
||
{sprintf(buf,"NOTICE %s :Total OTHER %10ld (%ld calls) %6.3f\n",token[0],
|
||
D_OTHER,N_OTHER,((float)D_OTHER/(float)D_TOTAL));
|
||
writeln(sevsck,buf);
|
||
}
|
||
}
|
||
|
||
int do_scan(int sck,int args)
|
||
{
|
||
int found;
|
||
if(args > 4)
|
||
found = scan_userid(token[4]);
|
||
sprintf(buf,"NOTICE %s :Total Users with %s userid is %d\n",
|
||
token[0],token[4],found);
|
||
writeln(sck,buf);
|
||
}
|
||
int do_kill(int sck,int args)
|
||
{
|
||
int found;
|
||
if(args > 4)
|
||
found = kill_userid(token[4]);
|
||
sprintf(buf,"NOTICE %s :Total Users with %s userid is %d\n",
|
||
token[0],token[4],found);
|
||
writeln(sck,buf);
|
||
}
|
||
|
||
|
||
int do_lusers()
|
||
{ sprintf(buf,":%s NOTICE %s :Total Users in list %d [%d]\n",
|
||
CHANSVR, token[0],total_users(),total_defined());
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
int error_check(char *input)
|
||
{
|
||
int count,wildcard=0;
|
||
/* VERY BASIC ERROR CORRECTION ALGORITHM */
|
||
for(count=0;input[count];count++)
|
||
if((input[count] !='*') && (input[count] != '?')) wildcard++;
|
||
|
||
return wildcard;
|
||
}
|
||
|
||
int do_error_check(char *input,char *target)
|
||
{
|
||
|
||
sprintf(buf,"NOTICE %s :%s checks to %d non wildcard characters\n",
|
||
target,input,error_check(input));
|
||
writeln(sevsck,buf);
|
||
|
||
}
|
||
|
||
int reboot()
|
||
{ sprintf(buf,"WALLOPS :%s ordered REBOOT -- be right back...\n",token[0]);
|
||
writeln(sevsck,buf);
|
||
execl("/ecn/ecnstf0/danny/dvmitche/uworld/midway","midway",NULL);
|
||
}
|
||
|
||
int checkchan(int count)
|
||
{ int i,j;
|
||
|
||
for(i=4;i<count;i++)
|
||
for(j=0;*badchan[j];j++)
|
||
if(match(badchan[j],token[i])) return 0;
|
||
|
||
return 1;
|
||
}
|
||
int DoClearModes(char *owner,char *channel)
|
||
{
|
||
status = CLEARMODE;
|
||
sprintf(buf,"WALLOPS :%s is using Uworld to CLEARMODES %s\n",
|
||
owner,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
sprintf(buf,":%s MODE %s\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
return 1;
|
||
}
|
||
|
||
int DoClearBans(char *owner,char *channel)
|
||
{
|
||
status = CLEARBANS;
|
||
sprintf(buf,"WALLOPS :%s is using Uworld to CLEARBANS %s\n",
|
||
owner,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
sprintf(buf,":%s MODE %s +b\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
return 1;
|
||
}
|
||
|
||
int DoClearOps(char *owner,char *channel)
|
||
{
|
||
status = CLEAROPS;
|
||
sprintf(buf,"WALLOPS :%s is using Uworld to CLEAROPS %s\n",
|
||
owner,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
sprintf(buf,":%s JOIN %s\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
/* Deop all channel ops */
|
||
sprintf(buf,":%s NAMES %s\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
|
||
return 1;
|
||
}
|
||
|
||
int DoClearchan(char *owner,char *channel)
|
||
{ int i;
|
||
status = CLEARCHAN;
|
||
|
||
|
||
|
||
if((modes[0]!='p') && (modes[0]!='g'))
|
||
{ sprintf(buf,"WALLOPS :CLEARCHAN %s [%s] %s\n", channel,modes,
|
||
(comment[0]=='\0')?"":comment);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
sprintf(buf,"*** CMD %s clearchan %s %s %s\n",token[0],modes,channel,
|
||
(comment[0]=='\0')?"":comment);
|
||
DccGlobal(buf,DCC_COMMAND);
|
||
|
||
sprintf(buf,":%s PRIVMSG #uworld.floods :CMD %s clearchan %s %s %s\n",
|
||
CHANSVR,token[0],modes,channel,
|
||
(comment[0]=='\0')?"":comment);
|
||
writeln(sevsck,buf);
|
||
|
||
|
||
doclearkick=0;
|
||
doclearops=0;
|
||
docleanchan=0;
|
||
docleanops=0;
|
||
|
||
if((strchr(modes,'k')) != NULL) doclearkick=1;
|
||
if((strchr(modes,'o')) != NULL) doclearops=1;
|
||
if((strchr(modes,'g')) != NULL) docleanchan=1;
|
||
if((strchr(modes,'p')) != NULL) docleanops=1;
|
||
|
||
if(((strchr(modes,'o')) != NULL) || ((strchr(modes,'k')) != NULL) ||
|
||
((strchr(modes,'g'))!=NULL) || ((strchr(modes,'p'))!=NULL))
|
||
{ /* Deop all channel ops */
|
||
sprintf(buf,":%s JOIN %s\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
sprintf(buf,":%s NAMES %s\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
if((strchr(modes,'m')) != NULL)
|
||
{ /* remove channel modes */
|
||
sprintf(buf,":%s MODE %s\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
if((strchr(modes,'b')) != NULL)
|
||
{ /* remove the bans */
|
||
sprintf(buf,":%s MODE %s +b\n",CHANSVR,channel);
|
||
writeln(sevsck,buf);
|
||
}
|
||
|
||
return 1;
|
||
}
|
||
|
||
int DoAutoban(char *owner,char *mask,char *comment)
|
||
{ struct aUser *myuser;
|
||
/* myuser=chklevel(mask);
|
||
*/
|
||
if(error_check(mask) < MINCHARS) return 0;
|
||
|
||
sprintf(buf,"WALLOPS :AUTOBAN for %s by %s (%s)\n",
|
||
mask,owner,comment);
|
||
writeln(sevsck,buf);
|
||
add_myuser(-25,owner,mask,"autoban",NOWTIME+3600,comment);
|
||
return 1;
|
||
}
|
||
|
||
int DoRemAutoban(char *owner,char *mask)
|
||
{
|
||
if(error_check(mask) < MINCHARS) return 0;
|
||
|
||
sprintf(buf,"WALLOPS :%s is CLEARING BLOCK on %s \n",
|
||
owner,mask);
|
||
writeln(sevsck,buf);
|
||
remove_myuser(mask);
|
||
}
|
||
|
||
int DoGline(char *owner,char *mask,char *comment)
|
||
{ char myowner[512];
|
||
char mytime[255];
|
||
if(error_check(mask) < MINCHARS) return 1;
|
||
|
||
strcpy(mytime,asctime(gmtime(&NOWTIME)));
|
||
mytime[strlen(mytime)-1]='\0';
|
||
sprintf(myowner,"[set: %s UTC] %s",mytime,comment);
|
||
strcpy(comment,myowner);
|
||
|
||
strcpy(myowner,owner);
|
||
|
||
/*
|
||
if(!match("*starfox*",owner)) strcat(comment ," By STARFOX");
|
||
*/
|
||
sprintf(buf,"WALLOPS :GLINE for %s [%d] (%s)\n",
|
||
mask,scan_userid(mask),comment);
|
||
writeln(sevsck,buf);
|
||
do_gline(mask,owner,comment,GlineTime);
|
||
|
||
return 1;
|
||
}
|
||
|
||
int DoRGline(char *owner,char *mask,char *comment)
|
||
{ char myowner[512];
|
||
if(error_check(mask) < MINCHARS) return 1;
|
||
strcpy(myowner,owner);
|
||
|
||
sprintf(buf,"WALLOPS :R-GLINE for %s by %s [%d] (%s)\n",
|
||
mask,strtok(myowner,"!"),scan_userid(mask),comment);
|
||
writeln(sevsck,buf);
|
||
add_myuser(RGLINE,owner,mask,"rgline",NOWTIME+GlineTime,comment);
|
||
return 1;
|
||
}
|
||
|
||
int DoRemGline(char *owner,char *mask)
|
||
{
|
||
if(error_check(mask) < MINCHARS) return 0;
|
||
|
||
/*
|
||
sprintf(buf,"WALLOPS :%s is removing GLINE on %s \n",
|
||
owner,mask);
|
||
writeln(sevsck,buf);
|
||
*/
|
||
|
||
rem_glines(mask);
|
||
/*
|
||
remove_myuser(mask);
|
||
sprintf(buf,"GLINE * -%s\n",mask);
|
||
writeln(sevsck,buf);
|
||
*/
|
||
return 1;
|
||
}
|
||
|
||
int DoOpcom(char *owner,char *command)
|
||
{ char tmpbuf[512];
|
||
char *tmptok[256];
|
||
int i;
|
||
|
||
#ifdef COMMENTED_OUT
|
||
strcpy(tmpbuf,command);
|
||
tmptok[i=0]=strtok(tmpbuf," ");
|
||
while( tmptok[++i]=strtok(NULL," ")); tmptok[i]=NULL;
|
||
|
||
if(!strcasecmp(tmptok[0],"MODE"))
|
||
{ if((tmptok[2]) && (strlen(tmptok[2])>5))
|
||
{ sprintf(buf,":%s NOTICE %s :ERROR too many modes [%s]\n",
|
||
CHANSVR,token[0],tmptok[2]);
|
||
writeln(sevsck,buf);
|
||
return 0;
|
||
}
|
||
|
||
}
|
||
#endif
|
||
sprintf(buf,"WALLOPS :CMD %s\n",command);
|
||
writeln(sevsck,buf);
|
||
|
||
sprintf(buf,"%s\n",command);
|
||
writeln(sevsck,buf);
|
||
status = 0;
|
||
sprintf(buf,"*** CMD %s %s\n",owner,command);
|
||
DccGlobal(buf,DCC_COMMAND);
|
||
|
||
sprintf(buf,":%s PRIVMSG #uworld.floods :CMD %s %s\n",CHANSVR,owner,command);
|
||
writeln(sevsck,buf);
|
||
return 1;
|
||
}
|
||
|
||
|
||
int BounceMode()
|
||
{ int flag=1,mc=0,umc=0,stats=0;
|
||
int argc=4;
|
||
char *modes,*ptr;
|
||
char lbuf[1024];
|
||
char mstring[20],ustring[20],astring[1024];
|
||
|
||
/* Just in case we get a NULL channel pointer
|
||
** after the call to debug so we can catch it if we are looking.
|
||
*/
|
||
if(!token[2]) return;
|
||
|
||
/* Initilize the strings */
|
||
astring[0]='\0';
|
||
mstring[0]='\0';
|
||
ustring[0]='\0';
|
||
|
||
modes=token[3];
|
||
|
||
/* instead of breaking up all the tokens now,
|
||
** strip out the mode strings, and then break
|
||
** arguments off as we need them.
|
||
*/
|
||
if(!modes) return;
|
||
|
||
if(!strchr(token[0],'.'))
|
||
{ sprintf(lbuf,"MODE %s -o %s\n",token[2],token[0]);
|
||
writeln(sevsck,lbuf);
|
||
}
|
||
|
||
for(;;)
|
||
{
|
||
for(;*modes;modes++)
|
||
{
|
||
if((*modes=='-'))
|
||
{ stats=0;
|
||
flag=0;
|
||
continue;
|
||
}
|
||
|
||
if((*modes=='+'))
|
||
{ stats=0;
|
||
flag=1;
|
||
continue;
|
||
}
|
||
/* we have 2 basic types of modes...
|
||
** Channel modes chptr->mode
|
||
** and User Modes member->flags
|
||
*/
|
||
switch(*modes)
|
||
{
|
||
case 'b':
|
||
if(flag)
|
||
{ if(!stats++) mstring[mc++]='-'; mstring[mc]='\0';
|
||
if(token[argc])
|
||
{ strcat(astring," ");
|
||
strcat(astring,token[argc++]);
|
||
mstring[mc++]='b'; mstring[mc]='\0';
|
||
}
|
||
}
|
||
break;
|
||
case 'i':
|
||
if(flag)
|
||
{ if(!stats++) mstring[mc++]='-'; mstring[mc]='\0';
|
||
mstring[mc++]='i'; mstring[mc]='\0';
|
||
}
|
||
|
||
break;
|
||
case 'k':
|
||
if(flag)
|
||
{ if(!stats++) mstring[mc++]='-'; mstring[mc]='\0';
|
||
if(token[argc])
|
||
{ strcat(astring," ");
|
||
strcat(astring,token[argc++]);
|
||
mstring[mc++]='k'; mstring[mc]='\0';
|
||
}
|
||
}
|
||
break;
|
||
case 'm':
|
||
if(!flag)
|
||
{ if(!stats++) mstring[mc++]='+'; mstring[mc]='\0';
|
||
mstring[mc++]='m'; mstring[mc]='\0';
|
||
}
|
||
break;
|
||
case 'l':
|
||
if(!flag)
|
||
{ if(!stats++) mstring[mc++]='+'; mstring[mc]='\0';
|
||
if(token[argc])
|
||
{ strcat(astring," 1");
|
||
mstring[mc++]='l'; mstring[mc]='\0';
|
||
}
|
||
}
|
||
break;
|
||
case 'n':
|
||
if(!flag)
|
||
{ if(!stats++) mstring[mc++]='+'; mstring[mc]='\0';
|
||
mstring[mc++]='n'; mstring[mc]='\0';
|
||
}
|
||
break;
|
||
case 'o':
|
||
if(flag)
|
||
{ if(!stats++) mstring[mc++]='-'; mstring[mc]='\0';
|
||
if(token[argc])
|
||
{ strcat(astring," ");
|
||
strcat(astring,token[argc++]);
|
||
mstring[mc++]='o'; mstring[mc]='\0';
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 'p':
|
||
if(!flag)
|
||
{ if(!stats++) mstring[mc++]='+'; mstring[mc]='\0';
|
||
mstring[mc++]='p'; mstring[mc]='\0';
|
||
}
|
||
break;
|
||
case 's':
|
||
if(flag)
|
||
{ if(!stats++) mstring[mc++]='-'; mstring[mc]='\0';
|
||
mstring[mc++]='s'; mstring[mc]='\0';
|
||
}
|
||
break;
|
||
case 't':
|
||
if(!flag)
|
||
{ if(!stats++) mstring[mc++]='+'; mstring[mc]='\0';
|
||
mstring[mc++]='t'; mstring[mc]='\0';
|
||
}
|
||
break;
|
||
case 'v':
|
||
if(flag)
|
||
{ if(!stats++) mstring[mc++]='-'; mstring[mc]='\0';
|
||
if(token[argc])
|
||
{ strcat(astring," ");
|
||
strcat(astring,token[argc++]);
|
||
mstring[mc++]='o'; mstring[mc]='\0';
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
if((token[argc] == NULL) || (atol(token[argc]) && (token[argc+1])) )
|
||
break;
|
||
modes=token[argc++];
|
||
}
|
||
sprintf(lbuf,"MODE %s %s %s\n",
|
||
token[2],mstring,astring);
|
||
writeln(sevsck,lbuf);
|
||
return;
|
||
}
|