extern time_t TIME;
-extern std::vector<int> fd_reap;
extern std::vector<std::string> module_names;
extern char MyExecutable[1024];
WriteServ(user->fd,"462 %s :You may not reregister",user->nick);
return;
}
+ strlcpy(user->password,parameters[0],MAXBUF);
if (!strcasecmp(parameters[0],Passwd(user)))
{
user->haspassed = true;
AddWhoWas(user);
}
+ FOREACH_MOD OnUserDisconnect(user);
+
/* push the socket on a stack of sockets due to be closed at the next opportunity */
- fd_reap.push_back(user->fd);
+ if (user->fd > -1)
+ {
+ shutdown(user->fd,2);
+ close(user->fd);
+ }
if (iter != clientlist.end())
{
char Link_Pass[1024];
int LinkPort;
bool found = false;
-
+
for (int i = 0; i < ConfValueEnum("link",&config_f); i++)
{
if (!found)
}
return false;
}
-
+int operstrcmp(char* data,char* input)
+{
+ int MOD_RESULT = 0;
+ FOREACH_RESULT(OnOperCompare(data,input))
+ if (MOD_RESULT == 1)
+ return 0;
+ if (MOD_RESULT == -1)
+ return 1;
+ return strcmp(data,input);
+}
void handle_oper(char **parameters, int pcnt, userrec *user)
{
ConfValue("oper","password",i,Password,&config_f);
ConfValue("oper","type",i,OperType,&config_f);
ConfValue("oper","host",i,HostName,&config_f);
- if ((!strcmp(LoginName,parameters[0])) && (!strcmp(Password,parameters[1])) && (match(TheHost,HostName)))
+ if ((!strcmp(LoginName,parameters[0])) && (!operstrcmp(Password,parameters[1])) && (match(TheHost,HostName)))
{
fail2 = true;
for (j =0; j < ConfValueEnum("type",&config_f); j++)
char* nick = NULL;
char* channel = NULL;
char* reason = NULL;
- if (strchr(params,':'))
- {
- nick = strtok(params," ");
- channel = strtok(NULL," :");
- reason = strtok(NULL,"\r\n");
- reason++;
- }
- else
+ log(DEBUG,"L TOKEN PARS: '%s'",params);
+ if (strstr(params,":#"))
{
nick = strtok(params," ");
channel = strtok(NULL,"\r\n");
+ channel++;
reason = "";
}
+ else
+ {
+ nick = strtok(params," ");
+ channel = strtok(NULL," :");
+ reason = strtok(NULL,"\r\n");
+ reason++;
+ }
userrec* user = Find(nick);
if ((user) && (channel) && (reason))
{
- if (strcmp(reason,""))
+ if ((!reason) && (*reason != '\0'))
{
del_channel(user,channel,reason,true);
}
}
char response[10240];
+ char old2[MAXBUF];
char token = udp_msg[0];
char* old = udp_msg;
+ if ((token != ':') && (strlen(udp_msg)>1) && (udp_msg[1] != ' '))
+ {
+ WriteOpers("*** Discarded %d chars illegal data from %s",strlen(udp_msg),tcp_host);
+ }
+
if (token == ':') // leading :servername or details - strip them off (services does this, sucky)
{
char* src = udp_msg+1;
}
-
char* params = udp_msg + 2;
char finalparam[1024];
strcpy(finalparam," :xxxx");
char Link_Pass[1024];
char Link_SendPass[1024];
int LinkPort = 0;
-
+
// search for a corresponding <link> block in the config files
for (int i = 0; i < ConfValueEnum("link",&config_f); i++)
{
int LinkPort = 0;
log(DEBUG,"U-token linked server detected.");
+
+
+ for (int j = 0; j < 32; j++)
+ {
+ if (me[j] != NULL)
+ {
+ for (int k = 0; k < me[j]->connectors.size(); k++)
+ {
+ if (!strcasecmp(me[j]->connectors[k].GetServerName().c_str(),servername))
+ {
+ char buffer[MAXBUF];
+ sprintf(buffer,"E :Access is denied (Server exists in the mesh)");
+ serv->SendPacket(buffer,tcp_host);
+ WriteOpers("CONNECT from %s denied, \"%s\" already exists!",tcp_host,servername);
+ RemoveServer(tcp_host);
+ return;
+ }
+ }
+ }
+ }
// search for a corresponding <link> block in the config files
for (int i = 0; i < ConfValueEnum("link",&config_f); i++)