summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-03 05:15:39 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-03 05:15:39 +0000
commit1c89004245d014d2fb961ca6c850e7df72af7993 (patch)
treead0a14224b0db8f1f5e150cba885efc505817973
parent8cc71ee7946ca3723778062b66b336415122062b (diff)
Removed ircd->b_delay_auth, have User::CheckAuthenticationToken validate users. Fixes us telling people to identify after netmerge then silently identifying them once we process svid.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2994 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--docs/IRCD5
-rw-r--r--include/services.h1
-rw-r--r--src/nickserv.c3
-rw-r--r--src/protocol/bahamut.c1
-rw-r--r--src/protocol/inspircd11.c1
-rw-r--r--src/protocol/inspircd12.cpp1
-rw-r--r--src/protocol/ratbox.c1
-rw-r--r--src/protocol/unreal32.c1
-rw-r--r--src/users.c80
9 files changed, 42 insertions, 52 deletions
diff --git a/docs/IRCD b/docs/IRCD
index 371eb2cdb..52ee424bb 100644
--- a/docs/IRCD
+++ b/docs/IRCD
@@ -196,10 +196,7 @@ How To Add IRCd Support
42) Global TLD Prefix: Prefix used to send global messages, should probably
be "$"
- 43) Delayed AUTH: Does the ircd send if a user is identified for their nick
- AFTER the initial NICK/UID? Set this to 0 for no.
-
- 44) Max Modes: The max number of mode changes we can send in one line
+ 43) Max Modes: The max number of mode changes we can send in one line
4) Modes
diff --git a/include/services.h b/include/services.h
index 1eb644c52..b831243aa 100644
--- a/include/services.h
+++ b/include/services.h
@@ -406,7 +406,6 @@ struct ircdvars_ {
* 0 for no support, 1 for strict cidr support, anything else
* for ircd specific support (nefarious only cares about first /mask) */
const char *globaltldprefix; /* TLD prefix used for Global */
- bool b_delay_auth; /* Auth for users is sent after the initial NICK/UID command */
unsigned maxmodes; /* Max modes to send per line */
};
diff --git a/src/nickserv.c b/src/nickserv.c
index c9f2e2ffb..0d07a59e7 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -250,6 +250,9 @@ int validate_user(User * u)
if (na->last_realname)
delete [] na->last_realname;
na->last_realname = sstrdup(u->realname);
+
+ check_memos(u);
+
return 1;
}
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index a813a4b6c..717654220 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -53,7 +53,6 @@ IRCDVar myIrcd[] = {
0, /* p10 */
0, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
- false, /* Auth for users is sent after the initial NICK/UID command */
6, /* Max number of modes we can send per line */
}
,
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index c731d4043..eaa94ec87 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -70,7 +70,6 @@ IRCDVar myIrcd[] = {
0, /* p10 */
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
- false, /* Auth for users is sent after the initial NICK/UID command */
20, /* Max number of modes we can send per line */
}
,
diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp
index 2c53e4b8d..d76da332d 100644
--- a/src/protocol/inspircd12.cpp
+++ b/src/protocol/inspircd12.cpp
@@ -70,7 +70,6 @@ IRCDVar myIrcd[] = {
0, /* p10 */
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
- true, /* Auth for users is sent after the initial NICK/UID command */
20, /* Max number of modes we can send per line */
}
,
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index f1c2f3b3b..3c589e98e 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -51,7 +51,6 @@ IRCDVar myIrcd[] = {
0, /* p10 */
0, /* CIDR channelbans */
"$$", /* TLD Prefix for Global */
- false, /* Auth for users is sent after the initial NICK/UID command */
4, /* Max number of modes we can send per line */
}
,
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index b44031004..55fe49dd4 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -53,7 +53,6 @@ IRCDVar myIrcd[] = {
0, /* p10 */
0, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
- false, /* Auth for users is sent after the initial NICK/UID command */
12, /* Max number of modes we can send per line */
}
,
diff --git a/src/users.c b/src/users.c
index 8075b4b42..fd815f5c6 100644
--- a/src/users.c
+++ b/src/users.c
@@ -398,21 +398,23 @@ void User::Collide(NickAlias *na)
*/
void User::CheckAuthenticationToken(const char *svid)
{
- char *c;
NickAlias *na;
if ((na = findnick(this->nick)))
{
+ char *c;
if (na->nc && na->nc->GetExtArray("authenticationtoken", c))
{
if (svid && c && !strcmp(svid, c))
{
/* Users authentication token matches so they should become identified */
- check_memos(this);
- this->nc = na->nc;
+ this->Login(na->nc);
+ return;
}
}
}
+
+ validate_user(this);
}
/** Auto identify the user to the given accountname.
@@ -488,13 +490,13 @@ const bool User::IsIdentified(bool CheckNick) const
if (na && na->nc == this->nc)
{
- return this->nc;
+ return true;
}
- return NULL;
+ return false;
}
- return this->nc;
+ return this->nc ? true : false;
}
/** Check if the user is recognized for their nick (on the nicks access list)
@@ -975,6 +977,13 @@ User *do_nick(const char *source, const char *nick, const char *username, const
if (old_na && (old_na->nc == user->Account() || user->IsRecognized()))
old_na->last_seen = time(NULL);
+ /* On nick change -r gets set on nick changes but we aren't informed about it, causing SetMode(UMODE_REGISTERED)
+ * to fail (we think it is already set). Remove it silently like the IRCds
+ */
+ UserMode *um = ModeManager::FindUserModeByName(UMODE_REGISTERED);
+ if (um)
+ user->RemoveModeInternal(um);
+
std::string oldnick = user->nick;
user->SetNewNick(nick);
FOREACH_MOD(I_OnUserNickChange, OnUserNickChange(user, oldnick.c_str()));
@@ -984,47 +993,34 @@ User *do_nick(const char *source, const char *nick, const char *username, const
NickAlias *na = findnick(user->nick);
/* If the new nick isnt registerd or its registerd and not yours */
- if (!na || (old_na && na->nc != old_na->nc))
+ if (!na || na->nc != user->Account())
{
ircdproto->SendUnregisteredNick(user);
- }
- }
-
- if (ircd->sqline)
- {
- if (!is_oper(user) && check_sqline(user->nick.c_str(), 1))
- return NULL;
- }
-
- } /* if (!*source) */
-
- /* Do not attempt to validate the user if their server is syncing and this
- * ircd has delayed auth - Adam
- */
- if (!(ircd->b_delay_auth && user->server->sync == SSYNC_IN_PROGRESS))
- {
- NickAlias *na = findnick(user->nick);
-
- if (!na || na->nc != user->Account())
- {
- if (validate_user(user))
- check_memos(user);
- }
- else
- {
- na->last_seen = time(NULL);
- user->UpdateHost();
- do_on_id(user);
- ircdproto->SetAutoIdentificationToken(user);
- Alog() << Config.s_NickServ << ": " << user->GetMask() << " automatically identified for group " << user->Account()->display;
- }
- /* Bahamut sets -r on every nick changes */
- if (ircd->check_nick_id)
- {
- if (user->IsIdentified())
+ validate_user(user);
+ }
+ else
{
+ na->last_seen = time(NULL);
+ user->UpdateHost();
+ do_on_id(user);
ircdproto->SetAutoIdentificationToken(user);
+ Alog() << Config.s_NickServ << ": " << user->GetMask() << " automatically identified for group " << user->Account()->display;
+ }
+
+ /* Bahamut sets -r on every nick change */
+ if (ircd->check_nick_id)
+ {
+ if (na && na->nc == user->Account())
+ {
+ user->SetMode(findbot(Config.s_NickServ), UMODE_REGISTERED);
+ }
+ }
+
+ if (ircd->sqline)
+ {
+ if (!is_oper(user) && check_sqline(user->nick.c_str(), 1))
+ return NULL;
}
}
}