Commit graph

77 commits

Author SHA1 Message Date
Jilles Tjoelker 74b2fb72db pretty_mask(): Stop temporarily modifying the passed mask entirely. 2015-01-15 23:45:02 +01:00
Jilles Tjoelker f4e893b515 pretty_mask(): Use explicit lengths instead of temporarily writing '\0'.
This is slightly simpler and should fix Coverity warnings.
2015-01-15 23:38:50 +01:00
Jilles Tjoelker aea6c4f9e6 chmode: Check mlock when a local oper changes cmode +L/+P.
This check was erroneously removed when fixing /mode #channel f when +f is
mlocked. Mlock checks were restricted to the places requiring chanops
(other than viewing +eI lists); cmode +L/+P do not require chanops, but
still constitute a mode change that must be checked against mlock.
2014-08-18 00:26:38 +02:00
Jilles Tjoelker 0f8db0552e channel: Remove write-only field. 2014-05-29 17:41:35 +02:00
Jilles Tjoelker 51452a370b channel: Stop pretending to support per-mode server capabilities.
After a change for dynamic server capabilities, the code to send out mode
changes was changed to use the capabilities belonging to the last mode
being sent out. This does not make sense; therefore, just use no
capabilities and remove supporting infrastructure.
2014-05-29 17:40:16 +02:00
Douglas Freed cea0689e80 Fix const qualifier on raw_mask
Fixes compilation warning about losing const qualifier in assignment to
non-const variable

(cherry picked from commit 6d9c3f50944e1da3bf3a1be6454f85d6d6f7ab37)
2014-03-09 19:13:25 +01:00
Keith Buck 55abcbb20a Remove trailing whitespace from all .c and .h files.
3134 bytes were removed.
2014-03-03 04:25:47 +00:00
Keith Buck 77d3d2dbaf Remove s_assert definition from ircd_defs.h and add it to its own header.
s_assert requires some higher-level functionality that shouldn't be
present in ircd_defs.h. ircd_defs.h is used by ssld, which has no notion
of logging or sending IRC messages. Additionally, some of the headers
s_assert depends on result in conflicting definitions in ssld.c.

This change also fixes the compile when using --enable-assert=soft.
2013-09-10 06:10:14 +00:00
William Pitcock 6f7b36d5d0 Mostly enable support for checking format strings with -Wformat.
Basically derived from Ratbox 3.1.
2013-02-21 05:46:04 -06:00
Jilles Tjoelker f3b3ad0b07 chmode: Allow mode queries on mlocked modes.
Check mlock at the same point where chanops are checked (except for
querying a +e/+I list) and abstract this check into a function.

In particular, /mode #channel f is now again allowed if +f is mlocked.
2012-06-19 00:33:29 +02:00
William Pitcock f30a5ee4c4 Remove MODE_NOCTCP from core, in favor of chm_noctcp. 2012-03-31 22:48:36 -05:00
William Pitcock 67aeaba593 Remove MODE_NOCOLOR from core, replacing it with modules/chm_nocolour.so. 2012-03-31 22:26:45 -05:00
Keith Buck 3e910a1847 chmode.c: Fix bug in printing removed bans. 2012-02-06 16:38:10 +00:00
Jilles Tjoelker be0365e152 Add an error message if a ban mask is invalid.
This is given if the ban mask is too long, it is an invalid extban or the
forward channel is invalid and no other message has been given about that.
2011-12-18 23:24:22 +01:00
Jilles Tjoelker f2edb2be59 Disallow '$' in forward targets only, rather than all channel names. 2011-12-11 16:56:37 +01:00
Jilles Tjoelker e238d01db9 If use_forward is off, ignore forwarding bans rather than stripping the channel.
We do not want to set $r:* if $r:*$* was requested.
2011-12-10 17:17:13 +01:00
Jilles Tjoelker 5efa7ef677 Do not allow forward channels for +qeI, as in ircd-seven. 2011-12-10 00:58:08 +01:00
Jilles Tjoelker e1dc9e549f Apply the same restrictions to ban forwarding as to +f. 2011-12-10 00:45:57 +01:00
Jilles Tjoelker 0c7303213e Move checks for forward channels to a separate function.
No functional change is intended.
2011-12-10 00:40:07 +01:00
Jilles Tjoelker c55b2782fc Properly update 004/005 when a rehash changes use_forward. 2011-10-25 00:38:27 +02:00
Stephen Bennett 717f809762 Don't treat +r specially when displaying supported channel modes.
This used to be only advertised if a service was linked, which made
sense in ratbox when +r was only settable if services were available.
Now, however, +r is always available and so should always be advertised.
2011-10-24 19:59:31 +01:00
Jilles Tjoelker 1aa35c8af1 Make sure to check the length of a ban mask before removing a forward channel.
Otherwise a line might be truncated later, leading to desyncs.
2011-09-25 16:25:17 +02:00
Jilles Tjoelker 2da6f6ebd7 Put back use_forward. 2011-09-25 16:22:29 +02:00
Jilles Tjoelker 93fbe9c349 Fix double-free when removing a ban.
del_id() should not free the ban anymore, its caller does that now.
2011-09-14 00:52:56 +02:00
Elizabeth Jennifer Myers 25ea5d2fac Fix git fuckery.
Apparently my tree got horribly corrupted.
2011-08-12 21:27:52 -04:00
Elizabeth Jennifer Myers 73d0f900c0 chmode: fix construct_cflags_strings.
Accidentally ported too much from ircd-seven. Fix this.
2011-08-12 21:09:13 -04:00
Elizabeth Jennifer Myers 765d839d3c Port ircd-seven banfowards to charybdis.
nenolod gave the thumbs-up to port ircd-seven banfowards to charybdis to spb
for a while, and people have asked about it. Might as well do it since it's a
slow weekend.

Note that as a side effect use_forward is removed from the config and
unconditionally enabled!
2011-08-12 20:33:10 -04:00
Elizabeth Jennifer Myers 7eec45bc9d Back out chanroles.
While what chanroles are trying to accomplish is a good idea, it is
apparently unclear this is the proper way to do it. Until we figure out
the exact way we wish to do this, it should be reverted for now.
2011-07-07 21:24:14 -04:00
Elizabeth Jennifer Myers e794d39a80 Add client interface for GRANT.
TODO: implement notifications of grant privilege changes to the target.
2011-07-06 17:25:26 -04:00
William Pitcock f3bfe2c271 chanroles: instead of checking for chanop + CHANROLE_UNSET combination, grant a default set of flags.
this allows ops with zero effective privilege.
2011-07-06 15:12:46 -05:00
Elizabeth Jennifer Myers 8aabb973c0 Implement chanroles, as discussed with nenolod.
The theory behind this is that services sends an ENCAP * GRANT #channel
UID :+flagspec message specifying the chanroles the user has. They are
mapped into flag bits and applied to the membership of the user. They
then are restricted or permitted to what they can do based on the
permissions mask regardless of rank.

For backwards compatibility, the default permission bit (without a GRANT
statement) allows a user to to anything an existing op can do ONLY if
they are an op.

Todo: make CHANROLE_STATUS work (the ability to apply +ov to people),
which is at the moment controlled by CHANROLE_MODE.
2011-07-06 13:46:22 -04:00
Jilles Tjoelker fa0e215255 Tweak previous commit to avoid problems with OMODE.
Do not allow a user to op themselves if they are
already opped, as "already opped" could be because
of OMODE's hack which will be unconditionally
reverted after the mode change.

Also, this matches old behaviour for users not
being able to generate mode changes redundantly
opping themselves.

Note that this change should only be taken advantage
of if all servers run patched code. Otherwise, mode
changes will be silently dropped and a desync
results.
2010-12-31 02:43:16 +01:00
William Pitcock 402cce0b9c Remove stupid hybrid-esque 'impossible to op yourself' hack.
Who the fuck thought that check was a good idea?
2010-12-30 19:21:14 -06:00
William Pitcock 96d2612765 Don't bother running the get_channel_access hook if the client is not really on the channel. 2010-12-14 23:04:11 -06:00
William Pitcock 3c52f289b1 Actually make get_channel_access() public. 2010-12-07 00:12:36 -06:00
William Pitcock 749d8c11dd Add a hook for get_channel_access(). 2010-12-06 22:57:28 -06:00
William Pitcock 83b72f917a chmode: Remove chm_regonly, a vestige from ratbox which doesn't apply to native charybdis networks. 2010-12-06 22:46:37 -06:00
Jilles Tjoelker 6917ed0eba Send only one ERR_MLOCKRESTRICTED per MODE command.
This agrees with other error messages from MODE.
2010-08-24 23:03:23 +02:00
William Pitcock 6fb6bd15ae Enforce TS rules on MLOCKs. 2010-08-23 20:22:59 -05:00
William Pitcock 01ed04abaf Send numeric 735 on MLOCK policy-restricted mode changes that are ignored. 2010-08-23 19:04:46 -05:00
Stephen Bennett 6b8db2daf2 Allow the final parameter of MLOCK to be empty, to remove an existing mlock 2010-05-02 20:42:46 +01:00
Stephen Bennett 78e6b731e4 Rework ircd-side MLOCK enforcement: instead of trying to track modes locked on or off, instead keep a simple list of mode letters that are locked, and reject any change to those modes. 2010-04-30 22:01:21 +01:00
Jilles Tjoelker 19716b9fd6 New custom channel mode API allowing reloading such modules.
Additionally, attempting to use too many modes or two times
the same letter is now detected and prevented.

Modules now request that a channel mode be added/orphaned,
instead of ugly manipulation from which that request had
to be guessed.

Slight changes are needed to modules that provide channel modes.
From the old API, one important function has been made static,
the other important function has been renamed, so loading old
modules should fail safely.
2010-04-01 01:16:16 +02:00
William Pitcock f02f338b31 chm_simple(): enforce MLOCK 2010-03-07 23:15:52 -06:00
William Pitcock 8727cbe88a Add propagation of MLOCK state for simple modes.
Special modes like +j can be tracked easily just by adding the necessary
code to parse them to set_channel_mlock().  This will cover propagation
as well.
2010-03-07 23:13:39 -06:00
Alexander F?r?y 51027be825 Use RPL_QUIETLIST and RPL_ENDOFQUIETLIST instead of RPL_BANLIST and
RPL_ENDOFBANLIST for channel mode +q.
2010-02-27 01:08:41 +01:00
William Pitcock 2e918bf515 Merge +C (no CTCP to channels) from ircd-seven. 2010-01-19 02:11:04 -06:00
Stephen Bennett 179f024d18 / is a host character and not a nick character, so make pretty_mask treat it as such 2009-04-20 08:42:41 -05:00
Jilles Tjoelker a33bdd9fb6 Remove obsolete comment. 2009-01-25 21:02:04 +01:00
Valery Yatsko acdf71d9d2 A very draft version of extensions, which are adding can_join hooks for custom channel modes 2008-07-27 12:10:48 +04:00