- Made it so undefining SHOW_SECRET (not the default) properly hides +s channels from ircops

(except netadmins), as it should. Reported and patch supplied by Jason ().
This commit is contained in:
Bram Matthys 2006-07-04 10:05:18 +00:00
parent 32495af164
commit e1dd8acd72
8 changed files with 16 additions and 17 deletions

View file

@ -1265,3 +1265,5 @@
- Added HOOKTYPE_SILENCED: this is called whenever a message did not get delivered to a user
because the user was on the silence list.
- Added OpenBSD 3.9 to the supported OS list.
- Made it so undefining SHOW_SECRET (not the default) properly hides +s channels from ircops
(except netadmins), as it should. Reported and patch supplied by Jason (#0002965).

View file

@ -613,6 +613,11 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define OPIsNetAdmin(x) ((x)->oflag & OFLAG_NETADMIN)
#define OPIsCoAdmin(x) ((x)->oflag & OFLAG_COADMIN)
#define OPIsWhois(x) ((x)->oflag & OFLAG_WHOIS)
#ifdef SHOW_SECRET
#define OPCanSeeSecret(x) IsAnOper(x)
#else
#define OPCanSeeSecret(x) IsNetAdmin(x)
#endif
#define OPSetRehash(x) ((x)->oflag |= OFLAG_REHASH)
#define OPSetDie(x) ((x)->oflag |= OFLAG_DIE)

View file

@ -269,7 +269,7 @@ DLLFUNC CMD_FUNC(m_list)
else /* Just a normal channel */
{
chptr = find_channel(name, NullChn);
if (chptr && (ShowChannel(sptr, chptr) || IsAnOper(sptr))) {
if (chptr && (ShowChannel(sptr, chptr) || OPCanSeeSecret(sptr))) {
#ifdef LIST_SHOW_MODES
modebuf[0] = '[';
channel_modes(sptr, &modebuf[1], parabuf, chptr);
@ -364,7 +364,7 @@ void _send_list(aClient *cptr, int numsend)
{
if (SecretChannel(chptr)
&& !IsMember(cptr, chptr)
&& !IsAnOper(cptr))
&& !OPCanSeeSecret(cptr))
continue;
/* Much more readable like this -- codemastr */
@ -405,7 +405,7 @@ void _send_list(aClient *cptr, int numsend)
else
strlcat(modebuf, "]", sizeof modebuf);
#endif
if (!IsAnOper(cptr))
if (!OPCanSeeSecret(cptr))
sendto_one(cptr,
rpl_str(RPL_LIST), me.name,
cptr->name,

View file

@ -126,7 +126,7 @@ DLLFUNC CMD_FUNC(m_names)
chptr = find_channel(para, (aChannel *)NULL);
if (!chptr || (!ShowChannel(sptr, chptr) && !IsAnOper(sptr)))
if (!chptr || (!ShowChannel(sptr, chptr) && !OPCanSeeSecret(sptr)))
{
sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name,
parv[0], para);

View file

@ -146,7 +146,7 @@ long flags = 0; /* cache: membership flags */
if (parc > 2 || SecretChannel(chptr))
{
if (!ismember && !IsServer(sptr)
&& !IsOper(sptr) && !IsULine(sptr))
&& !OPCanSeeSecret(sptr) && !IsULine(sptr))
{
sendto_one(sptr, err_str(ERR_NOTONCHANNEL),
me.name, parv[0], name);

View file

@ -796,7 +796,7 @@ static char *first_visible_channel(aClient *sptr, aClient *acptr, int *flg)
cansee = 0;
if (!cansee)
{
if (IsAnOper(sptr))
if (OPCanSeeSecret(sptr))
*flg |= FVC_HIDDEN;
else
continue;

View file

@ -209,11 +209,7 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
showchannel = 0;
if (ShowChannel(sptr, chptr))
showchannel = 1;
#ifndef SHOW_SECRET
if (IsAnOper(sptr) && !SecretChannel(chptr))
#else
if (IsAnOper(sptr))
#endif
if (OPCanSeeSecret(sptr))
showchannel = 1;
if ((acptr->umodes & UMODE_HIDEWHOIS) && !IsMember(sptr, chptr) && !IsAnOper(sptr))
showchannel = 0;

View file

@ -214,7 +214,7 @@ int w_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (!invis && HiddenChannel(chptr) &&
!SecretChannel(chptr))
showperson = 1;
else if (IsAnOper(sptr) && SecretChannel(chptr)) {
else if (OPCanSeeSecret(sptr) && SecretChannel(chptr)) {
showperson = 1;
showsecret = 1;
}
@ -266,11 +266,7 @@ int w_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
showchannel = 0;
if (ShowChannel(sptr, chptr))
showchannel = 1;
#ifndef SHOW_SECRET
if (IsAnOper(sptr) && !SecretChannel(chptr))
#else
if (IsAnOper(sptr))
#endif
if (OPCanSeeSecret(sptr))
showchannel = 1;
if ((acptr->umodes & UMODE_HIDEWHOIS) && !IsMember(sptr, chptr) && !IsAnOper(sptr))
showchannel = 0;