Added can_override oper flag

This commit is contained in:
codemastr 2002-11-17 17:31:30 +00:00
parent 1b17b5c0be
commit d1e0d459c5
6 changed files with 37 additions and 14 deletions

View file

@ -164,7 +164,7 @@ Unreal3.2-Selene (BETA12) Release Notes
kick" ban override and joining a +s channel without realizing it is +s and therefore you
shouldn't know it exists.
* If you use the SSL features of Unreal, you should use OpenSSL 0.9.6e or later. This is
* If you use the SSL features of Unreal, you should use OpenSSL 0.9.6g or later. This is
important as the older versions may make the program exploitable. See
http://www.openssl.org for more information
@ -198,5 +198,10 @@ Unreal3.2-Selene (BETA12) Release Notes
* We have removed ./Setup - Please read the new docs for information on configuring &
setting up Unreal3.2
* A new oper flag, can_override/v has been added. This is an attempt to stop oper abuse.
All opers can no longer use oper-override, this oflag MUST be in place for oper-override
to be allowed. Can_override is NOT assumed to be present no matter what your flags,
meaning you could be +N but still not be allowed to use oper-override.
* MAKE SURE YOU RERUN ./Config AND RUN make clean BEFORE USING THIS VERSION!!!

View file

@ -1663,3 +1663,7 @@ seen. gmtime warning still there
you actually have.
- Fixed a bug in the win32 debugger where the contents of the core file were not written
until ok was clicked. Reported by Simon Bell.
- Added an operflag can_override (v) only opers with this flag are allowed to use
oper-override.
- Fixed a bug in SVSO where the t and Z flags could not be removed.
- Updated .RELEASE.NOTES to include can_override

View file

@ -498,7 +498,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define OFLAG_HIDE 0x04000000 /* gets auto +x on oper up */
#define OFLAG_TKL 0x10000000 /* can use G:lines and shuns */
#define OFLAG_GZL 0x20000000 /* can use global Z:lines */
#define OFLAG_WMASTER 0x40000000
#define OFLAG_OVERRIDE 0x40000000 /* can use oper-override */
#define OFLAG_INVISIBLE 0x80000000
#define OFLAG_LOCAL (OFLAG_REHASH|OFLAG_HELPOP|OFLAG_GLOBOP|OFLAG_WALLOP|OFLAG_LOCOP|OFLAG_LROUTE|OFLAG_LKILL|OFLAG_KLINE|OFLAG_UNKLINE|OFLAG_LNOTICE)
#define OFLAG_GLOBAL (OFLAG_LOCAL|OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE)
@ -507,6 +507,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define OFLAG_ADMIN_ (OFLAG_ADMIN | OFLAG_GLOBAL)
#define OFLAG_SADMIN_ (OFLAG_SADMIN | OFLAG_GLOBAL)
#define OPCanOverride(x) ((x)->oflag & OFLAG_OVERRIDE)
#define OPCanTKL(x) ((x)->oflag & OFLAG_TKL)
#define OPCanGZL(x) ((x)->oflag & OFLAG_GZL)
#define OPCanZline(x) ((x)->oflag & OFLAG_ZLINE)

View file

@ -1,4 +1,4 @@
/* Unreal Internet Relay Chat Daemon, src/channel.c
/* Unreal Internet Relay Chat Daemon, src/channel.c
* Copyright (C) 1990 Jarkko Oikarinen and
* University of Oulu, Co Center
*
@ -1222,7 +1222,8 @@ CMD_FUNC(m_mode)
#ifndef NO_OPEROVERRIDE
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
&& !is_half_op(sptr, chptr) && IsOper(sptr))
&& !is_half_op(sptr, chptr) && (MyClient(sptr) ? (IsOper(sptr) &&
OPCanOverride(sptr)) : IsOper(sptr)))
{
sendts = 0;
opermode = 1;
@ -1230,7 +1231,8 @@ CMD_FUNC(m_mode)
}
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
&& is_half_op(sptr, chptr) && IsOper(sptr))
&& is_half_op(sptr, chptr) && (MyClient(sptr) ? (IsOper(sptr) &&
OPCanOverride(sptr)) : IsOper(sptr)))
{
opermode = 2;
goto aftercheck;
@ -3398,7 +3400,7 @@ CMD_FUNC(m_kick)
continue;
if (!IsServer(cptr)
#ifndef NO_OPEROVERRIDE
&& !IsOper(sptr)
&& (!IsOper(sptr) || !(MyClient(sptr) && OPCanOverride(sptr)))
#endif
&& !IsULine(sptr) && !is_chan_op(sptr, chptr)
&& !is_halfop(sptr, chptr))
@ -3679,10 +3681,12 @@ CMD_FUNC(m_topic)
|| IsULine(sptr) || is_halfop(sptr, chptr)) && topic)
{
/* setting a topic */
if (IsOper(sptr) && !(is_halfop(sptr, chptr)
|| IsULine(sptr)
|| is_chan_op(sptr, chptr))
&& (chptr->mode.mode & MODE_TOPICLIMIT))
if ((MyClient(sptr) ? (IsOper(sptr) &&
OPCanOverride(sptr)) : IsOper(sptr)) &&
!(is_halfop(sptr, chptr)
|| IsULine(sptr)
|| is_chan_op(sptr, chptr))
&& (chptr->mode.mode & MODE_TOPICLIMIT))
{
#ifdef NO_OPEROVERRIDE
return 0;
@ -3782,7 +3786,8 @@ CMD_FUNC(m_invite)
if (chptr->mode.mode & MODE_NOINVITE && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if (IsOper(sptr) && sptr == acptr)
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
#endif
@ -3797,7 +3802,8 @@ CMD_FUNC(m_invite)
if (!IsMember(sptr, chptr) && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if (IsOper(sptr) && sptr == acptr)
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
#endif
@ -3821,7 +3827,8 @@ CMD_FUNC(m_invite)
if (!is_chan_op(sptr, chptr) && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if (IsOper(sptr) && sptr == acptr)
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
#endif
@ -3835,7 +3842,8 @@ CMD_FUNC(m_invite)
else if (!IsMember(sptr, chptr) && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if (IsOper(sptr) && sptr == acptr)
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
#endif

View file

@ -192,6 +192,7 @@ static int _OldOperFlags[] = {
OFLAG_INVISIBLE, '^',
OFLAG_TKL, 't',
OFLAG_GZL, 'Z',
OFLAG_OVERRIDE, 'v',
0, 0
};
@ -209,6 +210,7 @@ static OperFlag _OperFlags[] = {
{ OFLAG_LKILL, "can_localkill" },
{ OFLAG_LNOTICE, "can_localnotice" },
{ OFLAG_LROUTE, "can_localroute" },
{ OFLAG_OVERRIDE, "can_override" },
{ OFLAG_REHASH, "can_rehash" },
{ OFLAG_RESTART, "can_restart" },
{ OFLAG_INVISIBLE, "can_stealth"},

View file

@ -80,6 +80,9 @@ int oper_access[] = {
OFLAG_WHOIS, 'W',
OFLAG_HIDE, 'H',
OFLAG_INVISIBLE, '^',
OFLAG_TKL, 't',
OFLAG_GZL, 'Z',
OFLAG_OVERRIDE, 'v',
0, 0
};