neozeed ircu2.9.32-linux-hacks.diff

This commit is contained in:
2023-12-26 16:42:36 -05:00
parent ab64084f63
commit 51650c0d78
40 changed files with 718 additions and 720 deletions

View File

@@ -81,10 +81,10 @@
#define FLAGS_NEWNICK_DISPLAYED (1<<30)
#define DupNewString(x,y) if (!StrEq(x,y)) { MyFree(x); DupString(x,y); }
#define MyEq(x,y) (!myncmp(x,y,strlen(x)))
#undef mycmp
#define mycmp mystrcasecmp /* mycmp sux, making note use double cpu */
#define Usermycmp(x,y) mycmp(x,y)
#define MyEq(x,y) (!strncasecmp(x,y,strlen(x)))
#undef strcasecmp
#define strcasecmp mystrcasecmp /* strcasecmp sux, making note use double cpu */
#define Userstrcasecmp(x,y) strcasecmp(x,y)
#define Key(sptr) KeyFlags(sptr,-1)
#define Message(msgclient) get_msg(msgclient, 'm')
#define IsOperHere(sptr) (IsOper(sptr) && MyConnect(sptr))
@@ -375,7 +375,7 @@ aMsgClient *msgclient;
msg = Message(msgclient);
while (*msg == '%') {
msg++; c = split_string(msg, 1, 1);
if (!mycmp(c, nick)) {
if (!strcasecmp(c, nick)) {
strcpy(buf, "*");
return buf;
}
@@ -407,7 +407,7 @@ char *name;
while ((s = (b+t) >> 1) != b) {
msgclient = ToNameList[s];
tname = (msgclient->flags & FLAGS_SORT_BY_TONAME) ? 1 : 0;
if (mycmp(tname ? msgclient->toname : msgclient->tonick, name) < 0)
if (strcasecmp(tname ? msgclient->toname : msgclient->tonick, name) < 0)
b = s; else t = s;
}
return t;
@@ -423,7 +423,7 @@ char *name;
while ((s = (b+t) >> 1) != b) {
msgclient = ToNameList[s];
tname = (msgclient->flags & FLAGS_SORT_BY_TONAME) ? 1 : 0;
if (mycmp(tname ? msgclient->toname : msgclient->tonick, name) > 0)
if (strcasecmp(tname ? msgclient->toname : msgclient->tonick, name) > 0)
t = s; else b = s;
}
return b;
@@ -436,7 +436,7 @@ char *fromname;
if (!t) return 0;
while ((s = (b+t) >> 1) != b)
if (mycmp(FromNameList[s]->fromname,fromname)<0) b = s; else t = s;
if (strcasecmp(FromNameList[s]->fromname,fromname)<0) b = s; else t = s;
return t;
}
@@ -447,7 +447,7 @@ char *fromname;
if (!t) return 0;
while ((s = (b+t) >> 1) != b)
if (mycmp(FromNameList[s]->fromname,fromname)>0) t = s; else b = s;
if (strcasecmp(FromNameList[s]->fromname,fromname)>0) t = s; else b = s;
return b;
}
@@ -550,10 +550,10 @@ long32 flags;
last = last_fnl_indexnode(fromname);
if (!(n = first)) n = 1;
index_p = FromNameList+n;
while (n <= last && mycmp(msgclient->fromhost,(*index_p)->fromhost)>0) {
while (n <= last && strcasecmp(msgclient->fromhost,(*index_p)->fromhost)>0) {
index_p++;n++;
}
while (n <= last && mycmp(msgclient->fromnick,(*index_p)->fromnick)>=0){
while (n <= last && strcasecmp(msgclient->fromnick,(*index_p)->fromnick)>=0){
index_p++;n++;
}
index_p = FromNameList+fromname_index;
@@ -772,7 +772,7 @@ char *host1,*host2;
if (numeric_host(host1) != numeric_host(host2)) return 0;
strcpy(buf,local_host(host1));
if (!mycmp(buf,local_host(host2))) return 1;
if (!strcasecmp(buf,local_host(host2))) return 1;
return 0;
}
@@ -866,8 +866,8 @@ int id;
|| msgclient->flags & FLAGS_DENY
|| !matches(msgclient->toname, UserName(sptr))
&& !matches(msgclient->tohost, sptr->user->host))
|| !Usermycmp(UserName(sptr),msgclient->fromname))
&& (chn || !mycmp(sptr->name, msgclient->fromnick)
|| !Userstrcasecmp(UserName(sptr),msgclient->fromname))
&& (chn || !strcasecmp(sptr->name, msgclient->fromnick)
|| wild_fromnick(sptr->name, msgclient))
&& (!time_l || msgclient->time >= time_l
&& msgclient->time < time_l+SECONDS_DAY)
@@ -1393,14 +1393,14 @@ aChannel *sptr_chn;
if (!(msgclient->flags & FLAGS_FROM_REG)) qptr = 0;
else for (qptr = client; qptr; qptr = qptr->next)
if (qptr->user && !strcmp(UserName(qptr),msgclient->fromname)
&& (!mycmp(qptr->name,msgclient->fromnick)
&& (!strcasecmp(qptr->name,msgclient->fromnick)
|| wild_fromnick(qptr->name, msgclient))
&& host_check(qptr->user->host,msgclient->fromhost))
break;
if (!qptr) msgclient->flags &= ~FLAGS_FROM_REG;
}
if (!mycmp(nick, msgclient->tonick)
|| !mycmp(nick, get_msg(msgclient, 'n'))) right_tonick = 1;
if (!strcasecmp(nick, msgclient->tonick)
|| !strcasecmp(nick, get_msg(msgclient, 'n'))) right_tonick = 1;
if (!sptr->user->channel && !IsInvisible(sptr)) secret = 0;
if (secret && !IsInvisible(sptr))
for (link = sptr->user->channel; link; link = link->next)
@@ -1452,11 +1452,11 @@ aChannel *sptr_chn;
if (fmsgclient->flags & FLAGS_DISPLAY_IF_DEST_REGISTER
&& now < fmsgclient->timeout
&& fmsgclient != msgclient
&& (!mycmp(mode == 'g' ? qptr_nick : qptr->name,
&& (!strcasecmp(mode == 'g' ? qptr_nick : qptr->name,
fmsgclient->fromnick)
|| wild_fromnick(mode == 'g' ? qptr_nick :qptr->name,
fmsgclient))
&& !Usermycmp(UserName(qptr), fmsgclient->fromname)
&& !Userstrcasecmp(UserName(qptr), fmsgclient->fromname)
&& host_check(qptr->user->host, fmsgclient->fromhost)
&& !matches(fmsgclient->tonick, nick)
&& !matches(fmsgclient->toname, UserName(sptr))
@@ -1586,7 +1586,7 @@ aChannel *sptr_chn;
qptr->name, nick, buf,
"signs off", message);
} else {
if (mycmp(nick, newnick)
if (strcasecmp(nick, newnick)
&& !(msgclient->flags & FLAGS_NO_NICKCHANGE_SPY))
sendto_one(qptr,
"NOTICE %s :### %s (%s) %s <%s> %s",
@@ -1626,11 +1626,11 @@ aChannel *sptr_chn;
while (last && t <= last) {
if (ToNameList[t]->timeout > now &&
ToNameList[t]->flags & FLAGS_SERVER_GENERATED &&
!Usermycmp(ToNameList[t]->toname, msgclient->fromname) &&
!mycmp(ToNameList[t]->tohost,
!Userstrcasecmp(ToNameList[t]->toname, msgclient->fromname) &&
!strcasecmp(ToNameList[t]->tohost,
local_host(msgclient->fromhost))) {
t1++;
if (!mycmp(Message(ToNameList[t]),mbuf)) {
if (!strcasecmp(Message(ToNameList[t]),mbuf)) {
t1 = -1; break;
}
}
@@ -1685,13 +1685,13 @@ while (send && qptr != sptr &&
last = last_tnl_indexnode(UserName(sptr));
while (last && t <= last) {
if (ToNameList[t]->flags & FLAGS_SERVER_GENERATED_DESTINATION
&& (!mycmp(ToNameList[t]->fromnick,msgclient->fromnick)
&& (!strcasecmp(ToNameList[t]->fromnick,msgclient->fromnick)
|| wild_fromnick(ToNameList[t]->fromnick, msgclient))
&& !Usermycmp(ToNameList[t]->fromname,msgclient->fromname)
&& !Userstrcasecmp(ToNameList[t]->fromname,msgclient->fromname)
&& host_check(ToNameList[t]->fromhost,msgclient->fromhost)
&& (!(msgclient->flags & FLAGS_REGISTER_NEWNICK)
|| !mycmp(ToNameList[t]->tonick,nick))
&& !Usermycmp(ToNameList[t]->toname,UserName(sptr))
|| !strcasecmp(ToNameList[t]->tonick,nick))
&& !Userstrcasecmp(ToNameList[t]->toname,UserName(sptr))
&& host_check(ToNameList[t]->tohost,sptr->user->host)) {
send = 0; break;
}
@@ -1753,7 +1753,7 @@ char mode;
if (!host_check(msgclient->fromhost, sptr->user->host)) {
t++; continue;
}
if (!mycmp(qptr_nick, msgclient->fromnick)
if (!strcasecmp(qptr_nick, msgclient->fromnick)
|| wild_fromnick(qptr_nick, msgclient)) {
if (msgclient->flags & FLAGS_DISPLAY_IF_DEST_REGISTER)
update_spymsg(msgclient);
@@ -1810,7 +1810,7 @@ char mode;
&& !matches(msgclient->tohost, sptr->user->host)
&& (mode != 's' && mode != 'g'
|| (wild_fromnick(qptr_nick, msgclient)
|| !mycmp(qptr_nick, msgclient->fromnick))
|| !strcasecmp(qptr_nick, msgclient->fromnick))
&& host_check(msgclient->fromhost,
qptr->user->host))) {
message = check_flags(aptr, sptr, qptr, tonick, newnick,
@@ -1943,8 +1943,8 @@ char *param;
long32 gflags = 0;
name = split_string(param, 2, 1);
if (!mycmp(name, "CHANNEL")) channel = 1;
else if (!mycmp(name, "DENY")) deny = 1;
if (!strcasecmp(name, "CHANNEL")) channel = 1;
else if (!strcasecmp(name, "DENY")) deny = 1;
else return;
strncpyzt(toserver, split_string(param, 1, 1), BUF_LEN-1);
strncpyzt(password_s, split_string(param, 3, 1), BUF_LEN-1);
@@ -1960,7 +1960,7 @@ char *param;
if (channel && (!index(toserver, '.') || strlen(message) < 10 ||
!note_headchannel(tonick))) return;
if (!mycmp(me.name, sptr->name)
if (!strcasecmp(me.name, sptr->name)
|| !xrm_distribute_privs(fromname, fromhost)) goto just_distribute;
#ifdef EPATH
@@ -1988,9 +1988,9 @@ char *param;
if (now < msgclient->timeout
&& (!channel || msgclient->flags & FLAGS_CHANNEL)
&& (!deny || msgclient->flags & FLAGS_DENY)
&& !mycmp(msgclient->tonick, tonick)
&& (channel || !mycmp(msgclient->toname, toname))
&& (channel || !mycmp(msgclient->tohost, tohost))) {
&& !strcasecmp(msgclient->tonick, tonick)
&& (channel || !strcasecmp(msgclient->toname, toname))
&& (channel || !strcasecmp(msgclient->tohost, tohost))) {
index_p = WildCardList; break;
}
t++;
@@ -2009,14 +2009,14 @@ char *param;
/* If new request isn't equal, but matches old, remove old */
if (!matches(toname, msgclient->toname)
&& !matches(tohost, msgclient->tohost)
&& (mycmp(toname, msgclient->toname)
|| mycmp(tohost, msgclient->tohost))) msgclient->timeout = 0;
&& (strcasecmp(toname, msgclient->toname)
|| strcasecmp(tohost, msgclient->tohost))) msgclient->timeout = 0;
/* If old request matches new... */
else if (!matches(msgclient->toname, toname)
&& !matches(msgclient->tohost, tohost)) {
if (root_call &&
(!strcmp(password, msgclient->passwd)
|| !mycmp(fromname, msgclient->fromname)
|| !strcasecmp(fromname, msgclient->fromname)
&& host_check(fromhost, msgclient->fromhost)
|| !*msgclient->passwd
|| !msgclient->passwd[1])) root_access = 1;
@@ -2224,9 +2224,9 @@ char *message;
long32 gflags = 0;
char buf[MSG_LEN], *c;
if ((!mycmp(sptr->name, msgclient->fromnick)
if ((!strcasecmp(sptr->name, msgclient->fromnick)
|| wild_fromnick(sptr->name, msgclient))
&& !Usermycmp(UserName(sptr),msgclient->fromname)
&& !Userstrcasecmp(UserName(sptr),msgclient->fromname)
&& host_check(sptr->user->host, msgclient->fromhost)) return;
sprintf(buf,"%s (%s@%s) %s for %s@%s", sptr->name, UserName(sptr),
@@ -2249,7 +2249,7 @@ char *arg, *passwd, *flag_s, *id_s, *name, *time_s;
time_t flags = 0, time_l;
char dibuf[40], tonick[BUF_LEN], toname[BUF_LEN], tohost[BUF_LEN];
if (!mycmp(arg,"XRM")) xrm = 1;
if (!strcasecmp(arg,"XRM")) xrm = 1;
if (xrm && (!IsOper(sptr) ||
!xrm_distribute_privs(sptr->user->username,
sptr->user->host))) {
@@ -2377,12 +2377,12 @@ char *arg, *value;
aMsgClient *msgclient;
if (*arg) {
if (!mycmp(arg,"MSM")) setvar(sptr,&note_msm,0,value); else
if (!mycmp(arg,"MSW")) setvar(sptr,&note_msw,3,value); else
if (!mycmp(arg,"MUM")) setvar(sptr,&note_mum,6,value); else
if (!mycmp(arg,"MUW")) setvar(sptr,&note_muw,9,value); else
if (!mycmp(arg,"MST")) setvar(sptr,&note_mst,12,value); else
if (!mycmp(arg,"MSF")) setvar(sptr,&note_msf,15,value); else
if (!strcasecmp(arg,"MSM")) setvar(sptr,&note_msm,0,value); else
if (!strcasecmp(arg,"MSW")) setvar(sptr,&note_msw,3,value); else
if (!strcasecmp(arg,"MUM")) setvar(sptr,&note_mum,6,value); else
if (!strcasecmp(arg,"MUW")) setvar(sptr,&note_muw,9,value); else
if (!strcasecmp(arg,"MST")) setvar(sptr,&note_mst,12,value); else
if (!strcasecmp(arg,"MSF")) setvar(sptr,&note_msf,15,value); else
if (MyEq(arg,"USED")) {
while (last && t <= last) {
msgclient = FromNameList[t];
@@ -2399,11 +2399,11 @@ char *arg, *value;
fromhost = msgclient->fromhost;
fromname = msgclient->fromname;
fromnick = msgclient->fromnick;
} else if (Usermycmp(msgclient->fromname,fromname)) {
} else if (Userstrcasecmp(msgclient->fromname,fromname)) {
nicks++;names++;
fromname = msgclient->fromname;
fromnick = msgclient->fromnick;
} else if (mycmp(msgclient->fromnick,fromnick)) {
} else if (strcasecmp(msgclient->fromnick,fromnick)) {
nicks++;
fromnick = msgclient->fromnick;
}
@@ -2436,7 +2436,7 @@ char *arg, *value;
"H-header: ",flag_destination);
sendto_one(sptr,"NOTICE %s :### %s",sptr->name,buf);
}
} else if (!mycmp(arg,"RESET")) {
} else if (!strcasecmp(arg,"RESET")) {
if (!IsOperHere(sptr))
sendto_one(sptr,"NOTICE %s :### %s",sptr->name,
"Wrong button - try another next time...");
@@ -2562,7 +2562,7 @@ char mode, *name;
int ret = 0, only_users = 0, only_head = 0;
if (mode == 'l' && (MyEq("tail", name) || !*name)) only_users = 1;
if (mode == 'l' && (MyEq("head", name) || !mycmp(name, "."))) {
if (mode == 'l' && (MyEq("head", name) || !strcasecmp(name, "."))) {
only_head = 1; name = wildcard;
}
if (!only_users) ret = check_channel(sptr, mode, name, "", "");
@@ -2638,8 +2638,8 @@ char *passwd, *flag_s, *timeout_s, *name, *message;
while (last && t <= last) {
msgclient = FromNameList[t];
if (now > msgclient->timeout) { t++; continue; }
if (!mycmp(sptr->name, msgclient->fromnick)
&& !Usermycmp(UserName(sptr), msgclient->fromname)
if (!strcasecmp(sptr->name, msgclient->fromnick)
&& !Userstrcasecmp(UserName(sptr), msgclient->fromname)
&& host_check(sptr->user->host, msgclient->fromhost)
&& StrEq(msgclient->tonick, tonick)
&& StrEq(msgclient->toname, toname)
@@ -2655,7 +2655,7 @@ char *passwd, *flag_s, *timeout_s, *name, *message;
if (!join && !(flags & FLAGS_WASOPER) && !Key(sptr)) {
t = first;
while (last && t <= last) {
if (!Usermycmp(UserName(sptr),FromNameList[t]->fromname)) {
if (!Userstrcasecmp(UserName(sptr),FromNameList[t]->fromname)) {
if (host_check(sptr->user->host,FromNameList[t]->fromhost)) {
sent++;
if (wildcards(FromNameList[t]->tonick)
@@ -2766,8 +2766,8 @@ char *passwd, *flag_s, *timeout_s, *name, *message;
strncat(buf, message, msg_len); strcat(flag_s, "-RS");
while (fromname_index && t <= fromname_index) {
msgclient = FromNameList[t];
if (!Usermycmp(UserName(sptr), msgclient->fromname)
&& (!mycmp(sptr->name, msgclient->fromnick)
if (!Userstrcasecmp(UserName(sptr), msgclient->fromname)
&& (!strcasecmp(sptr->name, msgclient->fromnick)
|| wild_fromnick(sptr->name, msgclient)
&& host_check(sptr->user->host,msgclient->fromhost))) {
t++; continue;
@@ -2781,10 +2781,10 @@ char *passwd, *flag_s, *timeout_s, *name, *message;
&& !matches(msgclient->tohost, sptr->user->host)
&& (!matches(toname, msgclient->tonick)
|| matches(toname, tonick)
&& !mycmp(msgclient->tonick, tonick))
&& !strcasecmp(msgclient->tonick, tonick))
&& (!*Message(msgclient)
|| !matches(Message(msgclient), message))
|| !mycmp(tonick, "admin.users"))
|| !strcasecmp(tonick, "admin.users"))
&& !matches(tohost, msgclient->fromhost)
&& !(msgclient->flags & FLAGS_KEY_TO_OPEN_OPER_LOCKS)) {
c = wild_fromnick(msgclient->fromnick, msgclient);
@@ -3013,13 +3013,13 @@ char *arg, *name, *time_s, *delete;
&& (!matches(fromnick,msgclient->fromnick))
&& (!matches(fromname,msgclient->fromname))
&& (!matches(fromhost,msgclient->fromhost))
&& (!*delete || !mycmp(delete,"RM")
|| !mycmp(delete,"RMBF") &&
&& (!*delete || !strcasecmp(delete,"RM")
|| !strcasecmp(delete,"RMBF") &&
(msgclient->flags & FLAGS_RETURN_CORRECT_DESTINATION ||
msgclient->flags & FLAGS_FIND_CORRECT_DEST_SEND_ONCE))) {
if (*delete || !next_msgclient
|| mycmp(next_msgclient->fromnick,msgclient->fromnick)
|| mycmp(next_msgclient->fromname,msgclient->fromname)
|| strcasecmp(next_msgclient->fromnick,msgclient->fromnick)
|| strcasecmp(next_msgclient->fromname,msgclient->fromname)
|| !(host_check(next_msgclient->fromhost,
msgclient->fromhost))) {
sendto_one(sptr,"NOTICE %s :### %s[%d] %s (%s@%s) @%s",
@@ -3044,8 +3044,8 @@ char *arg, *name, *time_s, *delete;
while (last && t <= last) {
msgclient = FromNameList[t];
if (now > msgclient->timeout) { t++; continue; }
if (!Usermycmp(UserName(sptr),msgclient->fromname)
&& (!nick || !mycmp(sptr->name,msgclient->fromnick))) {
if (!Userstrcasecmp(UserName(sptr),msgclient->fromname)
&& (!nick || !strcasecmp(sptr->name,msgclient->fromnick))) {
if (host_check(sptr->user->host,msgclient->fromhost)) {
if (!count)
sendto_one(sptr,"NOTICE %s :### Queued %s from host %s",
@@ -3349,10 +3349,10 @@ char *parv[];
if (parc < 2 || BadPtr(parv[1])) name = empty;
else name = strtoken(&p, parv[1], ",");
if (!mycmp(name, "all") || !note_channel(cptr, sptr, 'c', "*" ))
if (!strcasecmp(name, "all") || !note_channel(cptr, sptr, 'c', "*" ))
return n_list(cptr, sptr, parc, parv);
note_channel(cptr, sptr, 'l', name);
if (!mycmp(name, "help"))
if (!strcasecmp(name, "help"))
sendto_one(sptr,
"NOTICE %s :*** /list #first_characters_in_chn %s",
sptr->name, "or /list . (opermade) or /list (usermade)");
@@ -3393,7 +3393,7 @@ char *parv[];
return -1;
}
param = parv[1];
if (parc > 1 && !myncmp(param,"service ",8)) {
if (parc > 1 && !strncasecmp(param,"service ",8)) {
if (!IsOperHere(sptr)) {
sendto_one(sptr,"NOTICE %s :### %s",sptr->name,
"Beyond your power poor soul...");
@@ -3422,7 +3422,7 @@ char *parv[];
}
else for (acptr = client; acptr; acptr = acptr->next)
if (IsServer(acptr) && acptr != cptr
&& !mycmp(c, acptr->name)) {
&& !strcasecmp(c, acptr->name)) {
sendto_one(acptr,
":%s NOTE %s", sptr->name, param);
break;
@@ -3497,11 +3497,11 @@ char *parv[];
if (MyEq(option,"VERSION")) sendto_one(sptr,"NOTICE %s :Running version %s",
sptr->name, VERSION);
else if (remote < 0
&& mycmp(option, "NEWS")
&& mycmp(option, "XRM")
&& mycmp(option, "FLAG")
&& mycmp(option, "DENY")
&& mycmp(option, "XLS")) return 0; else
&& strcasecmp(option, "NEWS")
&& strcasecmp(option, "XRM")
&& strcasecmp(option, "FLAG")
&& strcasecmp(option, "DENY")
&& strcasecmp(option, "XLS")) return 0; else
if (alias_send(sptr,option, &flags, &msg, &timeout) || MyEq(option,"USER")) {
if (!*buf1) {
if (MyEq(option,"SPY")) check_messages(sptr, sptr, sptr->name, 'g');
@@ -3513,7 +3513,7 @@ char *parv[];
name = buf1;if (!*name) name = wildcard;
if (name_len_error(sptr, name)) return 0;
if (!timeout || !*timeout) timeout = default_timeout;
if (mycmp(option, "NEWS") || !msg) {
if (strcasecmp(option, "NEWS") || !msg) {
msg_send(sptr, silent, passwd, flags, timeout, name, msg);
} else msg_news(sptr, silent, passwd, flags,
timeout == default_timeout ? deft : timeout,
@@ -3545,7 +3545,7 @@ char *parv[];
if (name_len_error(sptr, name)) return 0;
note_channel(cptr, sptr, 'l', name);
} else
if (!mycmp(option,"RM") || !mycmp(option,"XRM")) {
if (!strcasecmp(option,"RM") || !strcasecmp(option,"XRM")) {
if (!*buf1 && !id && !*flags) {
sendto_one(sptr,
"NOTICE %s :#?# Please specify at least one argument",