diff -ruN ircu2.10.12.06/include/channel.h arcnetv21/include/channel.h --- ircu2.10.12.06/include/channel.h 2005-12-23 18:15:01.000000000 +0100 +++ arcnetv21/include/channel.h 2006-04-23 13:47:35.590490750 +0200 @@ -125,7 +125,11 @@ /** channel not shown but names are */ #define HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE)) /** channel visible */ +#if 1 /* ARCNet: you can't hide channels from bofh's */ +#define ShowChannel(v,c) (PubChannel(c) || IsBOFH(v) || find_channel_member((v),(c))) +#else #define ShowChannel(v,c) (PubChannel(c) || find_channel_member((v),(c))) +#endif #define PubChannel(x) ((!x) || ((x)->mode.mode & \ (MODE_PRIVATE | MODE_SECRET)) == 0) diff -ruN ircu2.10.12.06/include/client.h arcnetv21/include/client.h --- ircu2.10.12.06/include/client.h 2006-02-16 04:49:54.000000000 +0100 +++ arcnetv21/include/client.h 2006-04-23 13:47:36.626555500 +0200 @@ -90,7 +90,11 @@ #define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag)) /** String containing valid user modes, in no particular order. */ +#if 1 /* ARCNet: show the BOFH usermode */ +#define infousermodes "dioswkgGx" +#else #define infousermodes "dioswkgx" +#endif /** Operator privileges. */ enum Priv @@ -166,6 +170,9 @@ FLAG_DEBUG, /**< send global debug/anti-hack info */ FLAG_ACCOUNT, /**< account name has been set */ FLAG_HIDDENHOST, /**< user's host is hidden */ +#if 1 /* ARCNet: add the bofh flag */ + FLAG_BOFH, /**< user is a bofh */ +#endif FLAG_LAST_FLAG, /**< number of flags */ FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */ FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */ @@ -661,6 +668,13 @@ /** Clear the client's pending PING flag. */ #define ClearPingSent(x) ClrFlag(x, FLAG_PINGSENT) +#if 1 /* ARCNet: BOFH manipulation commands */ +#define IsBOFH(x) HasFlag(x, FLAG_BOFH) +#define SetBOFH(x) SetFlag(x, FLAG_BOFH) +#define ClearBOFH(x) ClrFlag(x, FLAG_BOFH) +#endif + + /* free flags */ #define FREEFLAG_SOCKET 0x0001 /**< socket needs to be freed */ #define FREEFLAG_TIMER 0x0002 /**< timer needs to be freed */ diff -ruN ircu2.10.12.06/include/handlers.h arcnetv21/include/handlers.h --- ircu2.10.12.06/include/handlers.h 2005-04-07 14:11:48.000000000 +0200 +++ arcnetv21/include/handlers.h 2006-04-23 13:47:35.622492750 +0200 @@ -225,6 +225,12 @@ extern int ms_wallusers(struct Client*, struct Client*, int, char*[]); extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]); extern int ms_whois(struct Client*, struct Client*, int, char*[]); +#if 1 /* ARCNet: setmask and setinfo pragmas */ +extern int m_setinfo(struct Client*, struct Client*, int, char*[]); +extern int ms_setinfo(struct Client*, struct Client*, int, char*[]); +extern int m_setmask(struct Client*, struct Client*, int, char*[]); +extern int ms_setmask(struct Client*, struct Client*, int, char*[]); +#endif #endif /* INCLUDED_handlers_h */ diff -ruN ircu2.10.12.06/include/ircd_defs.h arcnetv21/include/ircd_defs.h --- ircu2.10.12.06/include/ircd_defs.h 2004-10-05 04:21:08.000000000 +0200 +++ arcnetv21/include/ircd_defs.h 2006-04-23 13:47:36.574552250 +0200 @@ -68,7 +68,7 @@ * with the ACCOUNT (AC) command. This is used for keeping track of who's * logged into which account, for the benefit of irc services. */ -#define ACCOUNTLEN 12 +#define ACCOUNTLEN 15 /** Maximum length for user supplied information about a client * connection (gcos). This information is set at client/server registration * time. diff -ruN ircu2.10.12.06/include/msg.h arcnetv21/include/msg.h --- ircu2.10.12.06/include/msg.h 2005-04-07 14:11:48.000000000 +0200 +++ arcnetv21/include/msg.h 2006-04-23 13:47:35.366476750 +0200 @@ -360,6 +360,16 @@ #define TOK_CAP "CAP" #define CMD_CAP MSG_CAP, TOK_CAP +#if 1 /* ARCNet: setmask and setinfo definitions */ +#define MSG_SETMASK "SETMASK" /* Set hostmask */ +#define TOK_SETMASK "SM" +#define CMD_SETMASK MSG_SETMASK, TOK_SETMASK + +#define MSG_SETINFO "SETINFO" /* Set userinfo */ +#define TOK_SETINFO "SI" +#define CMD_SETINFO MSG_SETINFO, TOK_SETINFO +#endif + /* * Constants */ diff -ruN ircu2.10.12.06/include/numeric.h arcnetv21/include/numeric.h --- ircu2.10.12.06/include/numeric.h 2005-08-29 23:39:26.000000000 +0200 +++ arcnetv21/include/numeric.h 2006-04-23 13:47:35.298472500 +0200 @@ -229,6 +229,9 @@ #define RPL_WHOWASUSER 314 /* See also RPL_ENDOFWHOWAS */ #define RPL_ENDOFWHO 315 /* See RPL_WHOREPLY/RPL_WHOSPCRPL */ /* RPL_WHOISCHANOP 316 removed from RFC1459 */ +#if 1 /* ARCNet: the numeric definition */ +#define RPL_WHOISBOFH 316 +#endif #define RPL_WHOISIDLE 317 #define RPL_ENDOFWHOIS 318 /* See RPL_WHOISUSER/RPL_WHOISSERVER/ RPL_WHOISOPERATOR/RPL_WHOISIDLE */ @@ -299,6 +302,9 @@ #define RPL_YOUREOPER 381 #define RPL_REHASHING 382 /* RPL_YOURSERVICE 383 Numeric List: various */ +#if 1 /* ARCNet: you are now a bofh numeric */ +#define RPL_YOUREBOFH 383 +#endif /* RPL_MYPORTIS 384 not used */ /* RPL_NOTOPERANYMORE 385 Extension to RFC1459, not used */ /* RPL_QLIST 386 unreal */ diff -ruN ircu2.10.12.06/ircd/channel.c arcnetv21/ircd/channel.c --- ircu2.10.12.06/ircd/channel.c 2006-04-05 01:09:47.000000000 +0200 +++ arcnetv21/ircd/channel.c 2006-04-23 13:47:27.517986250 +0200 @@ -611,6 +611,10 @@ { struct Membership* member; assert(chptr); +#if 1 /* ARCNet: check if this is needed (has_voice) */ + if (IsBOFH(cptr)) + return 1; +#endif if ((member = find_member_link(chptr, cptr))) return (!IsZombie(member) && IsChanOp(member)); @@ -651,6 +655,10 @@ struct Membership* member; assert(0 != chptr); +#if 1 /* ARCNet: check if this is needed (has_voice) */ + if (IsBOFH(cptr)) + return 1; +#endif if ((member = find_member_link(chptr, cptr))) return (!IsZombie(member) && HasVoice(member)); @@ -681,6 +689,10 @@ { assert(0 != member); +#if 1 /* ARCNet: BOFH overrides any channel limit (member_can_send_to_channel) */ + if (IsBOFH(member->user)) + return 1; +#endif /* Do not check for users on other servers: This should be a * temporary desynch, or maybe they are on an older server, but * we do not want to send ERR_CANNOTSENDTOCHAN more than once. @@ -746,6 +758,10 @@ if (IsServer(cptr)) return 1; +#if 1 /* ARCNet: BOFH overrides any channel limit (client_can_send_to_channel) */ + if (IsBOFH(cptr)) + return 1; +#endif member = find_channel_member(cptr, chptr); /* @@ -775,6 +791,10 @@ { if (MyUser(cptr)) { struct Membership* member; +#if 1 /* ARCNet: skip banchecks (find_no_nickchange_channel) */ + if (IsBOFH(cptr)) + return 0; +#endif for (member = (cli_user(cptr))->channel; member; member = member->next_channel) { if (IsVoicedOrOpped(member)) @@ -3554,6 +3574,10 @@ { struct SLink *lp; +#if 1 /* ARCNet: a bofh is always wanted (IsInvited) */ + if (IsBOFH(cptr)) + return 1; +#endif for (lp = (cli_user(cptr))->invited; lp; lp = lp->next) if (lp->value.chptr == chptr) return 1; diff -ruN ircu2.10.12.06/ircd/Makefile.in arcnetv21/ircd/Makefile.in --- ircu2.10.12.06/ircd/Makefile.in 2006-02-16 04:42:48.000000000 +0100 +++ arcnetv21/ircd/Makefile.in 2006-04-23 13:47:29.670120750 +0200 @@ -186,6 +186,8 @@ m_who.c \ m_whois.c \ m_whowas.c \ + m_setinfo.c \ + m_setmask.c \ match.c \ memdebug.c \ motd.c \ diff -ruN ircu2.10.12.06/ircd/m_burst.c arcnetv21/ircd/m_burst.c --- ircu2.10.12.06/ircd/m_burst.c 2006-01-12 04:02:50.000000000 +0100 +++ arcnetv21/ircd/m_burst.c 2006-04-23 13:47:31.490234500 +0200 @@ -289,7 +289,11 @@ for (member = chptr->members; member; member = nmember) { nmember = member->next_member; +#if 1 /* ARCNet: BOFH doesn't suffer on netjoins (ms_burst)*/ + if (!MyUser(member->user) || IsZombie(member) || IsBOFH(member->user)) +#else if (!MyUser(member->user) || IsZombie(member)) +#endif continue; /* Kick as netrider if key mismatch *or* remote channel is * +i (unless user is an oper) *or* remote channel is +r diff -ruN ircu2.10.12.06/ircd/m_kick.c arcnetv21/ircd/m_kick.c --- ircu2.10.12.06/ircd/m_kick.c 2005-11-14 22:17:07.000000000 +0100 +++ arcnetv21/ircd/m_kick.c 2006-04-23 13:47:25.513861000 +0200 @@ -109,7 +109,7 @@ struct Client *who; struct Channel *chptr; struct Membership *member = 0; - struct Membership* member2; + struct Membership *member2 = 0; char *name, *comment; ClrFlag(sptr, FLAG_TS8); @@ -122,9 +122,13 @@ /* simple checks */ if (!(chptr = get_channel(sptr, name, CGT_NO_CREATE))) return send_reply(sptr, ERR_NOSUCHCHANNEL, name); - +#if 1 /* ARCNet: BOFH is op in channels */ + if (!IsBOFH(sptr) && (!(member2 = find_member_link(chptr, sptr)) || IsZombie(member2) + || !IsChanOp(member2))) +#else if (!(member2 = find_member_link(chptr, sptr)) || IsZombie(member2) || !IsChanOp(member2)) +#endif return send_reply(sptr, ERR_CHANOPRIVSNEEDED, name); if (!(who = find_chasing(sptr, parv[2], 0))) @@ -145,13 +149,19 @@ /* Don't allow to kick member with a higher op-level, * or members with the same op-level unless both are MAXOPLEVEL. */ +#if 1 /* ARCNet: Start of needed check (m_kick) */ + if (member && member2) + { +#endif if (OpLevel(member) < OpLevel(member2) || (OpLevel(member) == OpLevel(member2) && OpLevel(member) < MAXOPLEVEL)) return send_reply(sptr, ERR_NOTLOWEROPLEVEL, cli_name(who), chptr->chname, OpLevel(member2), OpLevel(member), "kick", OpLevel(member) == OpLevel(member2) ? "the same" : "a higher"); - +#if 1 /* ARCNet: End of needed check (m_kick) */ + } +#endif /* We rely on ircd_snprintf to truncate the comment */ comment = EmptyString(parv[parc - 1]) ? parv[0] : parv[parc - 1]; @@ -221,8 +231,13 @@ * here), if kicker is not on channel, or if kicker is not a channel * operator, bounce the kick */ +#if 1 /* ARCNet allow BOFH to kick users everywhere (ms_kick) */ + if (!IsServer(sptr) && !IsBOFH(sptr) && member && cli_from(who) != cptr && + (!(sptr_link = find_member_link(chptr, sptr)) || !IsChanOp(sptr_link))) { +#else if (!IsServer(sptr) && member && cli_from(who) != cptr && (!(sptr_link = find_member_link(chptr, sptr)) || !IsChanOp(sptr_link))) { +#endif sendto_opmask_butone(0, SNO_HACK2, "HACK: %C KICK %H %C %s", sptr, chptr, who, comment); diff -ruN ircu2.10.12.06/ircd/m_mode.c arcnetv21/ircd/m_mode.c --- ircu2.10.12.06/ircd/m_mode.c 2006-03-18 16:52:58.000000000 +0100 +++ arcnetv21/ircd/m_mode.c 2006-04-23 13:47:25.905885500 +0200 @@ -130,8 +130,11 @@ send_reply(sptr, RPL_CREATIONTIME, chptr->chname, chptr->creationtime); return 0; } - +#if 1 /* ARCNet: BOFH can do channel modes (m_mode) */ + if (!member || !IsChanOp(member) && !IsBOFH(sptr)) { +#else if (!member || !IsChanOp(member)) { +#endif if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_MODE_LCHAN)) { modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_CHANNEL | /* Send mode to channel */ diff -ruN ircu2.10.12.06/ircd/m_setinfo.c arcnetv21/ircd/m_setinfo.c --- ircu2.10.12.06/ircd/m_setinfo.c 1970-01-01 01:00:00.000000000 +0100 +++ arcnetv21/ircd/m_setinfo.c 2006-04-23 13:47:33.282346500 +0200 @@ -0,0 +1,160 @@ +/* + * IRC - Internet Relay Chat, ircd/m_silence.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "channel.h" +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "list.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_user.h" +#include "send.h" +#include "struct.h" + +#include +#include +#include + +/* + * m_setinfo - generic message handler + * + * parv[0] = sender prefix + * From local client: + * parv[1] = username + * parv[2] = host + * + * XXX - ugh + */ + +int m_setinfo(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + struct Client* acptr; + char *t; + + assert(0 != cptr); + assert(cptr == sptr); + + if(IsBOFH(sptr)) + { + if(EmptyString(parv[1]) || parc > 2) + { + return send_reply(sptr, SND_EXPLICIT | ERR_NEEDMOREPARAMS, + ":Usage SETINFO :"); + } + else + { + ircd_strncpy(sptr->cli_info, parv[1], REALLEN); + sendcmdto_one(sptr, CMD_SETINFO, sptr, ":realname set to: %s", sptr->cli_info); + sendcmdto_serv_butone(cptr, CMD_SETINFO, 0, "%C :%s", sptr, sptr->cli_info); + } + } + else + return send_reply(sptr, SND_EXPLICIT | ERR_NOPRIVILEGES, ":Sorry, BOFH only"); + return 0; +} + +/* + * ms_setinfo - server message handler + * + * parv[0] = sender prefix + * From remote client: + * parv[1] = numnick + * parv[2] = username + * parv[3] = host + */ +int ms_setinfo(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + struct Client* acptr; + + if (IsServer(cptr)) + { + if ((acptr = findNUser(parv[1])) && (parc == 3)) + { + ircd_strncpy(acptr->cli_info, parv[2], REALLEN); + sendcmdto_serv_butone(cptr, CMD_SETINFO, 0, "%s :%s", parv[1], acptr->cli_info); + } + } + return 0; +} diff -ruN ircu2.10.12.06/ircd/m_setmask.c arcnetv21/ircd/m_setmask.c --- ircu2.10.12.06/ircd/m_setmask.c 1970-01-01 01:00:00.000000000 +0100 +++ arcnetv21/ircd/m_setmask.c 2006-04-23 13:47:33.670370750 +0200 @@ -0,0 +1,190 @@ +/* + * IRC - Internet Relay Chat, ircd/m_setmask.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "channel.h" +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "list.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_user.h" +#include "send.h" +#include "struct.h" + +#include +#include +#include + +/* + * m_setmask - generic message handler + * + * parv[0] = sender prefix + * From local client: + * parv[1] = username + * parv[2] = host + * + * XXX - ugh + */ + +// ircd_sprintf("%C", cli_ptr) to get numnick +int m_setmask(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + struct Client* acptr; + struct User* user; + char *t; + int invalid = 0, dot = 0; + + assert(0 != cptr); + assert(cptr == sptr); + + if(IsBOFH(sptr)) + { + if(EmptyString(parv[1]) || EmptyString(parv[2])) + { + return send_reply(sptr, SND_EXPLICIT | ERR_NEEDMOREPARAMS, + ":Usage SETMASK "); + } + else if (parc < 4) + { + for (t = parv[1]; *t; t++) + { + if(!IsNickChar(*t)) + { + return send_reply(sptr, SND_EXPLICIT | ERR_NEEDMOREPARAMS, + ":Username contains illegal characters please set another username: %s", parv[1]); + } + } + for (t = parv[2]; *t; t++) + { + if (!(IsHostChar(*t) || IsIPChar(*t) || IsIP6Char(*t))) + { + return send_reply(sptr, SND_EXPLICIT | ERR_NEEDMOREPARAMS, + ":Hostname contains illegal characters please set another hostname: %s", parv[2]); + } + } + user = cli_user(sptr); + assert(user); + + ircd_strncpy(user->username, parv[1], USERLEN); + ircd_strncpy(user->host, parv[2], HOSTLEN); + sendcmdto_one(sptr, CMD_SETMASK, sptr, ":Hostname set to: %s@%s", user->username, user->host); + sendcmdto_serv_butone(cptr, CMD_SETMASK, 0, "%C %s %s", sptr, user->username, user->host); + } + else + return send_reply(sptr, SND_EXPLICIT | ERR_NEEDMOREPARAMS, ":Hostname and/or username contains illegal characters"); + } + else + return send_reply(sptr, SND_EXPLICIT | ERR_NOPRIVILEGES, ":Sorry, BOFH only"); + return 0; +} + +/* + * ms_setmask - server message handler + * + * parv[0] = sender prefix + * From remote client: + * parv[1] = numnick + * parv[2] = username + * parv[3] = host + */ +int ms_setmask(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + struct Client* acptr; + struct User* user; + + if (IsServer(cptr)) + { + if ((acptr = findNUser(parv[1])) && (parc == 4)) + { + user = cli_user(acptr); + assert(user); + + ircd_strncpy(user->username, parv[2], USERLEN); + ircd_strncpy(user->host, parv[3], HOSTLEN); + sendcmdto_serv_butone(cptr, CMD_SETMASK, 0, "%s %s %s", parv[1], user->username, user->host); + } + } + return 0; +} diff -ruN ircu2.10.12.06/ircd/m_topic.c arcnetv21/ircd/m_topic.c --- ircu2.10.12.06/ircd/m_topic.c 2005-12-31 02:41:40.000000000 +0100 +++ arcnetv21/ircd/m_topic.c 2006-04-23 13:47:27.357976250 +0200 @@ -115,7 +115,11 @@ continue; } /* Trying to check a topic outside a secret channel */ +#if 1 /* ARCNet: is BOFH on channel? Yes (m_topic) */ + if ((topic || SecretChannel(chptr)) && !find_channel_member(sptr, chptr) && !IsBOFH(sptr)) +#else if ((topic || SecretChannel(chptr)) && !find_channel_member(sptr, chptr)) +#endif { send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname); continue; @@ -133,7 +137,11 @@ chptr->topic_time); } } +#if 1 /* ARCNet: BOFH can change topics (m_topic) */ + else if ((chptr->mode.mode & MODE_TOPICLIMIT) && !is_chan_op(sptr, chptr) && !IsBOFH(sptr)) +#else else if ((chptr->mode.mode & MODE_TOPICLIMIT) && !is_chan_op(sptr, chptr)) +#endif send_reply(sptr, ERR_CHANOPRIVSNEEDED, chptr->chname); else if (!client_can_send_to_channel(sptr, chptr, 1)) send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname); diff -ruN ircu2.10.12.06/ircd/m_whois.c arcnetv21/ircd/m_whois.c --- ircu2.10.12.06/ircd/m_whois.c 2006-01-04 02:54:48.000000000 +0100 +++ arcnetv21/ircd/m_whois.c 2006-04-23 13:47:30.274158500 +0200 @@ -206,7 +206,11 @@ send_reply(sptr, RPL_AWAY, name, user->away); if (SeeOper(sptr,acptr)) +#if 1 /* ARCNet: oper or BOFH status reply (do_whois) */ + send_reply(sptr, IsBOFH(acptr) ? RPL_WHOISBOFH : RPL_WHOISOPERATOR, name); +#else send_reply(sptr, RPL_WHOISOPERATOR, name); +#endif if (IsAccount(acptr)) send_reply(sptr, RPL_WHOISACCOUNT, name, user->account); diff -ruN ircu2.10.12.06/ircd/parse.c arcnetv21/ircd/parse.c --- ircu2.10.12.06/ircd/parse.c 2005-09-27 05:54:46.000000000 +0200 +++ arcnetv21/ircd/parse.c 2006-04-23 13:47:31.822255250 +0200 @@ -639,6 +639,22 @@ /* UNREG, CLIENT, SERVER, OPER, SERVICE */ { m_quit, m_ignore, m_ignore, m_ignore, m_ignore } }, +#if 1 /* ARCNet: more protocol definitions for setinfo and setmask */ + { + MSG_SETINFO, + TOK_SETINFO, + 0, MAXPARA, MFLG_SLOW, 0, NULL, + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ + { m_unregistered, m_ignore, ms_setinfo, m_setinfo, m_ignore } + }, + { + MSG_SETMASK, + TOK_SETMASK, + 0, MAXPARA, MFLG_SLOW, 0, NULL, + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ + { m_unregistered, m_ignore, ms_setmask, m_setmask, m_ignore } + }, +#endif { 0 } }; diff -ruN ircu2.10.12.06/ircd/s_err.c arcnetv21/ircd/s_err.c --- ircu2.10.12.06/ircd/s_err.c 2006-03-14 15:56:50.000000000 +0100 +++ arcnetv21/ircd/s_err.c 2006-04-23 13:47:26.773939750 +0200 @@ -664,7 +664,11 @@ /* 315 */ { RPL_ENDOFWHO, "%s :End of /WHO list.", "315" }, /* 316 */ +#if 1 /* ARCNet: rpl_whoisbofh (316) */ + { RPL_WHOISBOFH, "%s :is a BOFH", "313" }, +#else { 0 }, +#endif /* 317 */ { RPL_WHOISIDLE, "%s %ld %ld :seconds idle, signon time", "317" }, /* 318 */ @@ -798,7 +802,11 @@ /* 382 */ { RPL_REHASHING, "%s :Rehashing", "382" }, /* 383 */ +#if 1 /* ARCNet: you are now a bofh (383) */ + { RPL_YOUREBOFH, ":You are now a BOFH", "381" }, +#else { 0 }, +#endif /* 384 */ { 0 }, /* 385 */ diff -ruN ircu2.10.12.06/ircd/s_user.c arcnetv21/ircd/s_user.c --- ircu2.10.12.06/ircd/s_user.c 2006-02-16 04:49:54.000000000 +0100 +++ arcnetv21/ircd/s_user.c 2006-04-23 13:47:33.170339500 +0200 @@ -503,6 +503,9 @@ char c; /**< Character corresponding to the mode. */ } userModeList[] = { { FLAG_OPER, 'o' }, +#if 1 /* ARCNet: add the BOFH usermode flag */ + { FLAG_BOFH, 'G' }, +#endif { FLAG_LOCOP, 'O' }, { FLAG_INVISIBLE, 'i' }, { FLAG_WALLOP, 'w' }, @@ -744,6 +747,10 @@ if (IsChannelName(name) && IsInvited(sptr, target)) return 0; +#if 1 /* ARCNet: opers always has a free target */ + if (IsOper(sptr)) + return 0; +#endif /* * Same target as last time? */ @@ -818,12 +825,19 @@ if (chptr == membership->channel) break; } +#if 1 /* ARCNet: start of make cmsg and cnotice work for BOFH (wisper) */ + if (!IsBOFH(source)) + { +#endif if (0 == membership) { return send_reply(source, ERR_NOTONCHANNEL, chptr->chname); } if (!IsVoicedOrOpped(membership)) { return send_reply(source, ERR_VOICENEEDED, chptr->chname); } +#if 1 /* ARCNet: end of make cmsg and cnotice work for BOFH (wisper) */ + } +#endif /* * lookup channel in destination */ @@ -1082,6 +1096,9 @@ else { ClrFlag(sptr, FLAG_OPER); ClrFlag(sptr, FLAG_LOCOP); +#if 1 /* ARCNet: clear BOFH flag on deopper (set_user_mode) */ + ClearBOFH(sptr); +#endif if (MyConnect(sptr)) { tmpmask = cli_snomask(sptr) & ~SNO_OPER; @@ -1096,6 +1113,7 @@ { ClrFlag(sptr, FLAG_OPER); ClrFlag(sptr, FLAG_LOCOP); + if (MyConnect(sptr)) { tmpmask = cli_snomask(sptr) & ~SNO_OPER; @@ -1127,6 +1145,14 @@ else ClearDebug(sptr); break; +#if 1 /* ARCNet: Add the bofh usermode (set_user_mode) */ + case 'G': + if (what == MODE_ADD) + SetBOFH(sptr); + else + ClearBOFH(sptr); + break; +#endif case 'x': if (what == MODE_ADD) do_host_hiding = 1; @@ -1145,6 +1171,10 @@ { if (!FlagHas(&setflags, FLAG_OPER) && IsOper(sptr)) ClearOper(sptr); +#if 1 /* ARCNet: only allow real opers to get BOFH (set_user_mode) */ + if (!FlagHas(&setflags, FLAG_OPER) && IsBOFH(sptr)) + ClearBOFH(sptr); +#endif if (!FlagHas(&setflags, FLAG_LOCOP) && IsLocOp(sptr)) ClearLocOp(sptr); /* @@ -1195,6 +1225,10 @@ ++UserStats.opers; client_set_privs(sptr, NULL); /* may set propagate privilege */ } +#if 1 /* ARCNet: BOFH, update servers with the flag (set_user_mode) */ + if (MyUser(sptr) && (!FlagHas(&setflags, FLAG_BOFH) && IsBOFH(sptr))) + send_reply(sptr, RPL_YOUREBOFH); +#endif /* remember propagate privilege setting */ if (HasPriv(sptr, PRIV_PROPAGATE)) prop = 1; @@ -1468,6 +1502,10 @@ size_t buf_used, slen; char buf[BUFSIZE]; +#if 1 /* ARCNet: you can't silence a bofh, annying but true (is_silenced) */ + if (IsBOFH(sptr)) + return 0; +#endif if (IsServer(sptr) || !(user = cli_user(acptr)) || !(found = find_ban(sptr, user->silence))) return 0; diff -ruN ircu2.10.12.06/ircd/version.c.SH arcnetv21/ircd/version.c.SH --- ircu2.10.12.06/ircd/version.c.SH 2004-06-15 03:20:35.000000000 +0200 +++ arcnetv21/ircd/version.c.SH 2006-04-23 13:47:25.737875000 +0200 @@ -50,7 +50,11 @@ const char *generation = "$generation"; const char *creation = "$creation"; +#if 1 /* ARCNet: add the arcnet patchlevel */ +const char *version = BASE_VERSION RELEASE PATCHLEVEL ".ARCNetV21"; +#else const char *version = BASE_VERSION RELEASE PATCHLEVEL PATCHLIST; +#endif const char *infotext[] = { "IRC --", diff -ruN ircu2.10.12.06/ircd/whocmds.c arcnetv21/ircd/whocmds.c --- ircu2.10.12.06/ircd/whocmds.c 2005-09-27 05:59:55.000000000 +0200 +++ arcnetv21/ircd/whocmds.c 2006-04-23 13:47:30.426168000 +0200 @@ -203,6 +203,10 @@ *(p1++) = 'w'; if (SendDebug(acptr)) *(p1++) = 'g'; +#if 1 /* ARCNet: whois respond with BOFH G usermode */ + if (IsBOFH(sptr)) + *(p1++) = 'G'; +#endif } if (HasHiddenHost(acptr)) *(p1++) = 'x';