1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #include "inspircd_config.h"
18 #include "configreader.h"
20 #include "connection.h"
24 #include "inspstring.h"
26 #include "helperfuncs.h"
28 #include "socketengine.h"
33 #include "cull_list.h"
35 extern InspIRCd* ServerInstance;
36 extern int WHOWAS_STALE;
37 extern int WHOWAS_MAX;
38 extern std::vector<Module*> modules;
39 extern std::vector<ircd_module*> factory;
40 extern std::vector<InspSocket*> module_sockets;
42 extern InspSocket* socket_ref[MAX_DESCRIPTORS];
44 extern userrec* fd_ref_table[MAX_DESCRIPTORS];
45 extern ServerConfig *Config;
46 extern user_hash clientlist;
47 extern Server* MyServer;
51 extern std::vector<userrec*> local_users;
53 std::vector<userrec*> all_opers;
55 typedef std::map<irc::string,char*> opertype_t;
56 typedef opertype_t operclass_t;
59 operclass_t operclass;
61 bool InitTypes(const char* tag)
63 for (opertype_t::iterator n = opertypes.begin(); n != opertypes.end(); n++)
73 bool InitClasses(const char* tag)
75 for (operclass_t::iterator n = operclass.begin(); n != operclass.end(); n++)
85 bool DoType(const char* tag, char** entries, void** values, int* types)
87 char* TypeName = (char*)values[0];
88 char* Classes = (char*)values[1];
90 opertypes[TypeName] = strdup(Classes);
91 log(DEBUG,"Read oper TYPE '%s' with classes '%s'",TypeName,Classes);
95 bool DoClass(const char* tag, char** entries, void** values, int* types)
97 char* ClassName = (char*)values[0];
98 char* CommandList = (char*)values[1];
100 operclass[ClassName] = strdup(CommandList);
101 log(DEBUG,"Read oper CLASS '%s' with commands '%s'",ClassName,CommandList);
105 bool DoneClassesAndTypes(const char* tag)
110 bool userrec::ProcessNoticeMasks(const char *sm)
126 if ((*c >= 'A') && (*c <= 'z'))
127 this->SetNoticeMask(*c, adding);
137 void userrec::StartDNSLookup()
139 log(DEBUG,"Commencing reverse lookup");
140 res_reverse = new UserResolver(this, insp_ntoa(this->ip4), false);
141 MyServer->AddResolver(res_reverse);
144 UserResolver::UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward), bound_user(user)
146 this->bound_fd = user->fd;
149 void UserResolver::OnLookupComplete(const std::string &result)
151 if ((!this->fwd) && (fd_ref_table[this->bound_fd] == this->bound_user))
153 log(DEBUG,"Commencing forward lookup");
154 this->bound_user->stored_host = result;
155 bound_user->res_forward = new UserResolver(this->bound_user, result, true);
156 MyServer->AddResolver(bound_user->res_forward);
158 else if ((this->fwd) && (fd_ref_table[this->bound_fd] == this->bound_user))
160 /* Both lookups completed */
161 if (insp_ntoa(this->bound_user->ip4) == result)
163 std::string hostname = this->bound_user->stored_host;
164 if (hostname.length() < 65)
166 WriteServ(this->bound_fd, "NOTICE Auth :*** Found your hostname (%s)", this->bound_user->stored_host.c_str());
167 this->bound_user->dns_done = true;
168 strlcpy(this->bound_user->dhost, hostname.c_str(),64);
169 strlcpy(this->bound_user->host, hostname.c_str(),64);
173 WriteServ(this->bound_fd, "NOTICE Auth :*** Your hostname is longer than the maximum of 64 characters, using your IP address (%s) instead.", insp_ntoa(this->bound_user->ip4));
178 WriteServ(this->bound_fd, "NOTICE Auth :*** Your hostname does not match up with your IP address. Sorry, using your IP address (%s) instead.", insp_ntoa(this->bound_user->ip4));
183 void UserResolver::OnError(ResolverError e)
185 if (fd_ref_table[this->bound_fd] == this->bound_user)
187 /* Error message here */
188 WriteServ(this->bound_fd, "NOTICE Auth :*** Could not resolve your hostname, using your IP address (%s) instead.", insp_ntoa(this->bound_user->ip4));
189 this->bound_user->dns_done = true;
194 bool userrec::IsNoticeMaskSet(unsigned char sm)
196 return (snomasks[sm-65]);
199 void userrec::SetNoticeMask(unsigned char sm, bool value)
201 snomasks[sm-65] = value;
204 const char* userrec::FormatNoticeMasks()
206 static char data[MAXBUF];
209 for (int n = 0; n < 64; n++)
212 data[offset++] = n+65;
221 bool userrec::IsModeSet(unsigned char m)
223 return (modes[m-65]);
226 void userrec::SetMode(unsigned char m, bool value)
231 const char* userrec::FormatModes()
233 static char data[MAXBUF];
235 for (int n = 0; n < 64; n++)
238 data[offset++] = n+65;
246 // the PROPER way to do it, AVOID bzero at *ALL* costs
247 *password = *nick = *ident = *host = *dhost = *fullname = *awaymsg = *oper = 0;
248 server = (char*)FindServerNamePtr(Config->ServerName);
250 lines_in = fd = lastping = signon = idle_lastmsg = nping = registered = 0;
251 timeout = flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
252 haspassed = dns_done = false;
255 res_forward = res_reverse = NULL;
258 chans.resize(MAXCHANS);
259 memset(modes,0,sizeof(modes));
261 for (unsigned int n = 0; n < MAXCHANS; n++)
263 ucrec* x = new ucrec();
272 for (std::vector<ucrec*>::iterator n = chans.begin(); n != chans.end(); n++)
274 ucrec* x = (ucrec*)*n;
279 /* XXX - minor point, other *Host functions return a char *, this one creates it. Might be nice to be consistant? */
280 void userrec::MakeHost(char* nhost)
282 /* This is much faster than snprintf */
284 for(char* n = ident; *n; n++)
287 for(char* n = host; *n; n++)
292 void userrec::CloseSocket()
294 shutdown(this->fd,2);
298 char* userrec::GetFullHost()
300 static char result[MAXBUF];
302 for(char* n = nick; *n; n++)
305 for(char* n = ident; *n; n++)
308 for(char* n = dhost; *n; n++)
314 char* userrec::MakeWildHost()
316 static char nresult[MAXBUF];
318 *t++ = '*'; *t++ = '!';
319 *t++ = '*'; *t++ = '@';
320 for(char* n = dhost; *n; n++)
326 int userrec::ReadData(void* buffer, size_t size)
330 return read(this->fd, buffer, size);
337 char* userrec::GetFullRealHost()
339 static char fresult[MAXBUF];
341 for(char* n = nick; *n; n++)
344 for(char* n = ident; *n; n++)
347 for(char* n = host; *n; n++)
353 bool userrec::IsInvited(irc::string &channel)
355 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
357 irc::string compare = i->channel;
359 if (compare == channel)
367 InvitedList* userrec::GetInviteList()
372 void userrec::InviteTo(irc::string &channel)
376 invites.push_back(i);
379 void userrec::RemoveInvite(irc::string &channel)
381 log(DEBUG,"Removing invites");
385 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
387 irc::string compare = i->channel;
389 if (compare == channel)
398 bool userrec::HasPermission(const std::string &command)
405 * users on remote servers can completely bypass all permissions based checks.
406 * This prevents desyncs when one server has different type/class tags to another.
407 * That having been said, this does open things up to the possibility of source changes
408 * allowing remote kills, etc - but if they have access to the src, they most likely have
409 * access to the conf - so it's an end to a means either way.
414 // are they even an oper at all?
417 opertype_t::iterator iter_opertype = opertypes.find(this->oper);
418 if (iter_opertype != opertypes.end())
420 char* Classes = strdup(iter_opertype->second);
421 char* myclass = strtok_r(Classes," ",&savept);
424 operclass_t::iterator iter_operclass = operclass.find(myclass);
425 if (iter_operclass != operclass.end())
427 char* CommandList = strdup(iter_operclass->second);
428 mycmd = strtok_r(CommandList," ",&savept2);
431 if ((!strcasecmp(mycmd,command.c_str())) || (*mycmd == '*'))
437 mycmd = strtok_r(NULL," ",&savept2);
441 myclass = strtok_r(NULL," ",&savept);
450 bool userrec::AddBuffer(const std::string &a)
454 /* NB: std::string is arsey about \r and \n and tries to translate them
455 * somehow, so we CANNOT use std::string::find() here :(
457 for (std::string::const_iterator i = a.begin(); i != a.end(); i++)
466 if (recvq.length() > (unsigned)this->recvqmax)
468 this->SetWriteError("RecvQ exceeded");
469 WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->recvqmax);
476 bool userrec::BufferIsReady()
478 return (recvq.find('\n') != std::string::npos);
481 void userrec::ClearBuffer()
486 std::string userrec::GetBuffer()
491 /* Strip any leading \r or \n off the string.
492 * Usually there are only one or two of these,
493 * so its is computationally cheap to do.
495 while ((*recvq.begin() == '\r') || (*recvq.begin() == '\n'))
496 recvq.erase(recvq.begin());
498 for (std::string::iterator x = recvq.begin(); x != recvq.end(); x++)
500 /* Find the first complete line, return it as the
501 * result, and leave the recvq as whats left
505 std::string ret = std::string(recvq.begin(), x);
506 recvq.erase(recvq.begin(), x + 1);
513 void userrec::AddWriteBuf(const std::string &data)
515 if (*this->GetWriteError())
518 if (sendq.length() + data.length() > (unsigned)this->sendqmax)
521 * Fix by brain - Set the error text BEFORE calling writeopers, because
522 * if we dont it'll recursively call here over and over again trying
523 * to repeatedly add the text to the sendq!
525 this->SetWriteError("SendQ exceeded");
526 WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax);
530 if (data.length() > 512)
532 std::string newdata(data);
534 newdata.append("\r\n");
535 sendq.append(newdata);
543 // send AS MUCH OF THE USERS SENDQ as we are able to (might not be all of it)
544 void userrec::FlushWriteBuf()
546 if ((sendq.length()) && (this->fd != FD_MAGIC_NUMBER))
548 const char* tb = this->sendq.c_str();
549 int n_sent = write(this->fd,tb,this->sendq.length());
553 this->SetWriteError(strerror(errno));
560 // update the user's stats counters
561 this->bytes_out += n_sent;
567 void userrec::SetWriteError(const std::string &error)
569 // don't try to set the error twice, its already set take the first string.
570 if (!this->WriteError.length())
572 log(DEBUG,"Setting error string for %s to '%s'",this->nick,error.c_str());
573 this->WriteError = error;
577 const char* userrec::GetWriteError()
579 return this->WriteError.c_str();
582 void AddOper(userrec* user)
584 log(DEBUG,"Oper added to optimization list");
585 all_opers.push_back(user);
588 void DeleteOper(userrec* user)
590 for (std::vector<userrec*>::iterator a = all_opers.begin(); a < all_opers.end(); a++)
594 log(DEBUG,"Oper removed from optimization list");
601 void kill_link(userrec *user,const char* r)
603 user_hash::iterator iter = clientlist.find(user->nick);
606 * I'm pretty sure returning here is causing a desync when part of the net thinks a user is gone,
607 * and another part doesn't. We want to broadcast the quit/kill before bailing so the net stays in sync.
609 * I can't imagine this blowing up, so I'm commenting it out. We still check
610 * before playing with a bad iterator below in our if(). DISCUSS THIS BEFORE YOU DO ANYTHING. --w00t
612 * if (iter == clientlist.end())
618 strlcpy(reason,r,MAXQUIT-1);
619 log(DEBUG,"kill_link: %s %d '%s'",user->nick,user->fd,reason);
622 Write(user->fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason);
624 if (user->registered == REG_ALL)
626 purge_empty_chans(user);
627 FOREACH_MOD(I_OnUserQuit,OnUserQuit(user,reason));
628 WriteCommonExcept(user,"QUIT :%s",reason);
632 user->FlushWriteBuf();
634 FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(user));
638 if (Config->GetIOHook(user->port))
642 Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
644 catch (ModuleException& modexcept)
646 log(DEBUG,"Module exception cought: %s",modexcept.GetReason());
650 ServerInstance->SE->DelFd(user->fd);
655 * this must come before the WriteOpers so that it doesnt try to fill their buffer with anything
656 * if they were an oper with +s.
659 * In the current implementation, we only show local quits, as we only show local connects. With
660 * the proposed implmentation of snomasks however, this will likely change in the (near?) future.
662 if (user->registered == REG_ALL)
665 WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason);
669 if (iter != clientlist.end())
671 log(DEBUG,"deleting user hash value %lx",(unsigned long)user);
674 fd_ref_table[user->fd] = NULL;
675 if (find(local_users.begin(),local_users.end(),user) != local_users.end())
677 local_users.erase(find(local_users.begin(),local_users.end(),user));
678 log(DEBUG,"Delete local user");
681 clientlist.erase(iter);
686 WhoWasGroup::WhoWasGroup(userrec* user) : host(NULL), dhost(NULL), ident(NULL), server(NULL), gecos(NULL), signon(user->signon)
688 this->host = strdup(user->host);
689 this->dhost = strdup(user->dhost);
690 this->ident = strdup(user->ident);
691 this->server = user->server;
692 this->gecos = strdup(user->fullname);
695 WhoWasGroup::~WhoWasGroup()
707 /* adds or updates an entry in the whowas list */
708 void AddWhoWas(userrec* u)
710 whowas_users::iterator iter = whowas.find(u->nick);
712 if (iter == whowas.end())
714 whowas_set* n = new whowas_set;
715 WhoWasGroup *a = new WhoWasGroup(u);
721 whowas_set* group = (whowas_set*)iter->second;
723 if (group->size() > 10)
725 WhoWasGroup *a = (WhoWasGroup*)*(group->begin());
730 WhoWasGroup *a = new WhoWasGroup(u);
735 /* every hour, run this function which removes all entries over 3 days */
736 void MaintainWhoWas(time_t TIME)
738 for (whowas_users::iterator iter = whowas.begin(); iter != whowas.end(); iter++)
740 whowas_set* n = (whowas_set*)iter->second;
743 while ((n->begin() != n->end()) && ((*n->begin())->signon < TIME - 259200)) // 3 days
745 WhoWasGroup *a = *(n->begin());
747 n->erase(n->begin());
753 /* add a client connection to the sockets list */
754 void AddClient(int socket, int port, bool iscached, insp_inaddr ip4)
756 std::string tempnick = ConvToStr(socket) + "-unknown";
757 user_hash::iterator iter = clientlist.find(tempnick);
758 const char *ipaddr = insp_ntoa(ip4);
764 * as these nicknames are 'RFC impossible', we can be sure nobody is going to be
765 * using one as a registered connection. As they are per fd, we can also safely assume
766 * that we wont have collisions. Therefore, if the nick exists in the list, its only
767 * used by a dead socket, erase the iterator so that the new client may reclaim it.
768 * this was probably the cause of 'server ignores me when i hammer it with reconnects'
769 * issue in earlier alphas/betas
771 if (iter != clientlist.end())
773 userrec* goner = iter->second;
775 clientlist.erase(iter);
778 log(DEBUG,"AddClient: %d %d %s",socket,port,ipaddr);
780 _new = new userrec();
781 clientlist[tempnick] = _new;
783 strlcpy(_new->nick,tempnick.c_str(),NICKMAX-1);
785 /* Smarter than your average bear^H^H^H^Hset of strlcpys. */
786 for (const char* temp = ipaddr; *temp && j < 64; temp++, j++)
787 _new->dhost[j] = _new->host[j] = *temp;
788 _new->dhost[j] = _new->host[j] = 0;
790 _new->server = FindServerNamePtr(Config->ServerName);
791 /* We don't need range checking here, we KNOW 'unknown\0' will fit into the ident field. */
792 strcpy(_new->ident, "unknown");
794 _new->registered = REG_NONE;
795 _new->signon = TIME + Config->dns_timeout;
800 // set the registration timeout for this user
801 unsigned long class_regtimeout = 90;
803 long class_threshold = 5;
804 long class_sqmax = 262144; // 256kb
805 long class_rqmax = 4096; // 4k
807 for (ClassVector::iterator i = Config->Classes.begin(); i != Config->Classes.end(); i++)
809 if ((i->type == CC_ALLOW) && (match(ipaddr,i->host.c_str())))
811 class_regtimeout = (unsigned long)i->registration_timeout;
812 class_flood = i->flood;
813 _new->pingmax = i->pingtime;
814 class_threshold = i->threshold;
815 class_sqmax = i->sendqmax;
816 class_rqmax = i->recvqmax;
821 _new->nping = TIME + _new->pingmax + Config->dns_timeout;
822 _new->timeout = TIME+class_regtimeout;
823 _new->flood = class_flood;
824 _new->threshold = class_threshold;
825 _new->sendqmax = class_sqmax;
826 _new->recvqmax = class_rqmax;
828 fd_ref_table[socket] = _new;
829 local_users.push_back(_new);
831 if (local_users.size() > Config->SoftLimit)
833 kill_link(_new,"No more connections allowed");
837 if (local_users.size() >= MAXCLIENTS)
839 kill_link(_new,"No more connections allowed");
845 * this is done as a safety check to keep the file descriptors within range of fd_ref_table.
846 * its a pretty big but for the moment valid assumption:
847 * file descriptors are handed out starting at 0, and are recycled as theyre freed.
848 * therefore if there is ever an fd over 65535, 65536 clients must be connected to the
849 * irc server at once (or the irc server otherwise initiating this many connections, files etc)
850 * which for the time being is a physical impossibility (even the largest networks dont have more
851 * than about 10,000 users on ONE server!)
853 if ((unsigned)socket >= MAX_DESCRIPTORS)
855 kill_link(_new,"Server is full");
858 char* e = matches_exception(ipaddr);
861 char* r = matches_zline(ipaddr);
865 snprintf(reason,MAXBUF,"Z-Lined: %s",r);
866 kill_link(_new,reason);
873 ServerInstance->SE->AddFd(socket,true,X_ESTAB_CLIENT);
876 WriteServ(_new->fd,"NOTICE Auth :*** Looking up your hostname...");
879 long FindMatchingGlobal(userrec* user)
882 for (user_hash::const_iterator a = clientlist.begin(); a != clientlist.end(); a++)
885 /* I dont think theres any faster way of matching two ipv6 addresses than memcmp
886 * Let me know if you think of one.
888 if (!memcmp(a->second->ip4.s6_addr, user->ip4.s6_addr, sizeof(in6_addr)))
891 if (a->second->ip4.s_addr == user->ip4.s_addr)
898 long FindMatchingLocal(userrec* user)
901 for (std::vector<userrec*>::const_iterator a = local_users.begin(); a != local_users.end(); a++)
905 /* I dont think theres any faster way of matching two ipv6 addresses than memcmp */
906 if (!memcmp(comp->ip4.s6_addr, user->ip4.s6_addr, sizeof(in6_addr)))
909 if (comp->ip4.s_addr == user->ip4.s_addr)
916 void FullConnectUser(userrec* user, CullList* Goners)
918 ServerInstance->stats->statsConnects++;
919 user->idle_lastmsg = TIME;
920 log(DEBUG,"ConnectUser: %s",user->nick);
922 ConnectClass a = GetClass(user);
924 if (a.type == CC_DENY)
926 Goners->AddItem(user,"Unauthorised connection");
930 if ((*(a.pass.c_str())) && (!user->haspassed))
932 Goners->AddItem(user,"Invalid password");
936 if (FindMatchingLocal(user) > a.maxlocal)
938 Goners->AddItem(user,"No more connections allowed from your host via this connect class (local)");
939 WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s",a.maxlocal,insp_ntoa(user->ip4));
942 else if (FindMatchingGlobal(user) > a.maxglobal)
944 Goners->AddItem(user,"No more connections allowed from your host via this connect class (global)");
945 WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s",a.maxglobal,insp_ntoa(user->ip4));
949 char match_against[MAXBUF];
950 snprintf(match_against,MAXBUF,"%s@%s",user->ident,user->host);
951 char* e = matches_exception(match_against);
955 char* r = matches_gline(match_against);
960 snprintf(reason,MAXBUF,"G-Lined: %s",r);
961 Goners->AddItem(user,reason);
965 r = matches_kline(match_against);
970 snprintf(reason,MAXBUF,"K-Lined: %s",r);
971 Goners->AddItem(user,reason);
977 WriteServ(user->fd,"NOTICE Auth :Welcome to \002%s\002!",Config->Network);
978 WriteServ(user->fd,"001 %s :Welcome to the %s IRC Network %s!%s@%s",user->nick,Config->Network,user->nick,user->ident,user->host);
979 WriteServ(user->fd,"002 %s :Your host is %s, running version %s",user->nick,Config->ServerName,VERSION);
980 WriteServ(user->fd,"003 %s :This server was created %s %s",user->nick,__TIME__,__DATE__);
981 WriteServ(user->fd,"004 %s %s %s iowghrasxRVSCWBG lvhopsmntikrcaqbegIOLQRSKVHGCNT vhobeIaqglk",user->nick,Config->ServerName,VERSION);
983 // anfl @ #ratbox, efnet reminded me that according to the RFC this cant contain more than 13 tokens per line...
984 // so i'd better split it :)
985 std::stringstream out(Config->data005);
986 std::string token = "";
987 std::string line5 = "";
988 int token_counter = 0;
993 line5 = line5 + token + " ";
996 if ((token_counter >= 13) || (out.eof() == true))
998 WriteServ(user->fd,"005 %s %s:are supported by this server",user->nick,line5.c_str());
1007 * fix 3 by brain, move registered = 7 below these so that spurious modes and host
1008 * changes dont go out onto the network and produce 'fake direction'.
1010 FOREACH_MOD(I_OnUserConnect,OnUserConnect(user));
1011 FOREACH_MOD(I_OnGlobalConnect,OnGlobalConnect(user));
1012 user->registered = REG_ALL;
1013 WriteOpers("*** Client connecting on port %lu: %s!%s@%s [%s]",(unsigned long)user->port,user->nick,user->ident,user->host,insp_ntoa(user->ip4));
1017 * re-allocates a nick in the user_hash after they change nicknames,
1018 * returns a pointer to the new user as it may have moved
1020 userrec* ReHashNick(const char* Old, const char* New)
1022 //user_hash::iterator newnick;
1023 user_hash::iterator oldnick = clientlist.find(Old);
1025 log(DEBUG,"ReHashNick: %s %s",Old,New);
1027 if (!strcasecmp(Old,New))
1029 log(DEBUG,"old nick is new nick, skipping");
1030 return oldnick->second;
1033 if (oldnick == clientlist.end())
1034 return NULL; /* doesnt exist */
1036 log(DEBUG,"ReHashNick: Found hashed nick %s",Old);
1038 userrec* olduser = oldnick->second;
1039 clientlist[New] = olduser;
1040 clientlist.erase(oldnick);
1042 log(DEBUG,"ReHashNick: Nick rehashed as %s",New);
1044 return clientlist[New];
1047 void force_nickchange(userrec* user,const char* newnick)
1054 FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(user,newnick));
1058 ServerInstance->stats->statsCollisions++;
1059 kill_link(user,"Nickname collision");
1063 if (matches_qline(newnick))
1065 ServerInstance->stats->statsCollisions++;
1066 kill_link(user,"Nickname collision");
1074 strlcpy(nick,newnick,MAXBUF-1);
1077 if (user->registered == REG_ALL)
1079 const char* pars[1];
1081 std::string cmd = "NICK";
1083 ServerInstance->Parser->CallHandler(cmd,pars,1,user);