diff -r -c ircd-hybrid-6rc5p2/doc/example.conf ircd-hybrid-6rc5p2-hackops/doc/example.conf *** ircd-hybrid-6rc5p2/doc/example.conf Thu Oct 5 23:00:53 2000 --- ircd-hybrid-6rc5p2-hackops/doc/example.conf Fri Oct 27 13:00:54 2000 *************** *** 209,214 **** --- 209,215 ---- ## R/r - allow/disallow remote squit/connect ## U/u - allow/disallow unkline ## G/g - allow/disallow gline + ## E/e - allow/disallow hacking ops on opless channels - Xref ## N/n - allow the use of +n , which should be restricted to tcm use only ## for privacy reasons. (+c probably belongs controlled here too but isn't) ## H/h - allow the use of /rehash, default is H for O and o, add h to diff -r -c ircd-hybrid-6rc5p2/include/channel.h ircd-hybrid-6rc5p2-hackops/include/channel.h *** ircd-hybrid-6rc5p2/include/channel.h Thu Oct 5 23:00:55 2000 --- ircd-hybrid-6rc5p2-hackops/include/channel.h Wed Nov 8 10:59:27 2000 *************** *** 103,108 **** --- 103,111 ---- extern void del_invite (struct Client *, struct Channel *); extern void send_user_joins (struct Client *, struct Client *); extern int can_send (struct Client *, struct Channel *); + /* Begin Xref Hack */ + extern int chan_is_opless (struct Channel *); + /* End Xref Hack */ extern int is_chan_op (struct Client *, struct Channel *); extern int has_voice (struct Client *, struct Channel *); extern int user_channel_mode(struct Client *, struct Channel *); diff -r -c ircd-hybrid-6rc5p2/include/client.h ircd-hybrid-6rc5p2-hackops/include/client.h *** ircd-hybrid-6rc5p2/include/client.h Thu Jun 8 23:48:22 2000 --- ircd-hybrid-6rc5p2-hackops/include/client.h Fri Oct 27 12:28:59 2000 *************** *** 348,353 **** --- 348,355 ---- #define FLAGS2_OPER_K 0x0400 /* oper can kill/kline */ #define FLAGS2_OPER_DIE 0x0800 /* oper can die */ #define FLAGS2_OPER_REHASH 0x1000 /* oper can rehash */ + /* Begin Xref Hack */ + #define FLAGS2_OPER_HACKOPS 0x2000 /* oper can hack ops */ #define FLAGS2_OPER_FLAGS (FLAGS2_OPER_GLOBAL_KILL | \ FLAGS2_OPER_REMOTE | \ FLAGS2_OPER_UNKLINE | \ *************** *** 355,361 **** FLAGS2_OPER_N | \ FLAGS2_OPER_K | \ FLAGS2_OPER_DIE | \ ! FLAGS2_OPER_REHASH) /* ZIP_LINKS */ #define FLAGS2_ZIP 0x4000 /* (server) link is zipped */ --- 357,365 ---- FLAGS2_OPER_N | \ FLAGS2_OPER_K | \ FLAGS2_OPER_DIE | \ ! FLAGS2_OPER_REHASH | \ ! FLAGS2_OPER_HACKOPS) ! /* End Xref Hack */ /* ZIP_LINKS */ #define FLAGS2_ZIP 0x4000 /* (server) link is zipped */ *************** *** 491,496 **** --- 495,504 ---- #define IsOperDie(x) ((x)->flags2 & FLAGS2_OPER_DIE) #define SetOperRehash(x) ((x)->flags2 |= FLAGS2_OPER_REHASH) #define IsOperRehash(x) ((x)->flags2 & FLAGS2_OPER_REHASH) + /* Begin Xref Hack */ + #define SetHackOps(x) ((x)->flags2 |= FLAGS2_OPER_HACKOPS) + #define CanHackOps(x) ((x)->flags2 &= FLAGS2_OPER_HACKOPS) + /* End Xref Hack */ #define CBurst(x) ((x)->flags2 & FLAGS2_CBURST) /* diff -r -c ircd-hybrid-6rc5p2/include/config.h ircd-hybrid-6rc5p2-hackops/include/config.h *** ircd-hybrid-6rc5p2/include/config.h Sat Oct 21 02:36:07 2000 --- ircd-hybrid-6rc5p2-hackops/include/config.h Fri Oct 27 12:32:01 2000 *************** *** 939,944 **** --- 939,951 ---- */ #define GLINE_TIME (12*3600) + /* OPERS_CAN_HACK_OPS - ability to hack ops on opless channels + * Define this if you want OPME support + * when this is defined, opers can hack ops on opless channels. + * a global wallop to opers will be generated. + */ + #define OPERS_CAN_HACK_OPS + /* ----------------- archaic and/or broken section -------------------- */ #undef DNS_DEBUG diff -r -c ircd-hybrid-6rc5p2/include/m_commands.h ircd-hybrid-6rc5p2-hackops/include/m_commands.h *** ircd-hybrid-6rc5p2/include/m_commands.h Fri Jul 30 22:44:44 1999 --- ircd-hybrid-6rc5p2-hackops/include/m_commands.h Fri Oct 27 13:31:07 2000 *************** *** 36,41 **** --- 36,45 ---- extern int m_gline(struct Client *,struct Client *,int,char **); + /* Begin Xref Hack */ + extern int m_opme(struct Client *,struct Client *,int,char **); + /* End Xref Hack */ + extern int m_locops(struct Client *,struct Client *,int,char **); extern int m_private(struct Client *,struct Client *,int,char **); diff -r -c ircd-hybrid-6rc5p2/include/msg.h ircd-hybrid-6rc5p2-hackops/include/msg.h *** ircd-hybrid-6rc5p2/include/msg.h Fri Jun 9 22:45:36 2000 --- ircd-hybrid-6rc5p2-hackops/include/msg.h Sat Oct 28 16:41:06 2000 *************** *** 114,119 **** --- 114,122 ---- #define MSG_OPERWALL "OPERWALL" /* OPERWALL */ #define MSG_KLINE "KLINE" /* KLINE */ #define MSG_UNKLINE "UNKLINE" /* UNKLINE */ + /* Begin Xref Hack */ + #define MSG_OPME "OPME" /* OPME */ + /* End Xref Hack */ #define MSG_DLINE "DLINE" /* DLINE */ #define MSG_HTM "HTM" /* HTM */ #define MSG_SET "SET" /* SET */ *************** *** 237,242 **** --- 240,250 ---- { MSG_CLOSE, m_close, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_KLINE, m_kline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_UNKLINE, m_unkline, 0, MAXPARA, 1, 0, 0, 0L }, + /* Begin Xref Hack */ + #ifdef OPERS_CAN_HACK_OPS + { MSG_OPME, m_opme, 0, MAXPARA, 1, 0, 0, 0L }, + #endif + /* End Xref Hack */ { MSG_DLINE, m_dline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_GLINE, m_gline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_HASH, m_hash, 0, MAXPARA, 1, 0, 0, 0L }, diff -r -c ircd-hybrid-6rc5p2/include/s_conf.h ircd-hybrid-6rc5p2-hackops/include/s_conf.h *** ircd-hybrid-6rc5p2/include/s_conf.h Tue Aug 22 01:03:55 2000 --- ircd-hybrid-6rc5p2-hackops/include/s_conf.h Fri Oct 27 13:27:32 2000 *************** *** 322,327 **** --- 322,330 ---- #define CONF_OPER_K 32 #define CONF_OPER_REHASH 64 #define CONF_OPER_DIE 128 + /* Begin Xref Hack */ + #define CONF_OPER_HACKOPS 256 + /* End Xref Hack */ typedef struct { diff -r -c ircd-hybrid-6rc5p2/src/channel.c ircd-hybrid-6rc5p2-hackops/src/channel.c *** ircd-hybrid-6rc5p2/src/channel.c Mon Oct 23 20:02:29 2000 --- ircd-hybrid-6rc5p2-hackops/src/channel.c Wed Nov 8 12:42:22 2000 *************** *** 727,732 **** --- 727,749 ---- tmp->flags |= MODE_DEOPPED; } + /* Begin Xref Hack */ + + int chan_is_opless(struct Channel *chptr) + { + Link *lp; + int n = 1; + for (lp = chptr->members; lp; lp = lp->next) { + if (lp->flags & CHFL_CHANOP) { + n = 0; + break; + } + } + return(n); + } + + /* End Xref Hack */ + int is_chan_op(struct Client *cptr, struct Channel *chptr) { Link *lp; *************** *** 2909,2914 **** --- 2926,3021 ---- } } #endif + + /* Begin Xref Hack */ + + /* + ** m_opme + ** parv[0] = sender prefix + ** parv[1] = channel + */ + + int m_opme(struct Client *cptr, + struct Client *sptr, + int parc, + char *parv[]) + { + struct Channel *chptr; + struct Client *acptr; + char *p, *name; + + if (!(sptr->user)) + { + /* yep, something is definately wrong... :> */ + return 0; + } + if (!(MyOper(sptr) && CanHackOps(sptr))) { + sendto_one(sptr, form_str(ERR_UNKNOWNCOMMAND), me.name, parv[0], "OPME"); + return 0; + } + + if (parc < 2 || *parv[1] == '\0') { + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "OPME"); + return 0; + } + + name = strtoken( &p, parv[1], ","); + + while ( name ) + { + chptr = get_channel(sptr, name, 0); + if (!chptr) + { + sendto_one(sptr, form_str(ERR_NOSUCHCHANNEL), + me.name, parv[0], name); + name = strtoken(&p, (char *)NULL, ","); + continue; + } + + if (!IsMember(sptr, chptr)) + { + sendto_one(sptr, form_str(ERR_NOTONCHANNEL), + me.name, parv[0], name); + name = strtoken(&p, (char *)NULL, ","); + continue; + } + + if (!chan_is_opless(chptr)) + { + sendto_one(sptr, ":%s NOTICE %s %s :Channel is not opless", + me.name, parv[0], name); + name = strtoken(&p, (char *)NULL, ","); + continue; + } + + for (acptr = oper_cptr_list; acptr; acptr = acptr->next) + { + if (IsOper(acptr)) { + sendto_one(acptr, ":%s WALLOPS :%s[%s@%s] is regaining ops on opless channel %s", + me.name, + sptr->name, + sptr->username, + sptr->host, + name); + } + } + + find_user_link(chptr->members, cptr)->flags |= CHFL_CHANOP; + + sendto_match_servs(chptr, sptr, ":%s PART %s", + sptr->name, name); + sendto_match_servs(chptr, sptr, ":%s SJOIN %ld %s + :@%s", + me.name, chptr->channelts, name, sptr->name); + sendto_channel_butserv(chptr, sptr, ":%s MODE %s +o %s", + me.name, name, sptr->name); + + name = strtoken(&p, (char *)NULL, ","); + } + return 0; + + } + + /* End Xref Hack */ /* ** m_join diff -r -c ircd-hybrid-6rc5p2/src/s_conf.c ircd-hybrid-6rc5p2-hackops/src/s_conf.c *** ircd-hybrid-6rc5p2/src/s_conf.c Sat Oct 21 02:36:14 2000 --- ircd-hybrid-6rc5p2-hackops/src/s_conf.c Wed Nov 8 10:58:04 2000 *************** *** 2953,2958 **** --- 2953,2966 ---- int_privs |= CONF_OPER_REHASH; else if(*privs == 'h') /* disallow rehash */ int_privs &= ~CONF_OPER_REHASH; + /* Begin Xref Hack */ + #ifdef OPERS_CAN_HACK_OPS + else if(*privs == 'E') + int_privs |= CONF_OPER_HACKOPS; + else if(*privs == 'e') + int_privs &= ~CONF_OPER_HACKOPS; + #endif + /* End Xref Hack */ else if(*privs == 'D') int_privs |= CONF_OPER_DIE; /* allow die */ else if(*privs == 'd') *************** *** 3039,3044 **** --- 3047,3063 ---- } else *privs_ptr++ = 'h'; + + /* Begin Xref Hack */ + if(port & CONF_OPER_HACKOPS) + { + if(cptr) + SetHackOps(cptr); + *privs_ptr++ = 'E'; + } + else + *privs_ptr++ = 'e'; + /* End Xref Hack */ if(port & CONF_OPER_DIE) {