diff -u --recursive ircd-hybrid-6b122/include/client.h ircd-hybrid-6b122-senko/include/client.h --- ircd-hybrid-6b122/include/client.h Sat Sep 4 22:21:07 1999 +++ ircd-hybrid-6b122-senko/include/client.h Sat May 13 20:35:05 2000 @@ -332,6 +332,10 @@ #define FLAGS_OPER 0x4000 /* Operator */ #define FLAGS_LOCOP 0x8000 /* Local operator -- SRB */ +/* stealth and god flags, only usable by global opers -senko */ +#define FLAGS_STEALTH 0x10000 /* stealth flag */ +#define FLAGS_GOD 0x20000 /* God flag */ + /* *sigh* overflow flags */ #define FLAGS2_RESTRICTED 0x0001 /* restricted client */ #define FLAGS2_PING_TIMEOUT 0x0002 @@ -374,14 +378,17 @@ #define SEND_UMODES (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP) + #define ALL_UMODES (SEND_UMODES | FLAGS_SERVNOTICE | FLAGS_CCONN | \ FLAGS_REJ | FLAGS_SKILL | FLAGS_FULL | FLAGS_SPY | \ FLAGS_NCHANGE | FLAGS_OPERWALL | FLAGS_DEBUG | \ - FLAGS_BOTS | FLAGS_EXTERNAL ) + FLAGS_BOTS | FLAGS_EXTERNAL | \ + FLAGS_STEALTH | FLAGS_GOD ) #ifndef OPER_UMODES #define OPER_UMODES (FLAGS_OPER | FLAGS_WALLOP | FLAGS_SERVNOTICE | \ - FLAGS_SPY | FLAGS_OPERWALL | FLAGS_DEBUG | FLAGS_BOTS) + FLAGS_SPY | FLAGS_OPERWALL | FLAGS_DEBUG | FLAGS_BOTS | \ + FLAG_STEALTH | FLAGS_GOD ) #endif /* OPER_UMODES */ #ifndef LOCOP_UMODES @@ -432,6 +439,12 @@ #define SendNickChange(x) ((x)->umodes & FLAGS_NCHANGE) #define SetWallops(x) ((x)->umodes |= FLAGS_WALLOP) +#ifdef STEALTH_OPERS +#define IsStealth(x) (((x)->umodes & FLAGS_STEALTH) && IsOper(x)) +#endif /* STEALTH_OPERS */ +#ifdef IRC_GODS +#define IsGod(x) (((x)->umodes & FLAGS_GOD) && IsOper(x)) +#endif /* IRC_GODS */ #ifdef REJECT_HOLD #define IsRejectHeld(x) ((x)->flags & FLAGS_REJECT_HOLD) diff -u --recursive ircd-hybrid-6b122/include/config.h ircd-hybrid-6b122-senko/include/config.h --- ircd-hybrid-6b122/include/config.h Tue Feb 1 04:25:02 2000 +++ ircd-hybrid-6b122-senko/include/config.h Sat May 13 21:44:26 2000 @@ -304,6 +304,21 @@ */ #define NO_OPER_FLOOD +/* STEALTH_OPERS - Global opers can set +S (stealth) mode and make + * themselves invisible even on whois/userhost, except from other + * opers. -senko + */ +#define STEALTH_OPERS + +/* IRC_GODS - Global opers can set +G (God) mode and make themselves + * all-mighty. Oper with +G mode can't be kicked, can set chanmodes and + * topic and kick people without being chanop, and can enter and speak + * in any channel regardles of +b, +i, +l, +m and +k channel modes. Still, + * god can't enter juped channel (who know what kind of bugs that could + * trigger) and can't op himself. -senko + */ +#define IRC_GODS + /* SHOW_INVISIBLE_LUSERS - show invisible clients in LUSERS * As defined this will show the correct invisible count for anyone who does * LUSERS on your server. On a large net this doesnt mean much, but on a diff -u --recursive ircd-hybrid-6b122/include/config.h.dist ircd-hybrid-6b122-senko/include/config.h.dist --- ircd-hybrid-6b122/include/config.h.dist Tue Feb 1 04:25:02 2000 +++ ircd-hybrid-6b122-senko/include/config.h.dist Sat May 13 21:37:43 2000 @@ -304,6 +304,21 @@ */ #define NO_OPER_FLOOD +/* STEALTH_OPERS - Global opers can set +S (stealth) mode and make + * themselves invisible even on whois/userhost, except from other + * opers. -senko + */ +#undef STEALTH_OPERS + +/* IRC_GODS - Global opers can set +G (God) mode and make themselves + * all-mighty. Oper with +G mode can't be kicked, can set chanmodes and + * topic and kick people without being chanop, and can enter and speak + * in any channel regardles of +b, +i, +l, +m and +k channel modes. Still, + * god can't enter juped channel (who know what kind of bugs that could + * trigger) and can't op himself. -senko + */ +#undef IRC_GODS + /* SHOW_INVISIBLE_LUSERS - show invisible clients in LUSERS * As defined this will show the correct invisible count for anyone who does * LUSERS on your server. On a large net this doesnt mean much, but on a diff -u --recursive ircd-hybrid-6b122/src/channel.c ircd-hybrid-6b122-senko/src/channel.c --- ircd-hybrid-6b122/src/channel.c Sun Jan 2 23:41:00 2000 +++ ircd-hybrid-6b122-senko/src/channel.c Sat May 13 21:23:19 2000 @@ -771,6 +771,13 @@ } #endif +/* IsGod checking is done before find_user_link so gods can always send + * to channel without even being there. -senko + */ +#ifdef IRC_GODS + if (IsGod(cptr)) return 0; +#endif /* IRC_GODS */ + lp = find_user_link(chptr->members, cptr); if (chptr->mode.mode & MODE_MODERATED && @@ -1168,9 +1175,16 @@ user_mode = user_channel_mode(sptr, chptr); chan_op = (user_mode & CHFL_CHANOP); +#ifdef IRC_GODS + /* has ops or is a server, OR is a God. interesting thing is that + * even God can't op himself (sanity check, performed below), but + * thats not needed anyway. -senko */ + ischop = IsServer(sptr) || chan_op || IsGod(sptr); +#else /* IRC_GODS */ /* has ops or is a server */ ischop = IsServer(sptr) || chan_op; - +#endif /* IRC_GODS */ + /* is client marked as deopped */ isdeop = !ischop && !IsServer(sptr) && (user_mode & CHFL_DEOPPED); @@ -2284,6 +2298,10 @@ } #endif +#ifdef IRC_GODS + if (IsGod(sptr)) return 0; +#endif /* IRC_GODS */ + if ( (ban_or_exception = is_banned(sptr, chptr)) == CHFL_BAN) return (ERR_BANNEDFROMCHAN); else @@ -3477,7 +3495,12 @@ * -Dianora */ + /* Some admins aren't so nice to their users. So here it goes... -senko */ +#ifdef IRC_GODS + if (!IsServer(sptr) && !is_chan_op(sptr, chptr) && !IsGod(sptr) ) +#else /* IRC_GODS */ if (!IsServer(sptr) && !is_chan_op(sptr, chptr) ) +#endif /* IRC_GODS */ { /* was a user, not a server, and user isn't seen as a chanop here */ @@ -3547,7 +3570,11 @@ return(0); } +#ifdef IRC_GODS + if (IsMember(who, chptr) && !IsGod(who)) +#else /* IRC_GODS */ if (IsMember(who, chptr)) +#endif /* IRC_GODS */ { sendto_channel_butserv(chptr, sptr, ":%s KICK %s %s :%s", parv[0], @@ -3774,7 +3801,11 @@ if(topic) /* a little extra paranoia never hurt */ { if ((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || +#ifdef IRC_GODS + is_chan_op(sptr, chptr) || IsGod(sptr)) +#else /* IRC_GODS */ is_chan_op(sptr, chptr)) +#endif /* IRC_GODS */ { /* setting a topic */ /* diff -u --recursive ircd-hybrid-6b122/src/m_userhost.c ircd-hybrid-6b122-senko/src/m_userhost.c --- ircd-hybrid-6b122/src/m_userhost.c Sun Jan 2 23:41:01 2000 +++ ircd-hybrid-6b122-senko/src/m_userhost.c Sat May 13 20:33:52 2000 @@ -134,7 +134,11 @@ if ((acptr = find_person(cn, NULL))) { - ircsprintf(response[i], "%s%s=%c%s@%s", +#ifdef STEALTH_OPERS + /* if oper has stealth status, don't show his info -senko */ + if (!IsAnOper(acptr) || !IsStealth(acptr)) +#endif /* STEALTH_OPERS */ + ircsprintf(response[i], "%s%s=%c%s@%s", acptr->name, IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+', diff -u --recursive ircd-hybrid-6b122/src/m_whois.c ircd-hybrid-6b122-senko/src/m_whois.c --- ircd-hybrid-6b122/src/m_whois.c Wed Aug 11 01:07:22 1999 +++ ircd-hybrid-6b122-senko/src/m_whois.c Sat May 13 20:34:08 2000 @@ -143,6 +143,7 @@ parv[1] = parv[2]; } + if(!IsAnOper(sptr) && !MyConnect(sptr)) /* pace non local requests */ { if((last_used + WHOIS_WAIT) > CurrentTime) @@ -200,6 +201,18 @@ return 0; /* continue; */ } + +#ifdef STEALTH_OPERS + /* if oper has stealth status, don't show his info, except + * if global oper requests it -senko */ + if (IsAnOper(acptr) && IsStealth(acptr)) + { + sendto_one(sptr, form_str(ERR_NOSUCHNICK), + me.name, parv[0], nick); + return 0; + } +#endif /* STEALTH_OPERS */ + if(!IsPerson(acptr)) { sendto_one(sptr, form_str(RPL_ENDOFWHOIS), diff -u --recursive ircd-hybrid-6b122/src/s_user.c ircd-hybrid-6b122-senko/src/s_user.c --- ircd-hybrid-6b122/src/s_user.c Tue Feb 1 04:25:07 2000 +++ ircd-hybrid-6b122-senko/src/s_user.c Sat May 13 21:36:45 2000 @@ -93,6 +93,12 @@ {FLAGS_EXTERNAL, 'x'}, {FLAGS_SPY, 'y'}, {FLAGS_OPERWALL, 'z'}, +#ifdef STEALTH_OPERS + {FLAGS_STEALTH, 'S'}, +#endif /* STEALTH_OPERS */ +#ifdef IRC_GODS + {FLAGS_GOD, 'G'}, +#endif /* IRC_GODS */ {0, 0} }; @@ -111,7 +117,11 @@ 0, /* D */ 0, /* E */ 0, /* F */ - 0, /* G */ +#ifdef IRC_GODS + FLAGS_GOD, /* G */ +#else /* IRC_GODS */ + 0, /* G */ +#endif /* IRC_GODS */ 0, /* H */ 0, /* I */ 0, /* J */ @@ -123,7 +133,11 @@ 0, /* P */ 0, /* Q */ 0, /* R */ - 0, /* S */ +#ifdef STEALTH_OPERS + FLAGS_STEALTH, /* S */ +#else /* STEALTH_OPERS */ + 0, /* S */ +#endif /* STEALTH_OPERS */ 0, /* T */ 0, /* U */ 0, /* V */