]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Convert connection::host
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 19 May 2008 19:12:43 +0000 (19:12 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 19 May 2008 19:12:43 +0000 (19:12 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9768 e03df62e-2008-0410-955e-edbf42e46eb7

29 files changed:
include/connection.h
src/command_parse.cpp
src/commands/cmd_die.cpp
src/commands/cmd_kill.cpp
src/commands/cmd_nick.cpp
src/commands/cmd_oper.cpp
src/commands/cmd_restart.cpp
src/commands/cmd_stats.cpp
src/commands/cmd_whois.cpp
src/commands/cmd_whowas.cpp
src/cull_list.cpp
src/modules/extra/m_ldapauth.cpp
src/modules/extra/m_sqlauth.cpp
src/modules/extra/m_sqloper.cpp
src/modules/extra/m_ssl_oper_cert.cpp
src/modules/m_cgiirc.cpp
src/modules/m_chancreate.cpp
src/modules/m_cloaking.cpp
src/modules/m_customtitle.cpp
src/modules/m_operlog.cpp
src/modules/m_showwhois.cpp
src/modules/m_spanningtree/netburst.cpp
src/modules/m_spanningtree/opertype.cpp
src/modules/m_spanningtree/override_stats.cpp
src/modules/m_spanningtree/uid.cpp
src/user_resolver.cpp
src/usermanager.cpp
src/userprocess.cpp
src/users.cpp

index f24fc303d18c7925602d656f9e836a880258ea16..b754a375057adc897af542a5641008e873a886ef 100644 (file)
@@ -28,7 +28,7 @@ class CoreExport connection : public EventHandler
        /** Hostname of connection.
         * This should be valid as per RFC1035.
         */
-       char host[65];
+       std::string host;
 
        /** Stats counter for bytes inbound
         */
index 887ef0551e63e78410056edcc33e7e5a02d69bfb..e98261e5883e31c55d01f4b26826cff3f791b042 100644 (file)
@@ -332,7 +332,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
                /* command is disabled! */
                user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick.c_str(),command.c_str());
                ServerInstance->SNO->WriteToSnoMask('d', "%s denied for %s (%s@%s)",
-                               command.c_str(), user->nick.c_str(), user->ident.c_str(), user->host);
+                               command.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                return do_more;
        }
        if (command_p.size() < cm->second->min_params)
index 342910094cb57a81ea77ce864d651bace4d6c9ba..6424584e314d749da4966f4974319e7c2b2dbe69 100644 (file)
@@ -39,8 +39,8 @@ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User *
        }
        else
        {
-               ServerInstance->Logs->Log("COMMAND",SPARSE, "Failed /DIE command from %s!%s@%s", user->nick.c_str(), user->ident.c_str(), user->host);
-               ServerInstance->SNO->WriteToSnoMask('A', "Failed DIE Command from %s!%s@%s.",user->nick.c_str(),user->ident.c_str(),user->host);
+               ServerInstance->Logs->Log("COMMAND",SPARSE, "Failed /DIE command from %s!%s@%s", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
+               ServerInstance->SNO->WriteToSnoMask('A', "Failed DIE Command from %s!%s@%s.",user->nick.c_str(),user->ident.c_str(),user->host.c_str());
                return CMD_FAILURE;
        }
        return CMD_SUCCESS;
index 48e1ac84ea610e7eae7cd6e5dbec205d9bf81f27..f656c570178525d596b98057e43b220393998b0d 100644 (file)
@@ -75,7 +75,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
                if (!IS_LOCAL(u))
                {
                        // remote kill
-                       ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s!%s@%s (%s)", user->nick.c_str(), u->nick.c_str(), u->ident.c_str(), u->host, parameters[1].c_str());
+                       ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s!%s@%s (%s)", user->nick.c_str(), u->nick.c_str(), u->ident.c_str(), u->host.c_str(), parameters[1].c_str());
                        FOREACH_MOD(I_OnRemoteKill, OnRemoteKill(user, u, killreason, killreason));
                }
                else
@@ -85,7 +85,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
                         * XXX - this isn't entirely correct, servers A - B - C, oper on A, client on C. Oper kills client, A and B will get remote kill
                         * snotices, C will get a local kill snotice. this isn't accurate, and needs fixing at some stage. -- w00t
                         */
-                       ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s!%s@%s (%s)", user->nick.c_str(), u->nick.c_str(), u->ident.c_str(), u->host, parameters[1].c_str());
+                       ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s!%s@%s (%s)", user->nick.c_str(), u->nick.c_str(), u->ident.c_str(), u->host.c_str(), parameters[1].c_str());
                        ServerInstance->Logs->Log("KILL",DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick.c_str(), ServerInstance->Config->ServerName, user->dhost.c_str(), user->nick.c_str(), parameters[1].c_str());
                        /* Bug #419, make sure this message can only occur once even in the case of multiple KILL messages crossing the network, and change to show
                         * hidekillsserver as source if possible
index a83d0d80011fbf9eeedbc4fa392f08f43b5517fa..72e3ff17ea31ba9a257f5428e788f26eeb35ceb6 100644 (file)
@@ -94,7 +94,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User
                        XLine* mq = ServerInstance->XLines->MatchesLine("Q",parameters[0]);
                        if (mq)
                        {
-                               ServerInstance->SNO->WriteToSnoMask('x', "Q-Lined nickname %s from %s!%s@%s: %s", parameters[0].c_str(), user->nick.c_str(), user->ident.c_str(), user->host, mq->reason);
+                               ServerInstance->SNO->WriteToSnoMask('x', "Q-Lined nickname %s from %s!%s@%s: %s", parameters[0].c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str(), mq->reason);
                                user->WriteNumeric(432, "%s %s :Invalid nickname: %s",user->nick.c_str(), parameters[0].c_str(), mq->reason);
                                return CMD_FAILURE;
                        }
index 8a330309397a48e2c8bb7737a89ea198cb0d6a3b..dc06d87ced3777284582bc491a03acb1be1de881 100644 (file)
@@ -54,7 +54,7 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User
        bool match_pass = false;
        bool match_hosts = false;
 
-       snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host);
+       snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host.c_str());
        snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString());
 
        for (int i = 0; i < ServerInstance->Config->ConfValueEnum(ServerInstance->Config->config_data, "oper"); i++)
@@ -84,7 +84,7 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User
                                        {
                                                user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick.c_str());
                                                ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper type '%s' contains invalid characters",OperType);
-                                               ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick.c_str(),user->ident.c_str(),user->host);
+                                               ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                                                return CMD_FAILURE;
                                        }
                                        ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "type","host", j, HostName, MAXBUF);
@@ -107,7 +107,7 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User
        if (found)
        {
                /* correct oper credentials */
-               ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')",user->nick.c_str(),user->ident.c_str(),user->host,irc::Spacify(OperType),parameters[0].c_str());
+               ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), irc::Spacify(OperType), parameters[0].c_str());
                user->WriteNumeric(381, "%s :You are now %s %s",user->nick.c_str(), strchr("aeiouAEIOU", *OperType) ? "an" : "a", irc::Spacify(OperType));
                if (!user->IsModeSet('o'))
                        user->Oper(OperType, LoginName);
@@ -133,11 +133,11 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User
                        user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str());
                        user->IncreasePenalty(10);
                        
-                       snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s",user->nick.c_str(),user->ident.c_str(),user->host, parameters[0].c_str(), fields.c_str());
+                       snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str());
                        ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast));
                        ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + broadcast);
 
-                       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick.c_str(),user->ident.c_str(),user->host,parameters[0].c_str(),fields.c_str());
+                       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str());
                        return CMD_FAILURE;
                }
                else
@@ -148,7 +148,7 @@ CmdResult CommandOper::Handle (const std::vector<std::string>& parameters, User
 
                        ServerInstance->SNO->WriteToSnoMask('o', std::string(broadcast));
 
-                       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick.c_str(),user->ident.c_str(),user->host,parameters[0].c_str());
+                       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str());
                        return CMD_FAILURE;
                }
        }
index 7251b1fa6130e8bd4b32ca91e915ca2713083e4f..d72b0f0de05d70e29ef3359aeac03c89e682eadd 100644 (file)
@@ -24,7 +24,7 @@ CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, Us
        ServerInstance->Logs->Log("COMMAND",DEFAULT,"Restart: %s",user->nick.c_str());
        if (!ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0].c_str(), ServerInstance->Config->powerhash))
        {
-               ServerInstance->SNO->WriteToSnoMask('A', "RESTART command from %s!%s@%s, restarting server.",user->nick.c_str(),user->ident.c_str(),user->host);
+               ServerInstance->SNO->WriteToSnoMask('A', "RESTART command from %s!%s@%s, restarting server.", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
 
                try
                {
@@ -38,7 +38,7 @@ CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, Us
        }
        else
        {
-               ServerInstance->SNO->WriteToSnoMask('A', "Failed RESTART Command from %s!%s@%s.",user->nick.c_str(),user->ident.c_str(),user->host);
+               ServerInstance->SNO->WriteToSnoMask('A', "Failed RESTART Command from %s!%s@%s.", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                return CMD_FAILURE;
        }
 
index 093d46c6c611861df89f9a2dda6b81d931b6dc11..9da5f1aeba8204a4f3fa8d31eeb455c7239081db 100644 (file)
@@ -53,7 +53,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str
                ServerInstance->SNO->WriteToSnoMask('t',
                                "%s '%c' denied for %s (%s@%s)",
                                (IS_LOCAL(user) ? "Stats" : "Remote stats"),
-                               statschar, user->nick.c_str(), user->ident.c_str(), user->host);
+                               statschar, user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                results.push_back(sn + " 481 " + user->nick + " :Permission denied - STATS " + statschar + " is oper-only");
                return;
        }
@@ -315,6 +315,6 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str
 
        results.push_back(sn+" 219 "+user->nick+" "+statschar+" :End of /STATS report");
        ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",
-               (IS_LOCAL(user) ? "Stats" : "Remote stats"), statschar, user->nick.c_str(), user->ident.c_str(), user->host);
+               (IS_LOCAL(user) ? "Stats" : "Remote stats"), statschar, user->nick.c_str(), user->ident.c_str(), user->host.c_str());
        return;
 }
index 9858ff93aaf14efef47f3829de6f1a42221c6449..8afc2352567c11a68cc08959a911f40463b0dba4 100644 (file)
@@ -29,7 +29,7 @@ void do_whois(InspIRCd* ServerInstance, User* user, User* dest,unsigned long sig
                ServerInstance->SendWhoisLine(user, dest, 311, "%s %s %s %s * :%s",user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str(), dest->dhost.c_str(), dest->fullname.c_str());
                if (user == dest || IS_OPER(user))
                {
-                       ServerInstance->SendWhoisLine(user, dest, 378, "%s %s :is connecting from %s@%s %s", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str(), dest->host, dest->GetIPString());
+                       ServerInstance->SendWhoisLine(user, dest, 378, "%s %s :is connecting from %s@%s %s", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str(), dest->host.c_str(), dest->GetIPString());
                }
 
                std::string cl = dest->ChannelList(user);
index efd15e3d6d8a944c55021e6d9838733e40ec997f..614598972f52104e5831c0db3819967bd8eb3793 100644 (file)
@@ -317,7 +317,7 @@ CommandWhowas::~CommandWhowas()
 
 WhoWasGroup::WhoWasGroup(User* user) : host(NULL), dhost(NULL), ident(NULL), server(NULL), gecos(NULL), signon(user->signon)
 {
-       this->host = strdup(user->host);
+       this->host = strdup(user->host.c_str());
        this->dhost = strdup(user->dhost.c_str());
        this->ident = strdup(user->ident.c_str());
        this->server = user->server;
index 77451b47b22cd3e7dc347f51d2ba8227ca682b1e..9d8bb3bae75f91db47fd32651dc7229ff6686390 100644 (file)
@@ -104,14 +104,14 @@ int CullList::Apply()
                        {
                                if (!u->quietquit)
                                {
-                                       ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",u->nick.c_str(),u->ident.c_str(),u->host,oper_reason.c_str());
+                                       ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]", u->nick.c_str(), u->ident.c_str(), u->host.c_str(), oper_reason.c_str());
                                }
                        }
                        else
                        {
                                if ((!ServerInstance->SilentULine(u->server)) && (!u->quietquit))
                                {
-                                       ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",u->server,u->nick.c_str(),u->ident.c_str(),u->host,oper_reason.c_str());
+                                       ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]", u->server, u->nick.c_str(), u->ident.c_str(), u->host.c_str(), oper_reason.c_str());
                                }
                        }
                        u->AddToWhoWas();
index 74e59c62a90774749b10ad08af99d343591f27bb..93ca34ff2dc0794f07ba54866ccf58f36f68a0f6 100644 (file)
@@ -144,7 +144,7 @@ public:
                {
                        free(authpass);
                        if (verbose)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP bind failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host, ldap_err2string(res));
+                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP bind failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res));
                        ldap_unbind_ext(conn, NULL, NULL);
                        conn = NULL;
                        return false;
@@ -156,20 +156,20 @@ public:
                if ((res = ldap_search_ext_s(conn, base.c_str(), searchscope, what.c_str(), NULL, 0, NULL, NULL, NULL, 0, &msg)) != LDAP_SUCCESS)
                {
                        if (verbose)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP search failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host, ldap_err2string(res));
+                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP search failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res));
                        return false;
                }
                if (ldap_count_entries(conn, msg) > 1)
                {
                        if (verbose)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP search returned more than one result: %s)", user->nick.c_str(), user->ident.c_str(), user->host, ldap_err2string(res));
+                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP search returned more than one result: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res));
                        ldap_msgfree(msg);
                        return false;
                }
                if ((entry = ldap_first_entry(conn, msg)) == NULL)
                {
                        if (verbose)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP search returned no results: %s)", user->nick.c_str(), user->ident.c_str(), user->host, ldap_err2string(res));
+                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (LDAP search returned no results: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res));
                        ldap_msgfree(msg);
                        return false;
                }
@@ -184,7 +184,7 @@ public:
                else
                {
                        if (verbose)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (%s)", user->nick.c_str(), user->ident.c_str(), user->host, ldap_err2string(res));
+                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (%s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), ldap_err2string(res));
                        ldap_msgfree(msg);
                        user->Extend("ldapauth_failed");
                        return false;
index 9ca4473b82fb38475d2f89a35a0c8bc99b5f2c04..18859d1333d62ffab2d40501d666c62868aa10d8 100644 (file)
@@ -149,7 +149,7 @@ public:
                else
                {
                        if (verbose)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host, req.error.Str());
+                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), req.error.Str());
                        return false;
                }
        }
@@ -175,13 +175,13 @@ public:
                                        else if (verbose)
                                        {
                                                /* No rows in result, this means there was no record matching the user */
-                                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick.c_str(), user->ident.c_str(), user->host);
+                                               ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                                                user->Extend("sqlauth_failed");
                                        }
                                }
                                else if (verbose)
                                {
-                                       ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host, res->error.Str());
+                                       ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), res->error.Str());
                                        user->Extend("sqlauth_failed");
                                }
                        }
index 7073e8004282e630a78e4b8dca70b9c79ae8b4c8..f3c32b14047af9057ffb1011eed245272053099c 100644 (file)
@@ -306,7 +306,7 @@ public:
                                if (operhost.size())
                                        user->ChangeDisplayedHost(operhost.c_str());
 
-                               ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick.c_str(), user->ident.c_str(), user->host, type.c_str());
+                               ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), type.c_str());
                                user->WriteNumeric(381, "%s :You are now %s %s",user->nick.c_str(), strchr("aeiouAEIOU", type[0]) ? "an" : "a", irc::Spacify(type.c_str()));
 
                                if (!user->modes[UM_OPERATOR])
index 3bbaa359e84bde36157d00eaa666e5dd88842cfa..c99dfa2e20a0331a211d093d461fc0460f49edf8 100644 (file)
@@ -129,7 +129,7 @@ class ModuleOperSSLCert : public Module
                        bool SSLOnly;
                        char* dummy;
 
-                       snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host);
+                       snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host.c_str());
                        snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString());
 
                        HasCert = user->GetExt("ssl_cert",cert);
@@ -169,7 +169,7 @@ class ModuleOperSSLCert : public Module
                                {
                                        user->WriteNumeric(491, "%s :This oper login name requires a matching key fingerprint.",user->nick.c_str());
                                        ServerInstance->SNO->WriteToSnoMask('o',"'%s' cannot oper, does not match fingerprint", user->nick.c_str());
-                                       ServerInstance->Logs->Log("m_ssl_oper_cert",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.",user->nick.c_str(), user->ident.c_str(), user->host);
+                                       ServerInstance->Logs->Log("m_ssl_oper_cert",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                                        return 1;
                                }
                        }
index 691c54184ad19ab3df0b80afce5246796a160b2c..6c99d9d3500c262611b609a63a753306c81fe433 100644 (file)
@@ -75,7 +75,7 @@ class CommandWebirc : public Command
                                                user->Extend("cgiirc_realhost", new std::string(user->host));
                                                user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
                                                if (notify)
-                                                       ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host, parameters[2].c_str(), user->host);
+                                                       ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), parameters[2].c_str(), user->host.c_str());
                                                user->Extend("cgiirc_webirc_hostname", new std::string(parameters[2]));
                                                user->Extend("cgiirc_webirc_ip", new std::string(parameters[3]));
                                                return CMD_LOCALONLY;
@@ -108,10 +108,10 @@ class CGIResolver : public Resolver
                if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
                {
                        if (notify)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick.c_str(), them->host, result.c_str(), typ.c_str());
+                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick.c_str(), them->host.c_str(), result.c_str(), typ.c_str());
 
-                       strlcpy(them->host, result.c_str(), 63);
-                       them->dhost.assign(result, 0, 63);
+                       them->host.assign(result,0, 64);
+                       them->dhost.assign(result, 0, 64);
                        them->ident.assign("~cgiirc", 0, 8);
                        them->InvalidateCache();
                        them->CheckLines();
@@ -123,7 +123,7 @@ class CGIResolver : public Resolver
                if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
                {
                        if (notify)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick.c_str(), them->host, typ.c_str());
+                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick.c_str(), them->host.c_str(), typ.c_str());
                }
        }
 
@@ -302,8 +302,8 @@ public:
                std::string *webirc_hostname, *webirc_ip;
                if(user->GetExt("cgiirc_webirc_hostname", webirc_hostname))
                {
-                       strlcpy(user->host,webirc_hostname->c_str(),63);
-                       user->dhost.assign(*webirc_hostname, 0, 63);
+                       user->host.assign(*webirc_hostname, 0, 64);
+                       user->dhost.assign(*webirc_hostname, 0, 64);
                        delete webirc_hostname;
                        user->InvalidateCache();
                        user->Shrink("cgiirc_webirc_hostname");
@@ -338,7 +338,7 @@ public:
                {
                        user->Extend("cgiirc_realhost", new std::string(user->host));
                        user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
-                       strlcpy(user->host, user->password.c_str(), 64);
+                       user->host.assign(user->password, 0, 64);
                        user->dhost.assign(user->password, 0, 64);
                        user->InvalidateCache();
 
@@ -361,7 +361,7 @@ public:
                        {
                                /* We were given a IP in the password, we don't do DNS so they get this is as their host as well. */
                                if(NotifyOpers)
-                                       ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick.c_str(), user->host, user->password.c_str());
+                                       ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick.c_str(), user->host.c_str(), user->password.c_str());
                        }
                        else
                        {
@@ -376,15 +376,11 @@ public:
                                catch (...)
                                {
                                        if (NotifyOpers)
-                                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host);
+                                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host.c_str());
                                }
                        }
                        
                        user->password.clear();
-
-                       /*if(NotifyOpers)
-                               ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password);*/
-
                        return true;
                }
                
@@ -425,7 +421,7 @@ public:
                user->CheckClass();
                try
                {
-                       strlcpy(user->host, newip, 16);
+                       user->host.assign(newip, 0, 16);
                        user->dhost.assign(newip, 0, 16);
                        user->ident.assign("~cgiirc", 0, 8);
 
@@ -435,17 +431,14 @@ public:
                }
                catch (...)
                {
-                       strlcpy(user->host, newip, 16);
+                       user->host.assign(newip, 0, 16);
                        user->dhost.assign(newip, 0, 16);
                        user->ident.assign("~cgiirc", 0, 8);
                        user->InvalidateCache();
 
                        if(NotifyOpers)
-                                ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host);
+                                ServerInstance->SNO->WriteToSnoMask('A', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host.c_str());
                }
-               /*strlcpy(user->host, newip, 16);
-               strlcpy(user->dhost, newip, 16);
-               strlcpy(user->ident, "~cgiirc", 8);*/
 
                return true;
        }
index d1e17497c288b358d92f45836abdcfda6f24bc18..3ce63567e248465dadcc94bed00a232597da0b38 100644 (file)
@@ -41,9 +41,7 @@ class ModuleChanCreate : public Module
        virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
        {
                if (channel->GetUserCounter() == 1)
-               {
-                       ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name, user->nick.c_str(), user->ident.c_str(), user->host);
-               }
+                       ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name, user->nick.c_str(), user->ident.c_str(), user->host.c_str());
        }
 };
 
index b5b677172232a569cd2426a689552c4e76fe99c4..2cbd8fb99268f501b7d99b0153434df84852ba37 100644 (file)
@@ -117,7 +117,7 @@ class CloakUser : public ModeHandler
                                /* User is removing the mode, so just restore their real host
                                 * and make it match the displayed one.
                                 */
-                               dest->ChangeDisplayedHost(dest->host);
+                               dest->ChangeDisplayedHost(dest->host.c_str());
                                dest->SetMode('x',false);
                                return MODEACTION_ALLOW;
                        }
@@ -361,10 +361,7 @@ class ModuleCloaking : public Module
 
        virtual void OnUserConnect(User* dest)
        {
-               char* n1 = strchr(dest->host,'.');
-               char* n2 = strchr(dest->host,':');
-
-               if (n1 || n2)
+               if (dest->host.find('.') != std::string::npos || dest->host.find(':') != std::string::npos)
                {
                        unsigned int iv[] = { cu->key1, cu->key2, cu->key3, cu->key4 };
                        std::string a = cu->LastTwoDomainParts(dest->host);
@@ -384,10 +381,10 @@ class ModuleCloaking : public Module
                                /** Reset the Hash module, and send it our IV and hex table */
                                HashResetRequest(this, cu->HashProvider).Send();
                                HashKeyRequest(this, cu->HashProvider, iv).Send();
-                               HashHexRequest(this, cu->HashProvider, cu->xtab[(*dest->host) % 4]);
+                               HashHexRequest(this, cu->HashProvider, cu->xtab[(dest->host[0]) % 4]);
 
                                /* Generate a cloak using specialized Hash */
-                               std::string hostcloak = cu->prefix + "-" + std::string(HashSumRequest(this, cu->HashProvider, dest->host).Send()).substr(0,8) + a;
+                               std::string hostcloak = cu->prefix + "-" + std::string(HashSumRequest(this, cu->HashProvider, dest->host.c_str()).Send()).substr(0,8) + a;
 
                                /* Fix by brain - if the cloaked host is > the max length of a host (64 bytes
                                 * according to the DNS RFC) then tough titty, they get cloaked as an IP. 
@@ -408,12 +405,12 @@ class ModuleCloaking : public Module
                                        b = ((!strchr(dest->host,':')) ? cu->Cloak4(dest->host) : cu->Cloak6(dest->host));
 #else
                                in_addr testaddr;
-                               if ((inet_aton(dest->host,&testaddr) < 1) && (hostcloak.length() <= 64))
+                               if ((inet_aton(dest->host.c_str(),&testaddr) < 1) && (hostcloak.length() <= 64))
                                        /* Invalid ipv4 address, and ipv4 user (resolved host) */
                                        b = hostcloak;
                                else
                                        /* Valid ipv4 address (not resolved) ipv4 user */
-                                       b = cu->Cloak4(dest->host);
+                                       b = cu->Cloak4(dest->host.c_str());
 #endif
                        }
                        else
index 07055f40aeba4e47b84cb72ef850d57a9476bd16..b7e67b5073da25ad3f1011ce3f5e63a599ae7300 100644 (file)
@@ -51,7 +51,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist)
                char TheHost[MAXBUF];
                char TheIP[MAXBUF];
 
-               snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(), user->host);
+               snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(), user->host.c_str());
                snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(), user->GetIPString());
 
                ConfigReader Conf(ServerInstance);
@@ -95,7 +95,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist)
 
                if (!ServerInstance->ULine(user->server))
                        // Ulines also fail TITLEs silently
-                       ServerInstance->SNO->WriteToSnoMask('A', "Failed TITLE attempt by %s!%s@%s using login '%s'",user->nick.c_str(),user->ident.c_str(),user->host,parameters[0].c_str());
+                       ServerInstance->SNO->WriteToSnoMask('A', "Failed TITLE attempt by %s!%s@%s using login '%s'", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str());
 
                user->WriteServ("NOTICE %s :Invalid title credentials",user->nick.c_str());
                return CMD_SUCCESS;
index 2aef64d7aceb23e70f1cdf7c235e570662a5f478..e295d2183a5c176682a842ec3901cdb87f67d18a 100644 (file)
@@ -47,13 +47,7 @@ class ModuleOperLog : public Module
                {
                        Command* thiscommand = ServerInstance->Parser->GetHandler(command);
                        if ((thiscommand) && (thiscommand->flags_needed == 'o'))
-                       {
-                               std::string plist;
-                               for (int j = 0; j < (int)parameters.size(); j++)
-                                       plist.append(std::string(" ")+parameters[j]);
-
-                               ServerInstance->Logs->Log("m_operlog",DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick.c_str(), user->ident.c_str(), user->host, command.c_str(), plist.c_str());
-                       } 
+                               ServerInstance->Logs->Log("m_operlog",DEFAULT,"OPERLOG: [%s!%s@%s] %s %s",user->nick.c_str(), user->ident.c_str(), user->host.c_str(), command.c_str(), irc::stringjoiner(" ", parameters, 0, parameters.size() - 1).GetJoined().c_str());
                }
 
                return 0;
index c3964989669147896c609719176898cbd9a6ce07..a66ea2f9806d4438395b132c727bf72419b1c8e3 100644 (file)
@@ -84,11 +84,11 @@ class ModuleShowwhois : public Module
                {
                        if (IS_LOCAL(dest))
                        {
-                               dest->WriteServ("NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick.c_str(),source->nick.c_str(),source->ident.c_str(),source->host);
+                               dest->WriteServ("NOTICE %s :*** %s (%s@%s) did a /whois on you.", dest->nick.c_str(), source->nick.c_str(), source->ident.c_str(), source->host.c_str());
                        }
                        else
                        {
-                               std::string msg = std::string(":") + dest->server + " NOTICE " + dest->nick + " :*** " + source->nick + " (" + source->ident + "@" + source->host + ") did a /whois on you.";
+                               std::string msg = std::string(":") + dest->server + " NOTICE " + dest->nick + " :*** " + source->nick + " (" + source->ident + "@" + source->host.c_str() + ") did a /whois on you.";
                                ServerInstance->PI->PushToClient(dest, msg);
                        }
                }
index b1f63c01ba2dab958ca40411b621f1e1b4b2da8c..3a28ca8a9102037c62677b603c83b9469dddcdaa 100644 (file)
@@ -222,7 +222,7 @@ void TreeSocket::SendUsers(TreeServer* Current)
                        if (theirserver)
                        {
                                snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid.c_str(),
-                                               (unsigned long)u->second->age, u->second->nick.c_str(), u->second->host, u->second->dhost.c_str(),
+                                               (unsigned long)u->second->age, u->second->nick.c_str(), u->second->host.c_str(), u->second->dhost.c_str(),
                                                u->second->ident.c_str(), u->second->FormatModes(), u->second->GetIPString(),
                                                (unsigned long)u->second->signon, u->second->fullname.c_str());
                                this->WriteLine(data);
index a5bd07416084645cc5f9424aa5c0df69dc766d85..a2aff74f98307e5e4f57889fb17c5fd8a5ac6018 100644 (file)
@@ -57,7 +57,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa
                }
 
                if (dosend)
-                       this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(),u->host,irc::Spacify(opertype.c_str()));
+                       this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(), u->host.c_str(), irc::Spacify(opertype.c_str()));
        }
        return true;
 }
index 740694643e2ae2d90882f11b48bf7d728e6c9ebc..ab50f765642e0d456f297330370271d466bd3dc0 100644 (file)
@@ -72,7 +72,7 @@ int ModuleSpanningTree::OnStats(char statschar, User* user, string_list &results
                                results.push_back(std::string(ServerInstance->Config->ServerName)+" 244 "+user->nick+" H * * "+Utils->LinkBlocks[i].Name.c_str());
                }
                results.push_back(std::string(ServerInstance->Config->ServerName)+" 219 "+user->nick+" "+statschar+" :End of /STATS report");
-               ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",(!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"),statschar,user->nick.c_str(),user->ident.c_str(),user->host);
+               ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)", (!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"), statschar, user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                return 1;
        }
 
index f68da8a1c79e862b49674bb8473d780df9fd3dce..e539e0b18d1b4898702e2c1bf7e94f8a74f94155 100644 (file)
@@ -112,7 +112,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
        (*(this->Instance->Users->clientlist))[tempnick] = _new;
        _new->SetFd(FD_MAGIC_NUMBER);
        _new->nick.assign(tempnick, NICKMAX - 1);
-       strlcpy(_new->host, params[3].c_str(),64);
+       _new->host.assign(params[3], 0, 64);
        _new->dhost.assign(params[4], 0, 64);
        _new->server = this->Instance->FindServerNamePtr(remoteserver->GetName().c_str());
        _new->ident.assign(params[5], 0, IDENTMAX + 1);
@@ -157,7 +157,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa
                dosend = false;
        
        if (dosend)
-               this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]",_new->server,_new->nick.c_str(),_new->ident.c_str(),_new->host, _new->GetIPString(), _new->fullname.c_str());
+               this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]", _new->server, _new->nick.c_str(), _new->ident.c_str(), _new->host.c_str(), _new->GetIPString(), _new->fullname.c_str());
 
        params[9] = ":" + params[9];
        Utils->DoOneToAllButSender(source, "UID", params, source);
index b962be7817d82f00d2a3f6d162b7050ea4afaecb..8dec4c5419f38c7ae365112c3c8c9f2ac700c3f4 100644 (file)
@@ -71,13 +71,13 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
                                if ((this->bound_user->registered != REG_ALL) && (!this->bound_user->dns_done))
                                {
                                        /* Hostnames starting with : are not a good thing (tm) */
-                                       if (*(hostname.c_str()) == ':')
+                                       if (hostname[0] == ':')
                                                hostname.insert(0, "0");
 
                                        this->bound_user->WriteServ("NOTICE Auth :*** Found your hostname (%s)%s", hostname.c_str(), (cached ? " -- cached" : ""));
                                        this->bound_user->dns_done = true;
                                        this->bound_user->dhost.assign(hostname, 0, 64);
-                                       strlcpy(this->bound_user->host, hostname.c_str(),64);
+                                       this->bound_user->host.assign(hostname, 0, 64);
                                        /* Invalidate cache */
                                        this->bound_user->InvalidateCache();
                                }
index 834ff3e20ac944ef267b2125972463638e334232..f18ea91d4c6651d7902b51b8cfd7f571629101f4 100644 (file)
@@ -192,7 +192,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache
 void UserManager::QuitUser(User *user, const std::string &quitreason, const char* operreason)
 {
        ServerInstance->Logs->Log("USERS", DEBUG,"QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str());
-       user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident.c_str(), user->host, *operreason ? operreason : quitreason.c_str());
+       user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str());
        user->quietquit = false;
        user->quitmsg = quitreason;
 
index 11fcfa59cf23eac2d536bb1eb65c468a8066f0b4..3dc3143de02abaa8b441813e695c423147499700 100644 (file)
 
 void FloodQuitUserHandler::Call(User* current)
 {
-       Server->Logs->Log("USERS",DEFAULT,"Excess flood from: %s@%s", current->ident.c_str(), current->host);
+       Server->Logs->Log("USERS",DEFAULT,"Excess flood from: %s@%s", current->ident.c_str(), current->host.c_str());
        Server->SNO->WriteToSnoMask('f',"Excess flood from: %s%s%s@%s",
                        current->registered == REG_ALL ? current->nick.c_str() : "",
-                       current->registered == REG_ALL ? "!" : "", current->ident.c_str(), current->host);
+                       current->registered == REG_ALL ? "!" : "", current->ident.c_str(), current->host.c_str());
        Server->Users->QuitUser(current, "Excess flood");
 
        if (current->registered != REG_ALL)
index aa9d570ac55abbfb1c627826e7478cc844dc09d3..45052e8cb60ca28302339b59f534f14a1c734a18 100644 (file)
@@ -185,7 +185,6 @@ void User::DecrementModes()
 
 User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance)
 {
-       *host = 0;
        server = (char*)Instance->FindServerNamePtr(Instance->Config->ServerName);
        reset_due = ServerInstance->Time();
        age = ServerInstance->Time();
@@ -283,7 +282,7 @@ const std::string& User::MakeHost()
        for(const char* n = ident.c_str(); *n; n++)
                *t++ = *n;
        *t++ = '@';
-       for(const char* n = host; *n; n++)
+       for(const char* n = host.c_str(); *n; n++)
                *t++ = *n;
        *t = 0;
 
@@ -383,7 +382,7 @@ const std::string& User::GetFullRealHost()
        for(const char* n = ident.c_str(); *n; n++)
                *t++ = *n;
        *t++ = '@';
-       for(char* n = host; *n; n++)
+       for(const char* n = host.c_str(); *n; n++)
                *t++ = *n;
        *t = 0;
 
@@ -721,7 +720,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
                this->modes[UM_OPERATOR] = 1;
                this->WriteServ("MODE %s :+o", this->nick.c_str());
                FOREACH_MOD(I_OnOper, OnOper(this, opertype));
-               ServerInstance->Logs->Log("OPER", DEFAULT, "%s!%s@%s opered as type: %s", this->nick.c_str(), this->ident.c_str(), this->host, opertype.c_str());
+               ServerInstance->Logs->Log("OPER", DEFAULT, "%s!%s@%s opered as type: %s", this->nick.c_str(), this->ident.c_str(), this->host.c_str(), opertype.c_str());
                this->oper.assign(opertype, 0, NICKMAX - 1);
                ServerInstance->Users->all_opers.push_back(this);
 
@@ -931,7 +930,7 @@ void User::FullConnect()
        CheckLines();
 
        this->WriteServ("NOTICE Auth :Welcome to \002%s\002!",ServerInstance->Config->Network);
-       this->WriteNumeric(001, "%s :Welcome to the %s IRC Network %s!%s@%s",this->nick.c_str(), ServerInstance->Config->Network, this->nick.c_str(), this->ident.c_str(), this->host);
+       this->WriteNumeric(001, "%s :Welcome to the %s IRC Network %s!%s@%s",this->nick.c_str(), ServerInstance->Config->Network, this->nick.c_str(), this->ident.c_str(), this->host.c_str());
        this->WriteNumeric(002, "%s :Your host is %s, running version InspIRCd-1.2",this->nick.c_str(),ServerInstance->Config->ServerName);
        this->WriteNumeric(003, "%s :This server was created %s %s", this->nick.c_str(), __TIME__, __DATE__);
        this->WriteNumeric(004, "%s %s InspIRCd-1.2 %s %s %s", this->nick.c_str(), ServerInstance->Config->ServerName, ServerInstance->Modes->UserModeList().c_str(), ServerInstance->Modes->ChannelModeList().c_str(), ServerInstance->Modes->ParaModeList().c_str());
@@ -962,7 +961,7 @@ void User::FullConnect()
 
        FOREACH_MOD(I_OnPostConnect,OnPostConnect(this));
 
-       ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]", this->GetPort(), this->nick.c_str(), this->ident.c_str(), this->host, this->GetIPString(), this->fullname.c_str());
+       ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]", this->GetPort(), this->nick.c_str(), this->ident.c_str(), this->host.c_str(), this->GetIPString(), this->fullname.c_str());
        ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding NEGATIVE hit for %s", this->GetIPString());
        ServerInstance->BanCache->AddHit(this->GetIPString(), "", "");
 }