summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-19 00:34:08 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-19 00:34:08 +0000
commit84235673df58bb199622c67bbead02d91f953838 (patch)
tree60af1a14f1e545d477ed81ec881b342468b00634 /src/modules/extra
parente3bd782207f50d131acd008b0cbcc7545aac7690 (diff)
Fix these too
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9760 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ldapauth.cpp14
-rw-r--r--src/modules/extra/m_mssql.cpp132
-rw-r--r--src/modules/extra/m_rline.cpp12
-rw-r--r--src/modules/extra/m_sqlauth.cpp6
-rw-r--r--src/modules/extra/m_sqloper.cpp4
-rw-r--r--src/modules/extra/m_sqlutils.cpp4
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp4
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp4
-rw-r--r--src/modules/extra/m_ssl_oper_cert.cpp20
-rw-r--r--src/modules/extra/m_sslinfo.cpp12
10 files changed, 83 insertions, 129 deletions
diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp
index 60f1e8978..74e59c62a 100644
--- a/src/modules/extra/m_ldapauth.cpp
+++ b/src/modules/extra/m_ldapauth.cpp
@@ -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, user->ident, 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, ldap_err2string(res));
ldap_unbind_ext(conn, NULL, NULL);
conn = NULL;
return false;
@@ -156,25 +156,25 @@ 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, user->ident, 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, 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, user->ident, 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, 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, user->ident, 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, ldap_err2string(res));
ldap_msgfree(msg);
return false;
}
- cred.bv_val = user->password;
- cred.bv_len = strlen(user->password);
+ cred.bv_val = (char*)user->password.data();
+ cred.bv_len = user->password.length();
if ((res = ldap_sasl_bind_s(conn, ldap_get_dn(conn, entry), LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL)) == LDAP_SUCCESS)
{
ldap_msgfree(msg);
@@ -184,7 +184,7 @@ public:
else
{
if (verbose)
- ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (%s)", user->nick, user->ident, 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, ldap_err2string(res));
ldap_msgfree(msg);
user->Extend("ldapauth_failed");
return false;
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp
index 972130396..ab4d2aa71 100644
--- a/src/modules/extra/m_mssql.cpp
+++ b/src/modules/extra/m_mssql.cpp
@@ -33,8 +33,7 @@ typedef std::deque<classbase*> paramlist;
typedef std::deque<MsSQLResult*> ResultQueue;
ResultNotifier* resultnotify = NULL;
-ResultNotifier* resultdispatch = NULL;
-int QueueFD = -1;
+
class ResultNotifier : public BufferedSocket
{
@@ -73,18 +72,7 @@ class ResultNotifier : public BufferedSocket
virtual int OnIncomingConnection(int newsock, char* ip)
{
- resultdispatch = new ResultNotifier(Instance, mod, newsock, ip);
- return true;
- }
-
- virtual bool OnDataReady()
- {
- char data = 0;
- if (Instance->SE->Recv(this, &data, 1, 0) > 0)
- {
- Dispatch();
- return true;
- }
+ Dispatch();
return false;
}
@@ -269,13 +257,13 @@ class SQLConn : public classbase
SQLhost host;
TDSLOGIN* login;
TDSSOCKET* sock;
- TDSCONTEXT* context;
+ TDSCONNECTION* conn;
public:
SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
- : Instance(SI), mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
+ : Instance(SI), mod(m), host(hi)
{
- if (OpenDB())
+ if (OpenDB() == TDS_SUCCEED)
{
std::string query("USE " + host.name);
if (tds_submit_query(sock, query.c_str()) == TDS_SUCCEED)
@@ -481,14 +469,16 @@ class SQLConn : public classbase
res->UpdateAffectedCount();
}
- bool OpenDB()
+ int OpenDB()
{
CloseDB();
- TDSCONNECTION* conn = NULL;
+ TDSCONTEXT* cont;
+ cont = tds_alloc_context(this);
+ cont->msg_handler = HandleMessage;
+ cont->err_handler = HandleError;
login = tds_alloc_login();
- tds_set_app(login, "TSQL");
tds_set_library(login,"TDS-Library");
tds_set_host(login, "");
tds_set_server(login, host.host.c_str());
@@ -498,41 +488,22 @@ class SQLConn : public classbase
tds_set_port(login, host.port);
tds_set_packet(login, 512);
- context = tds_alloc_context(this);
- context->msg_handler = HandleMessage;
- context->err_handler = HandleError;
-
- sock = tds_alloc_socket(context, 512);
- tds_set_parent(sock, NULL);
-
- conn = tds_read_config_info(NULL, login, context->locale);
-
- if (tds_connect(sock, conn) == TDS_SUCCEED)
- {
- tds_free_connection(conn);
- return 1;
- }
- tds_free_connection(conn);
- return 0;
+ sock = tds_alloc_socket(cont, 512);
+ conn = tds_read_config_info(NULL, login, cont->locale);
+ return tds_connect(sock, conn);
}
void CloseDB()
{
- if (sock)
- {
- tds_free_socket(sock);
- sock = NULL;
- }
- if (context)
- {
- tds_free_context(context);
- context = NULL;
- }
if (login)
- {
tds_free_login(login);
- login = NULL;
- }
+ if (sock)
+ tds_free_socket(sock);
+ if (conn)
+ tds_free_connection(conn);
+ login = NULL;
+ sock = NULL;
+ conn = NULL;
}
SQLhost GetConfHost()
@@ -573,36 +544,32 @@ class SQLConn : public classbase
void SendNotify()
{
- if (QueueFD < 0)
+ int QueueFD;
+ if ((QueueFD = socket(AF_FAMILY, SOCK_STREAM, 0)) == -1)
{
- if ((QueueFD = socket(AF_FAMILY, SOCK_STREAM, 0)) == -1)
- {
- /* crap, we're out of sockets... */
- return;
- }
+ /* crap, we're out of sockets... */
+ return;
+ }
- insp_sockaddr addr;
+ insp_sockaddr addr;
#ifdef IPV6
- insp_aton("::1", &addr.sin6_addr);
- addr.sin6_family = AF_FAMILY;
- addr.sin6_port = htons(resultnotify->GetPort());
+ insp_aton("::1", &addr.sin6_addr);
+ addr.sin6_family = AF_FAMILY;
+ addr.sin6_port = htons(resultnotify->GetPort());
#else
- insp_inaddr ia;
- insp_aton("127.0.0.1", &ia);
- addr.sin_family = AF_FAMILY;
- addr.sin_addr = ia;
- addr.sin_port = htons(resultnotify->GetPort());
+ insp_inaddr ia;
+ insp_aton("127.0.0.1", &ia);
+ addr.sin_family = AF_FAMILY;
+ addr.sin_addr = ia;
+ addr.sin_port = htons(resultnotify->GetPort());
#endif
- if (connect(QueueFD, (sockaddr*)&addr,sizeof(addr)) == -1)
- {
- /* wtf, we cant connect to it, but we just created it! */
- return;
- }
+ if (connect(QueueFD, (sockaddr*)&addr,sizeof(addr)) == -1)
+ {
+ /* wtf, we cant connect to it, but we just created it! */
+ return;
}
- char id = 0;
- send(QueueFD, &id, 1, 0);
}
};
@@ -638,24 +605,11 @@ class ModuleMsSQL : public Module
{
ClearQueue();
ClearAllConnections();
-
- ServerInstance->SE->DelFd(resultnotify);
- resultnotify->Close();
- ServerInstance->BufferedSocketCull();
-
- if (QueueFD >= 0)
- {
- shutdown(QueueFD, 2);
- close(QueueFD);
- }
-
- if (resultdispatch)
- {
- ServerInstance->SE->DelFd(resultdispatch);
- resultdispatch->Close();
- ServerInstance->BufferedSocketCull();
- }
-
+ resultnotify->SetFd(-1);
+ resultnotify->state = I_ERROR;
+ resultnotify->OnError(I_ERR_SOCKET);
+ resultnotify->ClosePending = true;
+ delete resultnotify;
ServerInstance->Modules->UnpublishInterface("SQL", this);
ServerInstance->Modules->UnpublishFeature("SQL");
ServerInstance->Modules->DoneWithInterface("SQLutils");
diff --git a/src/modules/extra/m_rline.cpp b/src/modules/extra/m_rline.cpp
index 1503f04d9..0a26ea63d 100644
--- a/src/modules/extra/m_rline.cpp
+++ b/src/modules/extra/m_rline.cpp
@@ -143,7 +143,7 @@ class CommandRLine : public Command
try
{
- r = new RLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2].c_str(), parameters[0].c_str());
+ r = new RLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
}
catch (...)
{
@@ -156,12 +156,12 @@ class CommandRLine : public Command
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent R-Line for %s.", user->nick, parameters[0].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent R-Line for %s.", user->nick.c_str(), parameters[0].c_str());
}
else
{
time_t c_requires_crap = duration + ServerInstance->Time();
- ServerInstance->SNO->WriteToSnoMask('x', "%s added timed R-Line for %s, expires on %s", user->nick, parameters[0].c_str(),
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed R-Line for %s, expires on %s", user->nick.c_str(), parameters[0].c_str(),
ServerInstance->TimeString(c_requires_crap).c_str());
}
@@ -170,7 +170,7 @@ class CommandRLine : public Command
else
{
delete r;
- user->WriteServ("NOTICE %s :*** R-Line for %s already exists", user->nick, parameters[0].c_str());
+ user->WriteServ("NOTICE %s :*** R-Line for %s already exists", user->nick.c_str(), parameters[0].c_str());
}
}
}
@@ -178,12 +178,12 @@ class CommandRLine : public Command
{
if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "R", user))
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s Removed R-Line on %s.",user->nick,parameters[0].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x',"%s Removed R-Line on %s.",user->nick.c_str(),parameters[0].c_str());
}
else
{
// XXX todo implement stats
- user->WriteServ("NOTICE %s :*** R-Line %s not found in list, try /stats g.",user->nick,parameters[0].c_str());
+ user->WriteServ("NOTICE %s :*** R-Line %s not found in list, try /stats g.",user->nick.c_str(),parameters[0].c_str());
}
}
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index db68e749f..9ca4473b8 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -149,7 +149,7 @@ public:
else
{
if (verbose)
- ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, 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, 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, user->ident, 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);
user->Extend("sqlauth_failed");
}
}
else if (verbose)
{
- ServerInstance->SNO->WriteToSnoMask('A', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, 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, res->error.Str());
user->Extend("sqlauth_failed");
}
}
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index 861a2b70c..7073e8004 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -306,8 +306,8 @@ 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, user->ident, user->host, type.c_str());
- user->WriteNumeric(381, "%s :You are now %s %s",user->nick, strchr("aeiouAEIOU", type[0]) ? "an" : "a", irc::Spacify(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, 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])
user->Oper(type, tname);
diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp
index 0aced9252..3f7c63714 100644
--- a/src/modules/extra/m_sqlutils.cpp
+++ b/src/modules/extra/m_sqlutils.cpp
@@ -123,14 +123,14 @@ public:
{
if(iter->second != user)
{
- ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: ID associated with user %s doesn't have the same User* associated with it in the map (erasing anyway)", user->nick);
+ ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: ID associated with user %s doesn't have the same User* associated with it in the map (erasing anyway)", user->nick.c_str());
}
iduser.erase(iter);
}
else
{
- ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: user %s was extended with sqlutils_queryids but there was nothing matching in the map", user->nick);
+ ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: user %s was extended with sqlutils_queryids but there was nothing matching in the map", user->nick.c_str());
}
}
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 70c87d5fa..74aede15d 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -622,7 +622,7 @@ class ModuleSSLGnuTLS : public Module
// Bugfix, only send this numeric for *our* SSL users
if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && (dest->io == this))))
{
- ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick, dest->nick);
+ ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str());
}
}
@@ -722,7 +722,7 @@ class ModuleSSLGnuTLS : public Module
std::string cipher = gnutls_kx_get_name(gnutls_kx_get(sessions[user->GetFd()].sess));
cipher.append("-").append(gnutls_cipher_get_name(gnutls_cipher_get(sessions[user->GetFd()].sess))).append("-");
cipher.append(gnutls_mac_get_name(gnutls_mac_get(sessions[user->GetFd()].sess)));
- user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick, cipher.c_str());
+ user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick.c_str(), cipher.c_str());
}
}
}
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 2e973eea6..9a51f0eb3 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -687,7 +687,7 @@ class ModuleSSLOpenSSL : public Module
// Bugfix, only send this numeric for *our* SSL users
if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && dest->io == this)))
{
- ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick, dest->nick);
+ ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str());
}
}
@@ -790,7 +790,7 @@ class ModuleSSLOpenSSL : public Module
VerifyCertificate(&sessions[user->GetFd()], user);
if (sessions[user->GetFd()].sess)
- user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick, SSL_get_cipher(sessions[user->GetFd()].sess));
+ user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick.c_str(), SSL_get_cipher(sessions[user->GetFd()].sess));
}
}
diff --git a/src/modules/extra/m_ssl_oper_cert.cpp b/src/modules/extra/m_ssl_oper_cert.cpp
index 06c1110d0..69b1a0079 100644
--- a/src/modules/extra/m_ssl_oper_cert.cpp
+++ b/src/modules/extra/m_ssl_oper_cert.cpp
@@ -43,24 +43,24 @@ class cmd_fingerprint : public Command
{
if (cert->GetFingerprint().length())
{
- user->WriteServ("NOTICE %s :Certificate fingerprint for %s is %s",user->nick,target->nick,cert->GetFingerprint().c_str());
+ user->WriteServ("NOTICE %s :Certificate fingerprint for %s is %s",user->nick.c_str(),target->nick.c_str(),cert->GetFingerprint().c_str());
return CMD_SUCCESS;
}
else
{
- user->WriteServ("NOTICE %s :Certificate fingerprint for %s does not exist!", user->nick,target->nick);
+ user->WriteServ("NOTICE %s :Certificate fingerprint for %s does not exist!", user->nick.c_str(),target->nick.c_str());
return CMD_FAILURE;
}
}
else
{
- user->WriteServ("NOTICE %s :Certificate fingerprint for %s does not exist!", user->nick, target->nick);
+ user->WriteServ("NOTICE %s :Certificate fingerprint for %s does not exist!", user->nick.c_str(), target->nick.c_str());
return CMD_FAILURE;
}
}
else
{
- user->WriteNumeric(401, "%s %s :No such nickname", user->nick, parameters[0].c_str());
+ user->WriteNumeric(401, "%s %s :No such nickname", user->nick.c_str(), parameters[0].c_str());
return CMD_FAILURE;
}
}
@@ -129,8 +129,8 @@ class ModuleOperSSLCert : public Module
bool SSLOnly;
char* dummy;
- snprintf(TheHost,MAXBUF,"%s@%s",user->ident,user->host);
- snprintf(TheIP, MAXBUF,"%s@%s",user->ident,user->GetIPString());
+ snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host);
+ snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString());
HasCert = user->GetExt("ssl_cert",cert);
@@ -150,16 +150,16 @@ class ModuleOperSSLCert : public Module
{
if (SSLOnly && !user->GetExt("ssl", dummy))
{
- user->WriteNumeric(491, "%s :This oper login name requires an SSL connection.", user->nick);
+ user->WriteNumeric(491, "%s :This oper login name requires an SSL connection.", user->nick.c_str());
return 1;
}
/* This oper would match */
if ((!cert) || (cert->GetFingerprint() != FingerPrint))
{
- user->WriteNumeric(491, "%s :This oper login name requires a matching key fingerprint.",user->nick);
- ServerInstance->SNO->WriteToSnoMask('o',"'%s' cannot oper, does not match fingerprint", user->nick);
- ServerInstance->Logs->Log("m_ssl_oper_cert",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but wrong fingerprint.",user->nick,user->ident,user->host);
+ 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);
return 1;
}
}
diff --git a/src/modules/extra/m_sslinfo.cpp b/src/modules/extra/m_sslinfo.cpp
index 910a6b808..6c74b15d4 100644
--- a/src/modules/extra/m_sslinfo.cpp
+++ b/src/modules/extra/m_sslinfo.cpp
@@ -44,21 +44,21 @@ class cmd_sslinfo : public Command
{
if (cert->GetError().length())
{
- user->WriteServ("NOTICE %s :*** Error: %s", user->nick, cert->GetError().c_str());
+ user->WriteServ("NOTICE %s :*** Error: %s", user->nick.c_str(), cert->GetError().c_str());
}
- user->WriteServ("NOTICE %s :*** Distinguised Name: %s", user->nick, cert->GetDN().c_str());
- user->WriteServ("NOTICE %s :*** Issuer: %s", user->nick, cert->GetIssuer().c_str());
- user->WriteServ("NOTICE %s :*** Key Fingerprint: %s", user->nick, cert->GetFingerprint().c_str());
+ user->WriteServ("NOTICE %s :*** Distinguised Name: %s", user->nick.c_str(), cert->GetDN().c_str());
+ user->WriteServ("NOTICE %s :*** Issuer: %s", user->nick.c_str(), cert->GetIssuer().c_str());
+ user->WriteServ("NOTICE %s :*** Key Fingerprint: %s", user->nick.c_str(), cert->GetFingerprint().c_str());
return CMD_SUCCESS;
}
else
{
- user->WriteServ("NOTICE %s :*** No SSL certificate information for this user.", user->nick);
+ user->WriteServ("NOTICE %s :*** No SSL certificate information for this user.", user->nick.c_str());
return CMD_FAILURE;
}
}
else
- user->WriteNumeric(401, "%s %s :No such nickname", user->nick, parameters[0].c_str());
+ user->WriteNumeric(401, "%s %s :No such nickname", user->nick.c_str(), parameters[0].c_str());
return CMD_FAILURE;
}