Thread: [srvx-commits] CVS: services/src proto-bahamut.c,1.29,1.30 proto-p10.c,1.54,1.55
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2003-01-04 06:25:23
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv13224/src
Modified Files:
proto-bahamut.c proto-p10.c
Log Message:
do not call mod_usermode() until user is inserted into clients dict;
this way mode callbacks can send the user a message
generate a "genuine" nick collision to override a user using a
service's nick
don't call oper callback funcs on local users
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** proto-bahamut.c 2 Jan 2003 23:11:34 -0000 1.29
--- proto-bahamut.c 4 Jan 2003 06:25:20 -0000 1.30
***************
*** 143,158 ****
pol_params = IsOper(uNode) ? oper_policer_params : luser_policer_params;
uNode->command_policer = policer_new(pol_params, uNode->timestamp);
- mod_usermode(uNode, modes);
/* does the nick already exist? if so, how to handle? */
if ((oldUser = GetUserH(nick))) {
! if (oldUser->uplink == self) {
! /* Since we want services to be authoritative over
! * other servers, we'll issue a KILL regardless of
! * timestamp comparisons. If this other user is +k,
! * then somebody screwed up. */
! irc_kill(NULL, uNode, "Nick collision");
}
! } else {
dict_insert(clients, uNode->nick, uNode);
if (dict_size(clients) > max_clients) {
--- 143,160 ----
pol_params = IsOper(uNode) ? oper_policer_params : luser_policer_params;
uNode->command_policer = policer_new(pol_params, uNode->timestamp);
/* does the nick already exist? if so, how to handle? */
if ((oldUser = GetUserH(nick))) {
! if (IsLocal(oldUser) && IsService(oldUser)) {
! oldUser->timestamp = uNode->timestamp - 1;
! irc_user(oldUser);
}
! if (oldUser->timestamp > uNode->timestamp) {
! DelUser(oldUser, NULL, false, "Newer nick overruled");
! oldUser = NULL;
! }
! }
!
! if (!oldUser) {
dict_insert(clients, uNode->nick, uNode);
if (dict_size(clients) > max_clients) {
***************
*** 162,165 ****
--- 164,168 ----
}
+ mod_usermode(uNode, modes);
if (IsLocal(uNode)) irc_user(uNode);
for (nn=0; nn<nuf_used; nn++) {
***************
*** 1059,1063 ****
{
unsigned int n;
!
for (n=0; n<of_used; n++)
{
--- 1062,1066 ----
{
unsigned int n;
! if (IsLocal(user)) return;
for (n=0; n<of_used; n++)
{
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** proto-p10.c 3 Jan 2003 23:59:59 -0000 1.54
--- proto-p10.c 4 Jan 2003 06:25:20 -0000 1.55
***************
*** 1794,1810 ****
pol_params = IsOper(uNode) ? oper_policer_params : luser_policer_params;
uNode->command_policer = policer_new(pol_params, uNode->timestamp);
- mod_usermode(uNode, modes);
uNode->num_local = base64toint(numeric+strlen(uNode->uplink->numeric), 3) & uNode->uplink->num_mask;
- /* does the nick already exist? if so, how to handle? */
if ((oldUser = GetUserH(nick))) {
! if (oldUser->uplink == self) {
! /* Since we want services to be authoritative over
! * other servers, we'll issue a KILL regardless of
! * timestamp comparisons. If this other user is +k,
! * then somebody screwed up. */
! irc_kill(NULL, uNode, "Nick collision");
}
! } else {
dict_insert(clients, uNode->nick, uNode);
if (dict_size(clients) > max_clients) {
--- 1794,1811 ----
pol_params = IsOper(uNode) ? oper_policer_params : luser_policer_params;
uNode->command_policer = policer_new(pol_params, uNode->timestamp);
uNode->num_local = base64toint(numeric+strlen(uNode->uplink->numeric), 3) & uNode->uplink->num_mask;
+ uNode->uplink->users[uNode->num_local] = uNode;
if ((oldUser = GetUserH(nick))) {
! if (IsLocal(oldUser) && IsService(oldUser)) {
! oldUser->timestamp = uNode->timestamp - 1;
! irc_user(oldUser);
}
! if (oldUser->timestamp > uNode->timestamp) {
! oldUser = NULL;
! }
! }
!
! if (!oldUser) {
dict_insert(clients, uNode->nick, uNode);
if (dict_size(clients) > max_clients) {
***************
*** 1814,1825 ****
}
! uNode->uplink->users[uNode->num_local] = uNode;
!
if (IsLocal(uNode)) irc_user(uNode);
-
for (n=0; n<nuf_used; n++) {
if (nuf_list[n](uNode)) break;
}
-
return uNode;
}
--- 1815,1823 ----
}
! mod_usermode(uNode, modes);
if (IsLocal(uNode)) irc_user(uNode);
for (n=0; n<nuf_used; n++) {
if (nuf_list[n](uNode)) break;
}
return uNode;
}
***************
*** 1869,1873 ****
* a list of clients that get freed after processing each line.
*/
! userList_append(&dead_users, user);
}
--- 1867,1875 ----
* a list of clients that get freed after processing each line.
*/
! if (dead_users.size) {
! userList_append(&dead_users, user);
! } else {
! free(user);
! }
}
***************
*** 2322,2328 ****
{
unsigned int n;
!
! for (n=0; n<of_used; n++)
! {
of_list[n](user);
}
--- 2324,2329 ----
{
unsigned int n;
! if (IsLocal(user)) return;
! for (n=0; n<of_used; n++) {
of_list[n](user);
}
|