summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-23 20:25:32 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-23 20:25:32 +0000
commit9d782b1f9bcd3dfd64ea6920a527a6fbdf06251e (patch)
treea6aa3e1463d7d5d91c6b7988f4c9bb3db63cdd15
parentc4953ea1f51fc72083f3eacc3d13bee2713d244b (diff)
Ident fixes, to make sure that if you dont get an ident reply you cant sneak through without a "~"
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6703 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_ident.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index ac62616a6..a0f590f95 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -46,12 +46,7 @@ class RFC1413 : public InspSocket
// so we just display a notice, and tidy off the ident_data.
if (u && (Instance->SE->GetRef(ufd) == u))
{
- char newident[MAXBUF];
u->Shrink("ident_data");
- u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using ~"+std::string(u->ident)+" instead.");
- strcpy(newident,"~");
- strlcat(newident,u->ident,IDENTMAX);
- strlcpy(u->ident,newident,IDENTMAX);
Instance->next_call = Instance->Time();
}
}
@@ -131,6 +126,9 @@ class RFC1413 : public InspSocket
{
if (u && (Instance->SE->GetRef(ufd) == u))
{
+ if (*u->ident == '~')
+ u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using "+std::string(u->ident)+" instead.");
+
Instance->next_call = Instance->Time();
u->Shrink("ident_data");
}
@@ -230,6 +228,12 @@ class ModuleIdent : public Module
* is derived from InspSocket, and inserting it into the socket engine using the
* Server::AddSocket() call.
*/
+ char newident[MAXBUF];
+ strcpy(newident,"~");
+ strlcat(newident,user->ident,IDENTMAX);
+ strlcpy(user->ident,newident,IDENTMAX);
+
+
user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Looking up your ident...");
RFC1413* ident = new RFC1413(ServerInstance, user, IdentTimeout);
if ((ident->GetState() == I_CONNECTING) || (ident->GetState() == I_CONNECTED))
@@ -238,11 +242,7 @@ class ModuleIdent : public Module
}
else
{
- char newident[MAXBUF];
- user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using ~"+std::string(user->ident)+" instead.");
- strcpy(newident,"~");
- strlcat(newident,user->ident,IDENTMAX);
- strlcpy(user->ident,newident,IDENTMAX);
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using "+std::string(user->ident)+" instead.");
ServerInstance->next_call = ServerInstance->Time();
}
return 0;