diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-19 00:12:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-19 00:12:47 +0000 |
commit | b03f6ce251aa3a64a2351bdb39aed4751824b7dc (patch) | |
tree | 89c2803cf9aa03ac2e752f7910d2d6dcbc8bef51 /src/modules/m_ident.cpp | |
parent | a8d0bb046a67ba41947738b02cb7705f5db9fe67 (diff) |
Fix these too
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9754 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r-- | src/modules/m_ident.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 8f251cb46..a9ea8c06e 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -367,10 +367,9 @@ class ModuleIdent : public Module { /* User::ident is currently the username field from USER; with m_ident loaded, that * should be preceded by a ~. The field is actually IDENTMAX+2 characters wide. */ - memmove(user->ident + 1, user->ident, IDENTMAX); - user->ident[0] = '~'; - /* Ensure that it is null terminated */ - user->ident[IDENTMAX + 1] = '\0'; + if (user->ident.length() > IDENTMAX + 1) + user->ident.assign(user->ident, 0, IDENTMAX); + user->ident.insert('~', 0); user->WriteServ("NOTICE Auth :*** Looking up your ident..."); @@ -384,7 +383,7 @@ class ModuleIdent : public Module if (getsockname(user->GetFd(), (sockaddr*) &laddr, &laddrsz) != 0) { - user->WriteServ("NOTICE Auth :*** Could not find your ident, using %s instead.", user->ident); + user->WriteServ("NOTICE Auth :*** Could not find your ident, using %s instead.", user->ident.c_str()); return 0; } @@ -416,8 +415,6 @@ class ModuleIdent : public Module */ virtual bool OnCheckReady(User *user) { - ServerInstance->Logs->Log("m_ident",DEBUG,"OnCheckReady %s", user->nick); - /* Does user have an ident socket attached at all? */ IdentRequestSocket *isock = NULL; if (!user->GetExt("ident_socket", isock)) @@ -460,7 +457,7 @@ class ModuleIdent : public Module user->WriteServ("NOTICE Auth :*** Could not find your ident, using %s instead.", isock->GetResult()); /* Copy the ident string to the user */ - strlcpy(user->ident, isock->GetResult(), IDENTMAX+1); + user->ident.assign(isock->GetResult(), 0, IDENTMAX+1); /* The user isnt actually disconnecting, we call this to clean up the user */ OnUserDisconnect(user); @@ -483,7 +480,6 @@ class ModuleIdent : public Module isock->Close(); delete isock; user->Shrink("ident_socket"); - ServerInstance->Logs->Log("m_ident",DEBUG, "Removed ident socket from %s", user->nick); } } }; |