srvx-commits Mailing List for srvx IRC Services (Page 18)
Brought to you by:
entrope
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(80) |
Sep
(51) |
Oct
(94) |
Nov
(132) |
Dec
(85) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(163) |
Feb
(96) |
Mar
(70) |
Apr
(182) |
May
(173) |
Jun
(73) |
Jul
(101) |
Aug
(101) |
Sep
(71) |
Oct
(76) |
Nov
(58) |
Dec
(60) |
| 2003 |
Jan
(61) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(7) |
Jun
(22) |
Jul
(81) |
Aug
(41) |
Sep
(34) |
Oct
(41) |
Nov
(16) |
Dec
(28) |
| 2004 |
Jan
(7) |
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2005 |
Jan
(13) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Entrope <en...@us...> - 2003-01-24 18:17:05
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2410/src
Modified Files:
opserv.c
Log Message:
fix opserv_debug() and opserv_alert() in case somebody forgets to use a format
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.306
retrieving revision 1.307
diff -C2 -r1.306 -r1.307
*** opserv.c 21 Jan 2003 00:56:24 -0000 1.306
--- opserv.c 24 Jan 2003 18:16:56 -0000 1.307
***************
*** 371,376 ****
#define opserv_notice(target, format...) send_message(target , opserv , ## format)
! #define opserv_debug(format...) do { if (opserv_conf.debug_channel) send_channel_notice(opserv_conf.debug_channel , opserv, ## format); } while (0)
! #define opserv_alert(format...) do { if (opserv_conf.alert_channel) send_channel_notice(opserv_conf.alert_channel , opserv, ## format); } while (0)
/* A lot of these commands are very similar to what ChanServ can do,
--- 371,376 ----
#define opserv_notice(target, format...) send_message(target , opserv , ## format)
! #define opserv_debug(format...) do { if (opserv_conf.debug_channel) send_channel_notice(opserv_conf.debug_channel , opserv , ## format); } while (0)
! #define opserv_alert(format...) do { if (opserv_conf.alert_channel) send_channel_notice(opserv_conf.alert_channel , opserv , ## format); } while (0)
/* A lot of these commands are very similar to what ChanServ can do,
|
|
From: Entrope <en...@us...> - 2003-01-21 04:00:28
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10318/src
Modified Files:
nickserv.c
Log Message:
finish changing default hostmask to *@*.example.isp
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.229
retrieving revision 1.230
diff -C2 -r1.229 -r1.230
*** nickserv.c 21 Jan 2003 00:56:27 -0000 1.229
--- nickserv.c 21 Jan 2003 04:00:11 -0000 1.230
***************
*** 1135,1139 ****
}
} else if ((settee = GetUserH(argv[3]))) {
! mask = generate_hostmask(settee, GENMASK_OMITNICK|GENMASK_NO_HIDING);
} else {
nickserv_notice(user, NSMSG_REGISTER_BAD_NICKMASK, argv[3]);
--- 1135,1139 ----
}
} else if ((settee = GetUserH(argv[3]))) {
! mask = generate_hostmask(settee, GENMASK_OMITNICK|GENMASK_NO_HIDING|GENMASK_ANY_IDENT);
} else {
nickserv_notice(user, NSMSG_REGISTER_BAD_NICKMASK, argv[3]);
***************
*** 1757,1761 ****
{
if (argc < 2) {
! char *mask = generate_hostmask(user, GENMASK_OMITNICK|GENMASK_NO_HIDING);
int res = nickserv_addmask(user, user->handle_info, mask);
free(mask);
--- 1757,1761 ----
{
if (argc < 2) {
! char *mask = generate_hostmask(user, GENMASK_OMITNICK|GENMASK_NO_HIDING|GENMASK_ANY_IDENT);
int res = nickserv_addmask(user, user->handle_info, mask);
free(mask);
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11371/src
Modified Files:
proto.h proto-p10.c proto-bahamut.c opserv.c nickserv.c
modcmd.c main.c helpserv.c hash.h hash.c
Log Message:
change uNode->nick from char[NICKLEN+1] to char*
change second arg of nick_change callbacks from new_nick to old_nick
bump MAXBANS to 45 to match new ircu defaults
make MODCMD_REQUIRE_JOINABLE apply to +s channels
check dict sanity at end of replays
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -r1.70 -r1.71
*** proto.h 10 Jan 2003 03:36:26 -0000 1.70
--- proto.h 21 Jan 2003 00:56:19 -0000 1.71
***************
*** 121,125 ****
void irc_server(struct server *srv);
void irc_user(struct userNode *user);
! void irc_nick(struct userNode *user, const char *new_nick);
void irc_introduce(const char *passwd);
void irc_ping(const char *something);
--- 121,125 ----
void irc_server(struct server *srv);
void irc_user(struct userNode *user);
! void irc_nick(struct userNode *user, const char *old_nick);
void irc_introduce(const char *passwd);
void irc_ping(const char *something);
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -r1.58 -r1.59
*** proto-p10.c 10 Jan 2003 03:36:26 -0000 1.58
--- proto-p10.c 21 Jan 2003 00:56:19 -0000 1.59
***************
*** 415,421 ****
void
! irc_nick(struct userNode *user, const char *new_nick)
{
! putsock("%s " P10_NICK " %s "FMT_TIME_T, user->numeric, new_nick, now);
}
--- 415,422 ----
void
! irc_nick(struct userNode *user, const char *old_nick)
{
! (void)old_nick;
! putsock("%s " P10_NICK " %s "FMT_TIME_T, user->numeric, user->nick, now);
}
***************
*** 728,732 ****
for (nn=0; nn<=self->num_mask; nn++) {
if (!(user = self->users[nn])) continue;
! strncpy(new_nick, user->nick, sizeof(new_nick));
new_nick[nicklen] = 0;
NickChange(user, new_nick, 1);
--- 729,733 ----
for (nn=0; nn<=self->num_mask; nn++) {
if (!(user = self->users[nn])) continue;
! safestrncpy(new_nick, user->nick, sizeof(new_nick));
new_nick[nicklen] = 0;
NickChange(user, new_nick, 1);
***************
*** 857,860 ****
--- 858,868 ----
static void
+ join_helper(struct chanNode *chan, void *data)
+ {
+ struct create_desc *cd = data;
+ AddChannelUser(cd->user, chan);
+ }
+
+ static void
create_helper(char *name, void *data)
{
***************
*** 868,871 ****
--- 876,890 ----
}
+ static void
+ join_0_helper(char *name, void *data)
+ {
+ struct create_desc *cd = data;
+ if (!strcmp(name, "0")) {
+ while (cd->user->channels.used>0) {
+ DelChannelUser(cd->user, cd->user->channels.list[cd->user->channels.used-1]->channel, 0, 0);
+ }
+ }
+ }
+
static CMD_FUNC(cmd_create)
{
***************
*** 874,887 ****
if (argc < 3) return 0;
! user = GetUserH(origin);
! if(!user) {
! /* The CREATE from this user probably crossed a KILL
! for the very same user. Bail. */
! return 0;
! }
!
cd.user = user;
cd.when = atoi(argv[2]);
! parse_foreach(argv[1], NULL, create_helper, NULL, NULL, &cd);
return 1;
}
--- 893,915 ----
if (argc < 3) return 0;
! if (!(user = GetUserH(origin))) return 0;
cd.user = user;
cd.when = atoi(argv[2]);
! parse_foreach(argv[1], join_helper, create_helper, NULL, NULL, &cd);
! return 1;
! }
!
! static CMD_FUNC(cmd_join)
! {
! struct create_desc cd;
!
! if (argc < 3) {
! if (argc < 2) return 0;
! cd.when = now;
! } else {
! cd.when = atoi(argv[2]);
! }
! if (!(cd.user = GetUserH(origin))) return 0;
! parse_foreach(argv[1], join_helper, create_helper, NULL, join_0_helper, &cd);
return 1;
}
***************
*** 949,952 ****
--- 977,981 ----
long mode;
char *user, *end, sep;
+ time_t in_timestamp;
(void)origin;
***************
*** 970,979 ****
}
! if (self->burst && (cNode = GetChannel(argv[1])) && dict_find(unbursted_channels, cNode->name, NULL)) {
! cNode->timestamp = atoi(argv[2]);
dict_remove(unbursted_channels, cNode->name);
irc_burst(cNode);
}
! cNode = AddChannel(argv[1], (time_t)atoi(argv[2]), modes, banlist);
/* Burst channel members in now. */
--- 999,1011 ----
}
! in_timestamp = atoi(argv[2]);
! if (self->burst
! && dict_find(unbursted_channels, argv[1], NULL)
! && (cNode = GetChannel(argv[1]))) {
! cNode->timestamp = in_timestamp;
dict_remove(unbursted_channels, cNode->name);
irc_burst(cNode);
}
! cNode = AddChannel(argv[1], in_timestamp, modes, banlist);
/* Burst channel members in now. */
***************
*** 1184,1229 ****
}
- static CMD_FUNC(cmd_join)
- {
- struct userNode *user;
- char old, *j, *target_list;
- int failed;
- struct chanNode *cn;
-
- if (argc < 2) return 0;
- if (!(user = GetUserH(origin))) {
- log(MAIN_LOG, LOG_ERROR, "Unable to find user %s joining a channel\n", origin);
- return 0;
- }
- target_list = argv[1];
- failed = 0;
- do {
- j = target_list;
- while (*j != 0 && *j != ',') j++;
- old = *j;
- *j = 0;
- if (IsChannelName(target_list)) {
- if ((cn = GetChannel(target_list))) {
- AddChannelUser(user, cn);
- } else if ((cn = AddChannel(target_list, 0, NULL, NULL))) {
- struct modeNode *mn = AddChannelUser(user, cn);
- if (mn) mn->modes = MODE_CHANOP;
- } else {
- log(MAIN_LOG, LOG_ERROR, "Unable to find or create join target %s\n", target_list);
- failed = 1;
- }
- } else if (!strcmp(target_list, "0")) {
- while (user->channels.used > 0) {
- DelChannelUser(user, user->channels.list[user->channels.used-1]->channel, false, 0);
- }
- } else {
- log(MAIN_LOG, LOG_ERROR, "Bad join target %s\n", target_list);
- failed = 1;
- }
- target_list = j+1;
- } while (old == ',');
- return !failed;
- }
-
static CMD_FUNC(cmd_part)
{
--- 1216,1219 ----
***************
*** 1799,1803 ****
/* create new usernode and set all values */
uNode = calloc(1, sizeof(*uNode));
! safestrncpy(uNode->nick, nick, sizeof(uNode->nick));
safestrncpy(uNode->ident, ident, sizeof(uNode->ident));
safestrncpy(uNode->info, userinfo, sizeof(uNode->info));
--- 1789,1793 ----
/* create new usernode and set all values */
uNode = calloc(1, sizeof(*uNode));
! uNode->nick = strdup(nick);
safestrncpy(uNode->ident, ident, sizeof(uNode->ident));
safestrncpy(uNode->info, userinfo, sizeof(uNode->info));
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** proto-bahamut.c 16 Jan 2003 23:06:49 -0000 1.34
--- proto-bahamut.c 21 Jan 2003 00:56:20 -0000 1.35
***************
*** 145,149 ****
uNode = calloc(1, sizeof(*uNode));
! safestrncpy(uNode->nick, nick, sizeof(uNode->nick));
safestrncpy(uNode->ident, ident, sizeof(uNode->ident));
safestrncpy(uNode->info, userinfo, sizeof(uNode->info));
--- 145,149 ----
uNode = calloc(1, sizeof(*uNode));
! uNode->nick = strdup(nick);
safestrncpy(uNode->ident, ident, sizeof(uNode->ident));
safestrncpy(uNode->info, userinfo, sizeof(uNode->info));
***************
*** 269,282 ****
void
! irc_nick(struct userNode *user, const char *new_nick) {
if (user->uplink == self) {
/* update entries in PRIVMSG/NOTICE handlers (if they exist) */
struct service_message_info *smi = dict_find(service_msginfo_dict, user->nick, NULL);
if (smi) {
! dict_remove2(service_msginfo_dict, user->nick, 1);
! dict_insert(service_msginfo_dict, new_nick, smi);
}
}
! putsock(":%s NICK %s :"FMT_TIME_T, user->nick, new_nick, user->timestamp);
}
--- 269,282 ----
void
! irc_nick(struct userNode *user, const char *old_nick) {
if (user->uplink == self) {
/* update entries in PRIVMSG/NOTICE handlers (if they exist) */
struct service_message_info *smi = dict_find(service_msginfo_dict, user->nick, NULL);
if (smi) {
! dict_remove2(service_msginfo_dict, old_nick, 1);
! dict_insert(service_msginfo_dict, user->nick, smi);
}
}
! putsock(":%s NICK %s :"FMT_TIME_T, old_nick, user->nick, user->timestamp);
}
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.305
retrieving revision 1.306
diff -C2 -r1.305 -r1.306
*** opserv.c 7 Jan 2003 05:02:08 -0000 1.305
--- opserv.c 21 Jan 2003 00:56:24 -0000 1.306
***************
*** 3622,3632 ****
static void
! opserv_alert_check_nick(struct userNode *user, const char *new_nick)
{
! char old_nick[NICKLEN+1];
! strcpy(old_nick, user->nick);
! strcpy(user->nick, new_nick);
dict_foreach(opserv_nick_based_alerts, alert_check_user, user);
- strcpy(user->nick, old_nick);
}
--- 3622,3629 ----
static void
! opserv_alert_check_nick(struct userNode *user, const char *old_nick)
{
! (void)old_nick;
dict_foreach(opserv_nick_based_alerts, alert_check_user, user);
}
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.228
retrieving revision 1.229
diff -C2 -r1.228 -r1.229
*** nickserv.c 16 Jan 2003 23:09:47 -0000 1.228
--- nickserv.c 21 Jan 2003 00:56:27 -0000 1.229
***************
*** 3210,3229 ****
static int
! check_user_nick(struct userNode *user, const char *nick) {
struct nick_info *ni;
user->modes &= ~FLAGS_REGNICK;
! if (!(ni = get_nick_info(nick))) return 0;
if (user->handle_info == ni->owner) {
user->modes |= FLAGS_REGNICK;
! /* Yes, I want a pointer compare. Compare handle_new_user()
! * to handle_nick_change(). */
! if (nick != user->nick) {
! /* Note to self: Use garbage collected pointers next time. Asshat. */
! char old_nick[NICKLEN+1];
! strcpy(old_nick, user->nick);
! strcpy(user->nick, nick);
! irc_regnick(user);
! strcpy(user->nick, nick);
! }
return 0;
}
--- 3210,3220 ----
static int
! check_user_nick(struct userNode *user) {
struct nick_info *ni;
user->modes &= ~FLAGS_REGNICK;
! if (!(ni = get_nick_info(user->nick))) return 0;
if (user->handle_info == ni->owner) {
user->modes |= FLAGS_REGNICK;
! irc_regnick(user);
return 0;
}
***************
*** 3243,3247 ****
handle_new_user(struct userNode *user)
{
! return check_user_nick(user, user->nick);
}
--- 3234,3238 ----
handle_new_user(struct userNode *user)
{
! return check_user_nick(user);
}
***************
*** 3268,3289 ****
void
! handle_nick_change(struct userNode *user, const char *new_nick)
{
struct handle_info *hi;
! if ((hi = dict_find(nickserv_allow_auth_dict, user->nick, 0))) {
! char old_nick[NICKLEN+1];
! /* Need to update allow_auth_dict. However, new_nick may be a
! * temporary pointer. The dict stores the key pointer. Make
! * sure it knows about the change but still points to
! * user->nick. */
! dict_remove(nickserv_allow_auth_dict, user->nick);
! strcpy(old_nick, user->nick);
! strcpy(user->nick, new_nick);
dict_insert(nickserv_allow_auth_dict, user->nick, hi);
- strcpy(user->nick, old_nick);
}
timeq_del(0, nickserv_reclaim_p, user, TIMEQ_IGNORE_WHEN);
! check_user_nick(user, new_nick);
}
--- 3259,3272 ----
void
! handle_nick_change(struct userNode *user, const char *old_nick)
{
struct handle_info *hi;
! if ((hi = dict_find(nickserv_allow_auth_dict, old_nick, 0))) {
! dict_remove(nickserv_allow_auth_dict, old_nick);
dict_insert(nickserv_allow_auth_dict, user->nick, hi);
}
timeq_del(0, nickserv_reclaim_p, user, TIMEQ_IGNORE_WHEN);
! check_user_nick(user);
}
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -r1.48 -r1.49
*** modcmd.c 8 Jan 2003 23:51:41 -0000 1.48
--- modcmd.c 21 Jan 2003 00:56:27 -0000 1.49
***************
*** 472,476 ****
if (flags & MODCMD_REQUIRE_JOINABLE) {
if (!uData_checked) uData = _GetChannelUser(channel->channel_info, user->handle_info, 1, 0), uData_checked = 1;
! if ((channel->modes & (MODE_INVITEONLY|MODE_KEY))
&& (!channel->channel_info || !uData)
&& !IsService(user)
--- 472,476 ----
if (flags & MODCMD_REQUIRE_JOINABLE) {
if (!uData_checked) uData = _GetChannelUser(channel->channel_info, user->handle_info, 1, 0), uData_checked = 1;
! if ((channel->modes & (MODE_INVITEONLY|MODE_KEY|MODE_SECRET))
&& (!channel->channel_info || !uData)
&& !IsService(user)
***************
*** 1587,1599 ****
void
! modcmd_nick_change(struct userNode *user, const char *new_nick) {
! char old_nick[NICKLEN+1];
struct service *svc;
! if (!(svc = dict_find(services, user->nick, NULL))) return;
! dict_remove2(services, user->nick, 1);
! safestrncpy(old_nick, user->nick, sizeof(old_nick));
! safestrncpy(user->nick, new_nick, sizeof(user->nick));
dict_insert(services, user->nick, svc);
- safestrncpy(user->nick, old_nick, sizeof(user->nick));
}
--- 1587,1595 ----
void
! modcmd_nick_change(struct userNode *user, const char *old_nick) {
struct service *svc;
! if (!(svc = dict_find(services, old_nick, NULL))) return;
! dict_remove2(services, old_nick, 1);
dict_insert(services, user->nick, svc);
}
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -C2 -r1.144 -r1.145
*** main.c 9 Nov 2002 01:29:55 -0000 1.144
--- main.c 21 Jan 2003 00:56:27 -0000 1.145
***************
*** 794,800 ****
--- 794,813 ----
reg_exit_func(saxdb_write_all);
if (replay_file) {
+ char *msg;
log(MAIN_LOG, LOG_INFO, "Beginning replay...\n");
srand(now);
replay_event_loop();
+ if ((msg = dict_sanity_check(clients))) {
+ log(MAIN_LOG, LOG_ERROR, "Clients insanity: %s\n", msg);
+ free(msg);
+ }
+ if ((msg = dict_sanity_check(channels))) {
+ log(MAIN_LOG, LOG_ERROR, "Channels insanity: %s\n", msg);
+ free(msg);
+ }
+ if ((msg = dict_sanity_check(servers))) {
+ log(MAIN_LOG, LOG_ERROR, "Servers insanity: %s\n", msg);
+ free(msg);
+ }
} else {
srand(time(&now));
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -r1.62 -r1.63
*** helpserv.c 16 Jan 2003 23:18:11 -0000 1.62
--- helpserv.c 21 Jan 2003 00:56:27 -0000 1.63
***************
*** 3610,3636 ****
/* Update helpserv_reqs_bynick_dict upon nick change */
! static void handle_nickchange(struct userNode *user, const char *new_nick) {
! char old_nick[NICKLEN+1];
struct helpserv_reqlist *reqlist;
unsigned int i;
! if (!(reqlist = dict_find(helpserv_reqs_bynick_dict, user->nick, NULL))) {
return;
}
! /* Don't free the list */
! dict_remove2(helpserv_reqs_bynick_dict, user->nick, 1);
!
! /* new_nick may be a temporary pointer. The dict stores the key pointer.
! * Make sure it knows about the change but still points to user->nick. */
! strcpy(old_nick, user->nick);
! strcpy(user->nick, new_nick);
dict_insert(helpserv_reqs_bynick_dict, user->nick, reqlist);
- strcpy(user->nick, old_nick);
for (i=0; i < reqlist->used; i++) {
struct helpserv_request *req=reqlist->list[i];
! if (req->helper && (req->hs->notify >= NOTIFY_USER)) helpserv_notify(req->helper, HSMSG_NOTIFY_USER_NICK, req->id, user->nick, new_nick);
}
}
--- 3610,3629 ----
/* Update helpserv_reqs_bynick_dict upon nick change */
! static void handle_nickchange(struct userNode *user, const char *old_nick) {
struct helpserv_reqlist *reqlist;
unsigned int i;
! if (!(reqlist = dict_find(helpserv_reqs_bynick_dict, old_nick, NULL))) {
return;
}
! /* Don't free the list when we switch it over to the new nick. */
! dict_remove2(helpserv_reqs_bynick_dict, old_nick, 1);
dict_insert(helpserv_reqs_bynick_dict, user->nick, reqlist);
for (i=0; i < reqlist->used; i++) {
struct helpserv_request *req=reqlist->list[i];
! if (req->helper && (req->hs->notify >= NOTIFY_USER)) helpserv_notify(req->helper, HSMSG_NOTIFY_USER_NICK, req->id, old_nick, user->nick);
}
}
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -r1.99 -r1.100
*** hash.h 10 Jan 2003 03:36:26 -0000 1.99
--- hash.h 21 Jan 2003 00:56:27 -0000 1.100
***************
*** 81,85 ****
#define MAXMODEPARAMS 6
! #define MAXBANS 30
/* IDLEN is 6 because it takes 5.33 Base64 digits to store 32 bytes. */
--- 81,85 ----
#define MAXMODEPARAMS 6
! #define MAXBANS 45
/* IDLEN is 6 because it takes 5.33 Base64 digits to store 32 bytes. */
***************
*** 93,97 ****
struct userNode {
! char nick[NICKLEN + 1]; /* Unique name of the client, nick or host */
char ident[USERLEN + 1]; /* Per-host identification for user */
char info[REALLEN + 1]; /* Free form additional client information */
--- 93,97 ----
struct userNode {
! char *nick; /* Unique name of the client, nick or host */
char ident[USERLEN + 1]; /* Per-host identification for user */
char info[REALLEN + 1]; /* Free form additional client information */
***************
*** 198,202 ****
void unreg_del_user_func(del_user_func_t handler);
void ReintroduceUser(struct userNode* user);
! typedef void (*nick_change_func_t)(struct userNode *user, const char *new_nick);
void reg_nick_change_func(nick_change_func_t handler);
void NickChange(struct userNode* user, const char *new_nick, int no_announce);
--- 198,202 ----
void unreg_del_user_func(del_user_func_t handler);
void ReintroduceUser(struct userNode* user);
! typedef void (*nick_change_func_t)(struct userNode *user, const char *old_nick);
void reg_nick_change_func(nick_change_func_t handler);
void NickChange(struct userNode* user, const char *new_nick, int no_announce);
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -C2 -r1.171 -r1.172
*** hash.c 7 Jan 2003 04:23:12 -0000 1.171
--- hash.c 21 Jan 2003 00:56:29 -0000 1.172
***************
*** 166,198 ****
NickChange(struct userNode* user, const char *new_nick, int no_announce)
{
unsigned int nn;
/* don't do anything if there's no change */
! if (!strncmp(new_nick, user->nick, NICKLEN)) return;
/* remove old entry from clients dictionary */
! dict_remove(clients, user->nick);
#if !defined(WITH_PROTOCOL_P10)
/* Remove from uplink's clients dict */
! dict_remove(user->uplink->users, user->nick);
#endif
! /* Make callbacks for nick changes.
! * This needs to be done with the old nick still in place, else
! * dict lookups based on user->nick will miss the user.
*/
for (nn=0; nn<ncf2_used; nn++) {
! ncf2_list[nn](user, new_nick);
}
-
user->timestamp = now;
! if (IsLocal(user) && !no_announce) irc_nick(user, new_nick);
! /* Copy new nick into user structure */
! safestrncpy(user->nick, new_nick, sizeof(user->nick));
! /* Reinsert into dicts with the new nick */
! dict_insert(clients, user->nick, user);
! #if !defined(WITH_PROTOCOL_P10)
! dict_insert(user->uplink->users, user->nick, user);
! #endif
}
--- 166,198 ----
NickChange(struct userNode* user, const char *new_nick, int no_announce)
{
+ char *old_nick;
unsigned int nn;
/* don't do anything if there's no change */
! old_nick = user->nick;
! if (!strncmp(new_nick, old_nick, NICKLEN)) return;
/* remove old entry from clients dictionary */
! dict_remove(clients, old_nick);
#if !defined(WITH_PROTOCOL_P10)
/* Remove from uplink's clients dict */
! dict_remove(user->uplink->users, old_nick);
! #endif
! /* and reinsert */
! user->nick = strdup(new_nick);
! dict_insert(clients, user->nick, user);
! #if !defined(WITH_PROTOCOL_P10)
! dict_insert(user->uplink->users, user->nick, user);
#endif
! /* Make callbacks for nick changes. Do this with new nick in
! * place because that is slightly more useful.
*/
for (nn=0; nn<ncf2_used; nn++) {
! ncf2_list[nn](user, old_nick);
}
user->timestamp = now;
! if (IsLocal(user) && !no_announce) irc_nick(user, old_nick);
! free(old_nick);
}
|
|
From: Entrope <en...@us...> - 2003-01-20 23:48:20
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv12073/src
Modified Files:
sockcheck.c
Log Message:
also assign client->fd in sockcheck_begin_test, so that a long-delayed
connect() can be cancelled
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -r1.84 -r1.85
*** sockcheck.c 20 Jan 2003 23:33:03 -0000 1.84
--- sockcheck.c 20 Jan 2003 23:48:17 -0000 1.85
***************
*** 637,641 ****
client->read_pos = 0;
client->read_used = 0;
! io_fd = ioset_connect((struct sockaddr*)sockcheck_conf.local_addr, sizeof(struct sockaddr), client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
if (!io_fd) {
client->test_index++;
--- 637,641 ----
client->read_pos = 0;
client->read_used = 0;
! client->fd = io_fd = ioset_connect((struct sockaddr*)sockcheck_conf.local_addr, sizeof(struct sockaddr), client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
if (!io_fd) {
client->test_index++;
|
|
From: Entrope <en...@us...> - 2003-01-20 23:44:46
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10621/src
Modified Files:
opserv.help
Log Message:
remove mention of the (removed) "scan" option for trace
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** opserv.help 14 Dec 2002 01:07:12 -0000 1.56
--- opserv.help 20 Jan 2003 23:44:42 -0000 1.57
***************
*** 57,61 ****
"$bPRINT$b: Display the hostmask to you.",
"$bCOUNT$b: Count all matching users.",
- "$bSCAN$b: Perform a proxy scan on the host.",
"$bKILL$b: Kill matching clients.",
"$bGLINE$b: Issue a gline for the client's host (by default, 1 hour long).",
--- 57,60 ----
|
|
From: Entrope <en...@us...> - 2003-01-20 23:33:09
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5964/src
Modified Files:
sockcheck.c
Log Message:
assign client->fd inside sockcheck_connected(), so it can be called
before ioset_connect() returns
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -r1.83 -r1.84
*** sockcheck.c 7 Jan 2003 04:31:13 -0000 1.83
--- sockcheck.c 20 Jan 2003 23:33:03 -0000 1.84
***************
*** 603,606 ****
--- 603,607 ----
{
struct sockcheck_client *client = fd->data;
+ client->fd = fd;
switch (rc) {
default:
***************
*** 636,640 ****
client->read_pos = 0;
client->read_used = 0;
! client->fd = io_fd = ioset_connect((struct sockaddr*)sockcheck_conf.local_addr, sizeof(struct sockaddr), client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
if (!io_fd) {
client->test_index++;
--- 637,641 ----
client->read_pos = 0;
client->read_used = 0;
! io_fd = ioset_connect((struct sockaddr*)sockcheck_conf.local_addr, sizeof(struct sockaddr), client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
if (!io_fd) {
client->test_index++;
|
|
From: Entrope <en...@us...> - 2003-01-17 03:18:37
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv18963/src
Modified Files:
sendmail.c
Log Message:
use waitpid() and loop until we find the child (or get a non-EINTR errno)
Index: sendmail.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sendmail.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** sendmail.c 10 Jan 2003 01:43:22 -0000 1.8
--- sendmail.c 17 Jan 2003 03:18:33 -0000 1.9
***************
*** 187,192 ****
fflush(out);
fclose(out);
! rv = wait(&res);
! if ((rv == child) || ((rv == -1) && (errno == EINTR))) {
/* accept the wait() result */
} else {
--- 187,194 ----
fflush(out);
fclose(out);
! do {
! rv = waitpid(child, &res, 0);
! } while ((rv == -1) && (errno == EINTR));
! if (rv == child) {
/* accept the wait() result */
} else {
|
|
From: Entrope <en...@us...> - 2003-01-16 23:19:10
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29215/src
Modified Files:
chanserv.c
Log Message:
hide nodelete channels from "/msg chanserv access oper" by helpers
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.331
retrieving revision 1.332
diff -C2 -r1.331 -r1.332
*** chanserv.c 10 Jan 2003 03:45:32 -0000 1.331
--- chanserv.c 16 Jan 2003 23:19:07 -0000 1.332
***************
*** 3382,3385 ****
--- 3382,3386 ----
for (cList = target_handle->channels; cList; cList = cList->next) {
if(cList->user->access == ulHelper) continue;
+ if(IsProtected(cList->channel) && !IsOper(user)) continue;
chanName = cList->channel->channel ? cList->channel->channel->name : cList->channel->suspended->name;
if(cList->user->info)
|
|
From: Entrope <en...@us...> - 2003-01-16 23:18:14
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv29064/src Modified Files: helpserv.c Log Message: adjust HSMSG_PAGE_WHINE_HEADER since we do not emit the spammy table any more Index: helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** helpserv.c 13 Jan 2003 01:39:13 -0000 1.61 --- helpserv.c 16 Jan 2003 23:18:11 -0000 1.62 *************** *** 200,204 **** #define HSMSG_PAGE_ASSIGN_REQUEST "Request ID#%lu from $b%s$b (Account %s) has been assigned to %s." #define HSMSG_PAGE_HELPER_GONE "Request ID#%lu from $b%s$b (Account %s) $bhas been unassigned$b, as its helper, %s has %s." ! #define HSMSG_PAGE_WHINE_HEADER "$b%u unhandled request%s$b waiting at least $b%s$b:" #define HSMSG_PAGE_IDLE_HEADER "$b%u users$b in %s $bidle at least %s$b:" #define HSMSG_PAGE_EMPTYALERT "$b%s has no helpers present$b" --- 200,204 ---- #define HSMSG_PAGE_ASSIGN_REQUEST "Request ID#%lu from $b%s$b (Account %s) has been assigned to %s." #define HSMSG_PAGE_HELPER_GONE "Request ID#%lu from $b%s$b (Account %s) $bhas been unassigned$b, as its helper, %s has %s." ! #define HSMSG_PAGE_WHINE_HEADER "$b%u unhandled request%s$b waiting at least $b%s$b" #define HSMSG_PAGE_IDLE_HEADER "$b%u users$b in %s $bidle at least %s$b:" #define HSMSG_PAGE_EMPTYALERT "$b%s has no helpers present$b" |
|
From: Entrope <en...@us...> - 2003-01-16 23:09:50
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28145/src
Modified Files:
nickserv.c
Log Message:
default to *@*.isp for generated hostmasks
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.227
retrieving revision 1.228
diff -C2 -r1.227 -r1.228
*** nickserv.c 12 Jan 2003 20:03:49 -0000 1.227
--- nickserv.c 16 Jan 2003 23:09:47 -0000 1.228
***************
*** 1086,1092 ****
string_list_append(hi->masks, strdup("*@*"));
} else {
! string_list_append(hi->masks, generate_hostmask(user, GENMASK_OMITNICK|GENMASK_NO_HIDING));
if (user->ip != 0) {
! string_list_append(hi->masks, generate_hostmask(user, GENMASK_OMITNICK|GENMASK_BYIP|GENMASK_NO_HIDING));
}
}
--- 1086,1092 ----
string_list_append(hi->masks, strdup("*@*"));
} else {
! string_list_append(hi->masks, generate_hostmask(user, GENMASK_OMITNICK|GENMASK_NO_HIDING|GENMASK_ANY_IDENT));
if (user->ip != 0) {
! string_list_append(hi->masks, generate_hostmask(user, GENMASK_OMITNICK|GENMASK_BYIP|GENMASK_NO_HIDING|GENMASK_ANY_IDENT));
}
}
|
|
From: Entrope <en...@us...> - 2003-01-16 23:06:52
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27727/src
Modified Files:
proto-bahamut.c
Log Message:
fix thinko (line ordering error)
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** proto-bahamut.c 10 Jan 2003 03:36:26 -0000 1.33
--- proto-bahamut.c 16 Jan 2003 23:06:49 -0000 1.34
***************
*** 730,735 ****
/* new nick from a server */
char id[8];
- if (argc < 10) return 0;
unsigned long stamp;
stamp = strtoul(argv[8], NULL, 0);
if (stamp) inttobase64(id, stamp, IDLEN);
--- 730,735 ----
/* new nick from a server */
char id[8];
unsigned long stamp;
+ if (argc < 10) return 0;
stamp = strtoul(argv[8], NULL, 0);
if (stamp) inttobase64(id, stamp, IDLEN);
|
|
From: Adrian D. <sai...@us...> - 2003-01-13 01:39:17
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28058
Modified Files:
helpserv.c
Log Message:
Show the nick/account in the "request dropped" messages (featreq #666532)
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -r1.60 -r1.61
*** helpserv.c 26 Dec 2002 05:06:01 -0000 1.60
--- helpserv.c 13 Jan 2003 01:39:13 -0000 1.61
***************
*** 221,225 ****
#define HSMSG_NOTIFY_ALLOWAUTH "The user for request ID#%lu, $b%s$b, has been permitted by %s to authenticate to account $b%s$b without hostmask checking."
#define HSMSG_NOTIFY_UNALLOWAUTH "The user for request ID#%lu, $b%s$b, has had their ability to authenticate without hostmask checking revoked by %s."
! #define HSMSG_NOTIFY_REQ_DROP "Request ID#%lu has been $bdropped$b because %s."
/* Presence and request-related messages */
--- 221,225 ----
#define HSMSG_NOTIFY_ALLOWAUTH "The user for request ID#%lu, $b%s$b, has been permitted by %s to authenticate to account $b%s$b without hostmask checking."
#define HSMSG_NOTIFY_UNALLOWAUTH "The user for request ID#%lu, $b%s$b, has had their ability to authenticate without hostmask checking revoked by %s."
! #define HSMSG_NOTIFY_REQ_DROP "Request ID#%lu (%s%s) has been $bdropped$b because %s."
/* Presence and request-related messages */
***************
*** 3343,3347 ****
helpserv_msguser(user, HSMSG_REQ_DROPPED_PART, chan->name, req->id);
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "they have left the help channel");
}
helpserv_log_request(req, "Dropped");
--- 3343,3347 ----
helpserv_msguser(user, HSMSG_REQ_DROPPED_PART, chan->name, req->id);
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "", user->nick, "they have left the help channel");
}
helpserv_log_request(req, "Dropped");
***************
*** 3430,3434 ****
sprintf(buf, "%lu", req->id);
! if (req->helper && (req->hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "the user has quit");
helpserv_log_request(req, "Dropped");
--- 3430,3434 ----
sprintf(buf, "%lu", req->id);
! if (req->helper && (req->hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "", req->user->nick, "the user has quit");
helpserv_log_request(req, "Dropped");
***************
*** 3911,3915 ****
char buf[12];
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "their account has been unregistered and no online users were authenticated to it");
sprintf(buf, "%lu", req->id);
helpserv_log_request(req, "Account unregistered");
--- 3911,3915 ----
char buf[12];
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "*", req->handle->handle, "their account has been unregistered and no online users were authenticated to it");
sprintf(buf, "%lu", req->id);
helpserv_log_request(req, "Account unregistered");
***************
*** 3942,3946 ****
helpserv_notice(user, HSMSG_REQ_DROPPED_UNREG, handle->handle, hs->helpchan->name, req->id);
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "their account has been unregistered and no online users were authenticated to it");
sprintf(buf, "%lu", req->id);
--- 3942,3946 ----
helpserv_notice(user, HSMSG_REQ_DROPPED_UNREG, handle->handle, hs->helpchan->name, req->id);
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "*", req->handle->handle, "their account has been unregistered and no online users were authenticated to it");
sprintf(buf, "%lu", req->id);
|
|
From: Entrope <en...@us...> - 2003-01-12 20:04:39
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27633/src
Modified Files:
nickserv.help.m4
Log Message:
replace $n with $N@$s (as was done other places in the file)
Index: nickserv.help.m4
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** nickserv.help.m4 18 Dec 2002 05:00:31 -0000 1.15
--- nickserv.help.m4 12 Jan 2003 20:04:32 -0000 1.16
***************
*** 41,45 ****
"$uSee Also:$u oregister");
! "UNREGISTER" ("/msg $n UNREGISTER <password>",
"Un-registers the account you are authenticated as.",
"$uSee Also:$u register");},
--- 41,45 ----
"$uSee Also:$u oregister");
! "UNREGISTER" ("/msg $N@$s UNREGISTER <password>",
"Un-registers the account you are authenticated as.",
"$uSee Also:$u register");},
|
|
From: Entrope <en...@us...> - 2003-01-12 20:03:57
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27145/src
Modified Files:
nickserv.c
Log Message:
do not unauth users when their account is suspended; instead, modcmd
will not let them use commands
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.226
retrieving revision 1.227
diff -C2 -r1.226 -r1.227
*** nickserv.c 10 Jan 2003 03:36:26 -0000 1.226
--- nickserv.c 12 Jan 2003 20:03:49 -0000 1.227
***************
*** 1866,1882 ****
}
- if (added & HI_FLAG_SUSPENDED) {
- struct userNode *un, *next;
-
- for (un = hi->users; un; un = next) {
- next = un->next_authed;
- un->handle_info = NULL;
- un->next_authed = NULL;
-
- nickserv_notice(un, NSMSG_HANDLE_SUSPENDED);
- }
- hi->users = NULL;
- }
-
if (after && !before) {
/* Add user to current helper list. */
--- 1866,1869 ----
|
|
From: Entrope <en...@us...> - 2003-01-10 03:45:35
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26748/src
Modified Files:
chanserv.c
Log Message:
put spaces in the !names output (as intended)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.330
retrieving revision 1.331
diff -C2 -r1.330 -r1.331
*** chanserv.c 8 Jan 2003 23:48:59 -0000 1.330
--- chanserv.c 10 Jan 2003 03:45:32 -0000 1.331
***************
*** 309,313 ****
/* Names information */
! #define CSMSG_CHANNEL_NAMES "Users in $b%s$b: %s"
#define CSMSG_END_NAMES "End of names in $b%s$b"
--- 309,313 ----
/* Names information */
! #define CSMSG_CHANNEL_NAMES "Users in $b%s$b:%s"
#define CSMSG_END_NAMES "End of names in $b%s$b"
***************
*** 4469,4477 ****
targData = GetTrueChannelAccess(channel->channel_info, targ->handle_info);
if (!targData) continue;
! if (pos + strlen(targ->nick) + strlen(targ->handle_info->handle) + 5 > sizeof(buf)) {
buf[pos] = 0;
send_message(user, cmd->parent->bot, CSMSG_CHANNEL_NAMES, channel->name, buf);
pos = 0;
}
if (IsUserSuspended(targData)) buf[pos++] = 's';
buf[pos++] = accessChars[targData->access];
--- 4469,4478 ----
targData = GetTrueChannelAccess(channel->channel_info, targ->handle_info);
if (!targData) continue;
! if (pos + strlen(targ->nick) + strlen(targ->handle_info->handle) + 6 > sizeof(buf)) {
buf[pos] = 0;
send_message(user, cmd->parent->bot, CSMSG_CHANNEL_NAMES, channel->name, buf);
pos = 0;
}
+ buf[pos++] = ' ';
if (IsUserSuspended(targData)) buf[pos++] = 's';
buf[pos++] = accessChars[targData->access];
|
|
From: Entrope <en...@us...> - 2003-01-10 03:36:29
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv25019/src
Modified Files:
hash.h nickserv.c proto-bahamut.c proto-p10.c proto.h
Log Message:
add (and support) service-set usermode +r under Bahamut
do not yell at stamped Bahamut users during their burst if they are
using their regged nick
send SVSMODE as NickServ rather than as server
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -r1.98 -r1.99
*** hash.h 6 Jan 2003 01:53:01 -0000 1.98
--- hash.h 10 Jan 2003 03:36:26 -0000 1.99
***************
*** 55,58 ****
--- 55,59 ----
#define FLAGS_STAMPED 0x1000 /* for users who have been stamped */
#define FLAGS_HIDDEN_HOST 0x2000 /* user's host is masked by their account */
+ #define FLAGS_REGNICK 0x4000 /* user owns their current nick */
#define IsOper(x) ((x)->modes & FLAGS_OPER)
***************
*** 68,71 ****
--- 69,73 ----
#define IsStamped(x) ((x)->modes & FLAGS_STAMPED)
#define IsHiddenHost(x) ((x)->modes & FLAGS_HIDDEN_HOST)
+ #define IsReggedNick(x) ((x)->modes & FLAGS_REGNICK)
#define IsLocal(x) ((x)->uplink == self)
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.225
retrieving revision 1.226
diff -C2 -r1.225 -r1.226
*** nickserv.c 7 Jan 2003 04:25:57 -0000 1.225
--- nickserv.c 10 Jan 2003 03:36:26 -0000 1.226
***************
*** 398,401 ****
--- 398,407 ----
{
struct nick_info *last, *next;
+ struct userNode *user;
+ /* Check to see if we should mark a user as unregistered. */
+ if ((user = GetUserH(ni->nick)) && IsReggedNick(user)) {
+ user->modes &= ~FLAGS_REGNICK;
+ irc_regnick(user);
+ }
/* Remove ni from the nick_info linked list. */
if (ni == ni->owner->nicks) {
***************
*** 818,821 ****
--- 824,836 ----
char *id = hi->handle;
#endif
+ if (!nickserv_conf.disable_nicks) {
+ struct nick_info *ni;
+ for (ni = hi->nicks; ni; ni = ni->next) {
+ if (!irccasecmp(user->nick, ni->nick)) {
+ user->modes |= FLAGS_REGNICK;
+ break;
+ }
+ }
+ }
StampUser(user, id);
}
***************
*** 3210,3214 ****
check_user_nick(struct userNode *user, const char *nick) {
struct nick_info *ni;
! if (!(ni = get_nick_info(nick)) || (user->handle_info == ni->owner)) return 0;
if (nickserv_conf.warn_nick_owned) {
send_message(user, nickserv, NSMSG_RECLAIM_WARN, ni->nick, ni->owner->handle);
--- 3225,3244 ----
check_user_nick(struct userNode *user, const char *nick) {
struct nick_info *ni;
! user->modes &= ~FLAGS_REGNICK;
! if (!(ni = get_nick_info(nick))) return 0;
! if (user->handle_info == ni->owner) {
! user->modes |= FLAGS_REGNICK;
! /* Yes, I want a pointer compare. Compare handle_new_user()
! * to handle_nick_change(). */
! if (nick != user->nick) {
! /* Note to self: Use garbage collected pointers next time. Asshat. */
! char old_nick[NICKLEN+1];
! strcpy(old_nick, user->nick);
! strcpy(user->nick, nick);
! irc_regnick(user);
! strcpy(user->nick, nick);
! }
! return 0;
! }
if (nickserv_conf.warn_nick_owned) {
send_message(user, nickserv, NSMSG_RECLAIM_WARN, ni->nick, ni->owner->handle);
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** proto-bahamut.c 9 Jan 2003 05:43:24 -0000 1.32
--- proto-bahamut.c 10 Jan 2003 03:36:26 -0000 1.33
***************
*** 74,78 ****
DelServer(struct server* serv, int announce, const char *message) {
unsigned int nn;
! dict_iterator_t it;
if (!serv) return;
--- 74,78 ----
DelServer(struct server* serv, int announce, const char *message) {
unsigned int nn;
! dict_iterator_t it, next;
if (!serv) return;
***************
*** 85,89 ****
}
}
! for (it=dict_first(serv->users); it; it=iter_next(it)) {
DelUser(iter_data(it), NULL, false, "server delinking");
}
--- 85,90 ----
}
}
! for (it=dict_first(serv->users); it; it=next) {
! next = iter_next(it);
DelUser(iter_data(it), NULL, false, "server delinking");
}
***************
*** 113,117 ****
struct userNode *
! AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *userinfo, time_t timestamp, unsigned int realip) {
struct userNode *uNode, *oldUser;
struct policer_params *pol_params;
--- 114,118 ----
struct userNode *
! AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *userinfo, time_t timestamp, unsigned int realip, const char *stamp) {
struct userNode *uNode, *oldUser;
struct policer_params *pol_params;
***************
*** 166,169 ****
--- 167,171 ----
mod_usermode(uNode, modes);
+ if (stamp) call_account_func(uNode, stamp);
if (IsLocal(uNode)) irc_user(uNode);
for (nn=0; nn<nuf_used; nn++) {
***************
*** 178,182 ****
struct userNode *old_user = GetUserH(nick);
if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, nick, self->name, "+oik", desc, timestamp, (127<<24)|1);
}
--- 180,184 ----
struct userNode *old_user = GetUserH(nick);
if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, nick, self->name, "+oikr", desc, timestamp, (127<<24)|1, 0);
}
***************
*** 186,190 ****
struct userNode *old_user = GetUserH(nick);
if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, ident, hostname, "+i", desc, timestamp, (127<<24)|1);
}
--- 188,192 ----
struct userNode *old_user = GetUserH(nick);
if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, ident, hostname, "+ir", desc, timestamp, (127<<24)|1, 0);
}
***************
*** 238,241 ****
--- 240,244 ----
if (IsServNotice(user)) modes[modelen++] = 's';
if (IsDeaf(user)) modes[modelen++] = 'd';
+ if (IsReggedNick(user)) modes[modelen++] = 'r';
if (IsGlobal(user)) modes[modelen++] = 'g';
modes[modelen] = 0;
***************
*** 248,252 ****
irc_account(struct userNode *user, const char *stamp)
{
! irc_svsmode(user, "+d", base64toint(stamp, IDLEN));
}
--- 251,269 ----
irc_account(struct userNode *user, const char *stamp)
{
! if (IsReggedNick(user)) {
! irc_svsmode(user, "+rd", base64toint(stamp, IDLEN));
! } else {
! irc_svsmode(user, "+d", base64toint(stamp, IDLEN));
! }
! }
!
! void
! irc_regnick(struct userNode *user)
! {
! if (IsReggedNick(user)) {
! irc_svsmode(user, "+r", 0);
! } else {
! irc_svsmode(user, "-r", 0);
! }
}
***************
*** 367,374 ****
void
irc_svsmode(struct userNode *target, char *modes, unsigned long stamp) {
if (stamp) {
! putsock(":%s SVSMODE %s "FMT_TIME_T" %s %lu", self->name, target->nick, target->timestamp, modes, stamp);
} else {
! putsock(":%s SVSMODE %s "FMT_TIME_T" %s", self->name, target->nick, target->timestamp, modes);
}
}
--- 384,392 ----
void
irc_svsmode(struct userNode *target, char *modes, unsigned long stamp) {
+ extern struct userNode *nickserv;
if (stamp) {
! putsock(":%s SVSMODE %s "FMT_TIME_T" %s %lu", nickserv->nick, target->nick, target->timestamp, modes, stamp);
} else {
! putsock(":%s SVSMODE %s "FMT_TIME_T" %s", nickserv->nick, target->nick, target->timestamp, modes);
}
}
***************
*** 711,733 ****
} else {
/* new nick from a server */
if (argc < 10) return 0;
if (argc > 10) {
! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), atoi(argv[9]));
} else {
/* No IP address received. */
! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), 0);
! }
!
! if(un)
! {
! unsigned long stamp;
!
! stamp = strtoul(argv[8], NULL, 0);
! if (stamp) {
! char id[IDLEN + 1];
!
! inttobase64(id, stamp, IDLEN);
! call_account_func(un, id);
! }
}
}
--- 729,742 ----
} else {
/* new nick from a server */
+ char id[8];
if (argc < 10) return 0;
+ unsigned long stamp;
+ stamp = strtoul(argv[8], NULL, 0);
+ if (stamp) inttobase64(id, stamp, IDLEN);
if (argc > 10) {
! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), atoi(argv[9]), (stamp ? id : 0));
} else {
/* No IP address received. */
! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), 0, (stamp ? id : 0));
}
}
***************
*** 1084,1088 ****
int add = 1;
! if (!user || !mode_change || !*mode_change) return;
while (1) {
#define do_user_mode(FLAG) do { if (add) user->modes |= FLAG; else user->modes &= ~FLAG; } while (0)
--- 1093,1097 ----
int add = 1;
! if (!user || !mode_change) return;
while (1) {
#define do_user_mode(FLAG) do { if (add) user->modes |= FLAG; else user->modes &= ~FLAG; } while (0)
***************
*** 1113,1116 ****
--- 1122,1126 ----
case 's': do_user_mode(FLAGS_SERVNOTICE); break;
case 'd': do_user_mode(FLAGS_DEAF); break;
+ case 'r': do_user_mode(FLAGS_REGNICK); break;
case 'k': do_user_mode(FLAGS_SERVICE); break;
case 'g': do_user_mode(FLAGS_GLOBAL); break;
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** proto-p10.c 7 Jan 2003 04:29:49 -0000 1.57
--- proto-p10.c 10 Jan 2003 03:36:26 -0000 1.58
***************
*** 409,412 ****
--- 409,418 ----
void
+ irc_regnick(struct userNode *user)
+ {
+ (void)user;
+ }
+
+ void
irc_nick(struct userNode *user, const char *new_nick)
{
***************
*** 1881,1885 ****
int add = 1;
! if (!user || !mode_change || !*mode_change) return;
while (1) {
#define do_user_mode(FLAG) do { if (add) user->modes |= FLAG; else user->modes &= ~FLAG; } while (0)
--- 1887,1891 ----
int add = 1;
! if (!user || !mode_change) return;
while (1) {
#define do_user_mode(FLAG) do { if (add) user->modes |= FLAG; else user->modes &= ~FLAG; } while (0)
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -r1.69 -r1.70
*** proto.h 14 Nov 2002 02:22:36 -0000 1.69
--- proto.h 10 Jan 2003 03:36:26 -0000 1.70
***************
*** 154,157 ****
--- 154,158 ----
/* account maintenance */
void irc_account(struct userNode *user, const char *stamp);
+ void irc_regnick(struct userNode *user);
/* numeric messages */
|
|
From: Entrope <en...@us...> - 2003-01-10 01:43:25
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26418/src
Modified Files:
sendmail.c
Log Message:
do not log an error when wait() returns EINTR
Index: sendmail.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sendmail.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** sendmail.c 8 Sep 2002 04:23:00 -0000 1.7
--- sendmail.c 10 Jan 2003 01:43:22 -0000 1.8
***************
*** 188,192 ****
fclose(out);
rv = wait(&res);
! if (rv != child) {
log(MAIN_LOG, LOG_ERROR, "sendmail() child to %s: Bad wait() return code %d: %s (%d)\n", to->email_addr, rv, strerror(errno), errno);
_exit(1);
--- 188,194 ----
fclose(out);
rv = wait(&res);
! if ((rv == child) || ((rv == -1) && (errno == EINTR))) {
! /* accept the wait() result */
! } else {
log(MAIN_LOG, LOG_ERROR, "sendmail() child to %s: Bad wait() return code %d: %s (%d)\n", to->email_addr, rv, strerror(errno), errno);
_exit(1);
|
|
From: Entrope <en...@us...> - 2003-01-09 06:50:42
|
Update of /cvsroot/srvx/services In directory sc8-pr-cvs1:/tmp/cvs-serv11260 Modified Files: configure.in Log Message: make sure that "src" is a directory before we try to put modules-list.h in it Index: configure.in =================================================================== RCS file: /cvsroot/srvx/services/configure.in,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -r1.66 -r1.67 *** configure.in 10 Nov 2002 02:00:33 -0000 1.66 --- configure.in 9 Jan 2003 06:18:19 -0000 1.67 *************** *** 291,294 **** --- 291,301 ---- ]) + if test -e src ; then + if test ! -d src ; then + AC_MSG_ERROR([src exists but is not a directory; please move it out of the way.]) + fi + else + mkdir src + fi AC_MSG_CHECKING(for extra module files) MODULE_DEFINES="src/modules-list.h" |
|
From: Entrope <en...@us...> - 2003-01-09 05:43:27
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2477/src
Modified Files:
proto-bahamut.c
Log Message:
don't try to append users to dead_users when we are exiting
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** proto-bahamut.c 7 Jan 2003 04:29:25 -0000 1.31
--- proto-bahamut.c 9 Jan 2003 05:43:24 -0000 1.32
***************
*** 212,216 ****
policer_delete(user->command_policer);
user->dead = 1;
! userList_append(&dead_users, user);
}
--- 212,220 ----
policer_delete(user->command_policer);
user->dead = 1;
! if (dead_users.size) {
! userList_append(&dead_users, user);
! } else {
! free(user);
! }
}
|
|
From: Entrope <en...@us...> - 2003-01-08 23:51:44
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv6917/src
Modified Files:
modcmd.c
Log Message:
fix off-by-one error in alias detection
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** modcmd.c 7 Jan 2003 04:25:03 -0000 1.47
--- modcmd.c 8 Jan 2003 23:51:41 -0000 1.48
***************
*** 984,988 ****
}
! if (argc > arg+1) {
/* a more complicated alias; fix it up */
unsigned int nn;
--- 984,988 ----
}
! if (argc > arg) {
/* a more complicated alias; fix it up */
unsigned int nn;
|
|
From: Entrope <en...@us...> - 2003-01-08 23:49:04
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv6276/src
Modified Files:
chanserv.c
Log Message:
do not invite users while we are still bursting (we get a 443 You are
not on channel from the burst NICKs)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.329
retrieving revision 1.330
diff -C2 -r1.329 -r1.330
*** chanserv.c 4 Jan 2003 05:16:40 -0000 1.329
--- chanserv.c 8 Jan 2003 23:48:59 -0000 1.330
***************
*** 6230,6239 ****
if(!GetUserMode(cn, user))
{
! if(IsUserAutoInvite(channel->user))
{
! if(cn->modes & (MODE_KEY | MODE_INVITEONLY))
! {
! irc_invite(chanserv, user, cn);
! }
}
continue;
--- 6230,6238 ----
if(!GetUserMode(cn, user))
{
! if(IsUserAutoInvite(channel->user)
! && (cn->modes & (MODE_KEY | MODE_INVITEONLY))
! && !self->burst)
{
! irc_invite(chanserv, user, cn);
}
continue;
|
|
From: Entrope <en...@us...> - 2003-01-07 05:02:15
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv3415/src
Modified Files:
opserv.c
Log Message:
do not tell an oper we left a channel if we were not in it
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.304
retrieving revision 1.305
diff -C2 -r1.304 -r1.305
*** opserv.c 6 Jan 2003 01:52:15 -0000 1.304
--- opserv.c 7 Jan 2003 05:02:08 -0000 1.305
***************
*** 1100,1103 ****
--- 1100,1107 ----
}
if ((channel = GetChannel(argv[1]))) {
+ if (!GetUserMode(channel, opserv)) {
+ reply(OSMSG_NOT_ON_CHANNEL, opserv->nick, channel->name);
+ return 0;
+ }
reason = (argc < 2) ? "Leaving." : unsplit_string(argv+1, argc-1, NULL);
opserv_notice(user, OSMSG_LEAVING, channel->name);
|
|
From: Entrope <en...@us...> - 2003-01-07 04:31:17
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28667/src
Modified Files:
ioset.c ioset.h sockcheck.c
Log Message:
make ioset_connect() accept a data pointer also, in case the connect callback returns immediately
Index: ioset.c
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** ioset.c 31 Oct 2002 03:46:07 -0000 1.13
--- ioset.c 7 Jan 2003 04:31:12 -0000 1.14
***************
*** 127,131 ****
struct io_fd *
! ioset_connect(struct sockaddr *local, unsigned int sa_size, const char *peer, unsigned int port, int blocking, void (*connect_cb)(struct io_fd *fd, int error)) {
int fd, res;
struct io_fd *io_fd;
--- 127,131 ----
struct io_fd *
! ioset_connect(struct sockaddr *local, unsigned int sa_size, const char *peer, unsigned int port, int blocking, void *data, void (*connect_cb)(struct io_fd *fd, int error)) {
int fd, res;
struct io_fd *io_fd;
***************
*** 165,168 ****
--- 165,169 ----
return NULL;
}
+ io_fd->data = data;
io_fd->connect_cb = connect_cb;
if (res < 0) {
Index: ioset.h
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** ioset.h 31 Oct 2002 03:46:07 -0000 1.7
--- ioset.h 7 Jan 2003 04:31:12 -0000 1.8
***************
*** 50,54 ****
struct io_fd *ioset_add(int fd);
! struct io_fd *ioset_connect(struct sockaddr *local, unsigned int sa_size, const char *hostname, unsigned int port, int blocking, void (*connect_cb)(struct io_fd *fd, int error));
void ioset_run(void);
void ioset_write(struct io_fd *fd, const char *buf, unsigned int nbw);
--- 50,54 ----
struct io_fd *ioset_add(int fd);
! struct io_fd *ioset_connect(struct sockaddr *local, unsigned int sa_size, const char *hostname, unsigned int port, int blocking, void *data, void (*connect_cb)(struct io_fd *fd, int error));
void ioset_run(void);
void ioset_write(struct io_fd *fd, const char *buf, unsigned int nbw);
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -r1.82 -r1.83
*** sockcheck.c 6 Nov 2002 23:53:01 -0000 1.82
--- sockcheck.c 7 Jan 2003 04:31:13 -0000 1.83
***************
*** 634,645 ****
do {
client->state = client->tests->list[client->test_index];
! client->fd = io_fd = ioset_connect((struct sockaddr*)sockcheck_conf.local_addr, sizeof(struct sockaddr), client->addr->hostname, client->state->port, 0, sockcheck_connected);
if (!io_fd) {
client->test_index++;
continue;
}
- client->read_pos = 0;
- client->read_used = 0;
- io_fd->data = client;
io_fd->readable_cb = sockcheck_readable;
timeq_add(now + client->state->timeout, sockcheck_timeout_client, client);
--- 634,644 ----
do {
client->state = client->tests->list[client->test_index];
! client->read_pos = 0;
! client->read_used = 0;
! client->fd = io_fd = ioset_connect((struct sockaddr*)sockcheck_conf.local_addr, sizeof(struct sockaddr), client->addr->hostname, client->state->port, 0, client, sockcheck_connected);
if (!io_fd) {
client->test_index++;
continue;
}
io_fd->readable_cb = sockcheck_readable;
timeq_add(now + client->state->timeout, sockcheck_timeout_client, client);
***************
*** 686,693 ****
sci = dict_find(checked_ip_dict, buff, NULL);
if (sci) {
! int max_age = (sci->decision == REJECT) ? sockcheck_conf.gline_duration : sockcheck_conf.max_cache_age;
! if ((sci->last_touched + max_age) >= now) {
! if (sci->decision == REJECT) sockcheck_issue_gline(sci);
return;
}
dict_remove(checked_ip_dict, sci->hostname);
--- 685,701 ----
sci = dict_find(checked_ip_dict, buff, NULL);
if (sci) {
! switch (sci->decision) {
! case CHECKING:
! /* We are already checking this host. */
return;
+ case ACCEPT:
+ if ((sci->last_touched + sockcheck_conf.max_cache_age) >= (unsigned)now) return;
+ break;
+ case REJECT:
+ if ((sci->last_touched + sockcheck_conf.gline_duration) >= (unsigned)now) {
+ sockcheck_issue_gline(sci);
+ return;
+ }
+ break;
}
dict_remove(checked_ip_dict, sci->hostname);
|
|
From: Entrope <en...@us...> - 2003-01-07 04:29:51
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28237/src
Modified Files:
proto-p10.c
Log Message:
fix AddUser() to make the right user a zombie
when calling AddClone() or AddService(), make sure we collide existing users
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** proto-p10.c 6 Jan 2003 01:53:01 -0000 1.56
--- proto-p10.c 7 Jan 2003 04:29:49 -0000 1.57
***************
*** 1473,1476 ****
--- 1473,1477 ----
/* other numeric responses we might get */
dict_insert(irc_func_dict, "401", cmd_dummy); /* target left network */
+ dict_insert(irc_func_dict, "403", cmd_dummy); /* no such channel */
dict_insert(irc_func_dict, "441", cmd_dummy); /* target isn't on that channel */
dict_insert(irc_func_dict, "442", cmd_dummy); /* you aren't on that channel */
***************
*** 1704,1707 ****
--- 1705,1710 ----
char numeric[COMBO_NUMERIC_LEN+1];
int local_num = get_local_numeric();
+ time_t timestamp = now;
+ struct userNode *old_user = GetUserH(nick);
if (local_num == -1) {
***************
*** 1710,1713 ****
--- 1713,1717 ----
}
make_numeric(self, local_num, numeric);
+ if (old_user) timestamp = old_user->timestamp - 1;
return AddUser(self, nick, nick, self->name, "+oik", NULL, numeric, desc, now, "AAAAAA");
}
***************
*** 1718,1721 ****
--- 1722,1727 ----
char numeric[COMBO_NUMERIC_LEN+1];
int local_num = get_local_numeric();
+ time_t timestamp = now;
+ struct userNode *old_user = GetUserH(nick);
if (local_num == -1) {
***************
*** 1724,1728 ****
}
make_numeric(self, local_num, numeric);
! return AddUser(self, nick, ident, hostname, "+i", NULL, numeric, desc, now, "AAAAAA");
}
--- 1730,1735 ----
}
make_numeric(self, local_num, numeric);
! if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, ident, hostname, "+i", NULL, numeric, desc, timestamp, "AAAAAA");
}
***************
*** 1744,1748 ****
struct userNode *oldUser, *uNode;
struct policer_params *pol_params;
! unsigned int n;
if ((strlen(numeric) < 3) || (strlen(numeric) > 5)) {
--- 1751,1755 ----
struct userNode *oldUser, *uNode;
struct policer_params *pol_params;
! unsigned int n, ignore_user;
if ((strlen(numeric) < 3) || (strlen(numeric) > 5)) {
***************
*** 1766,1769 ****
--- 1773,1794 ----
}
+ ignore_user = 0;
+ if ((oldUser = GetUserH(nick))) {
+ if (IsLocal(oldUser) && IsService(oldUser)) {
+ /* The service should collide the new user off. */
+ oldUser->timestamp = timestamp - 1;
+ irc_user(oldUser);
+ }
+ if (oldUser->timestamp > timestamp) {
+ /* "Old" user is really newer; remove them */
+ DelUser(oldUser, 0, 1, "Overruled by older nick");
+ } else {
+ /* User being added is too new; do not add them to
+ * clients, but do add them to the server's list, since it
+ * will send a KILL and QUIT soon. */
+ ignore_user = 1;
+ }
+ }
+
/* create new usernode and set all values */
uNode = calloc(1, sizeof(*uNode));
***************
*** 1774,1778 ****
safestrncpy(uNode->numeric, numeric, sizeof(uNode->numeric));
uNode->ip = base64toint(realip, 6);
! uNode->timestamp=timestamp;
modeList_init(&uNode->channels);
uNode->uplink = uplink;
--- 1799,1803 ----
safestrncpy(uNode->numeric, numeric, sizeof(uNode->numeric));
uNode->ip = base64toint(realip, 6);
! uNode->timestamp = timestamp;
modeList_init(&uNode->channels);
uNode->uplink = uplink;
***************
*** 1785,1808 ****
uNode->uplink->users[uNode->num_local] = uNode;
if (account) call_account_func(uNode, account);
! 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) {
! max_clients = dict_size(clients);
! max_clients_time = now;
! }
}
-
- mod_usermode(uNode, modes);
if (IsLocal(uNode)) irc_user(uNode);
for (n=0; n<nuf_used; n++) {
--- 1810,1821 ----
uNode->uplink->users[uNode->num_local] = uNode;
if (account) call_account_func(uNode, account);
+ mod_usermode(uNode, modes);
+ if (ignore_user) return uNode;
! dict_insert(clients, uNode->nick, uNode);
! if (dict_size(clients) > max_clients) {
! max_clients = dict_size(clients);
! max_clients_time = now;
}
if (IsLocal(uNode)) irc_user(uNode);
for (n=0; n<nuf_used; n++) {
|
|
From: Entrope <en...@us...> - 2003-01-07 04:29:28
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28131/src
Modified Files:
proto-bahamut.c proto-common.c
Log Message:
fix AddUser() to make the right user a zombie
when calling AddClone() or AddService(), make sure we collide existing users
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** proto-bahamut.c 4 Jan 2003 06:25:20 -0000 1.30
--- proto-bahamut.c 7 Jan 2003 04:29:25 -0000 1.31
***************
*** 128,131 ****
--- 128,146 ----
}
+ if ((oldUser = GetUserH(nick))) {
+ if (IsLocal(oldUser) && IsService(oldUser)) {
+ /* The service should collide the new user off. */
+ oldUser->timestamp = timestamp - 1;
+ irc_user(oldUser);
+ }
+ if (oldUser->timestamp > timestamp) {
+ /* "Old" user is really newer; remove them */
+ DelUser(oldUser, 0, 1, "Overruled by older nick");
+ } else {
+ /* User being added is too new */
+ return NULL;
+ }
+ }
+
uNode = calloc(1, sizeof(*uNode));
safestrncpy(uNode->nick, nick, sizeof(uNode->nick));
***************
*** 144,165 ****
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) {
! max_clients = dict_size(clients);
! max_clients_time = now;
! }
}
--- 159,166 ----
uNode->command_policer = policer_new(pol_params, uNode->timestamp);
! dict_insert(clients, uNode->nick, uNode);
! if (dict_size(clients) > max_clients) {
! max_clients = dict_size(clients);
! max_clients_time = now;
}
***************
*** 174,183 ****
struct userNode *
AddService(const char *nick, const char *desc) {
! return AddUser(self, nick, nick, self->name, "+oik", desc, now, (127<<24)|1);
}
struct userNode *
AddClone(const char *nick, const char *ident, const char *hostname, const char *desc) {
! return AddUser(self, nick, ident, hostname, "+i", desc, now, (127<<24)|1);
}
--- 175,190 ----
struct userNode *
AddService(const char *nick, const char *desc) {
! time_t timestamp = now;
! struct userNode *old_user = GetUserH(nick);
! if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, nick, self->name, "+oik", desc, timestamp, (127<<24)|1);
}
struct userNode *
AddClone(const char *nick, const char *ident, const char *hostname, const char *desc) {
! time_t timestamp = now;
! struct userNode *old_user = GetUserH(nick);
! if (old_user) timestamp = old_user->timestamp - 1;
! return AddUser(self, nick, ident, hostname, "+i", desc, timestamp, (127<<24)|1);
}
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** proto-common.c 2 Jan 2003 23:11:34 -0000 1.25
--- proto-common.c 7 Jan 2003 04:29:25 -0000 1.26
***************
*** 125,129 ****
log(MAIN_LOG, LOG_INFO, "Connecting to %s:%i...\n", addr, port);
! socket_io_fd = ioset_connect((struct sockaddr*)cManager.uplink->bind_addr, sizeof(struct sockaddr), addr, port, 1, NULL);
if (!socket_io_fd) {
log(MAIN_LOG, LOG_ERROR, "Connection to uplink failed: %s (%d)\n", strerror(errno), errno);
--- 125,129 ----
log(MAIN_LOG, LOG_INFO, "Connecting to %s:%i...\n", addr, port);
! socket_io_fd = ioset_connect((struct sockaddr*)cManager.uplink->bind_addr, sizeof(struct sockaddr), addr, port, 1, 0, NULL);
if (!socket_io_fd) {
log(MAIN_LOG, LOG_ERROR, "Connection to uplink failed: %s (%d)\n", strerror(errno), errno);
|