Commit Graph

115 Commits

Author SHA1 Message Date
Christian Aistleitner e84000f7b8 Add PAMServiceName setting to specify the used PAM configuration
This setting allows to run multiple ngIRCd instances with
PAM configurations on each instance.
If one sets it to "ngircd-foo", PAM will use `/etc/pam.d/ngircd-foo`
instead of the default `/etc/pam.d/ngircd`.
2016-06-05 23:48:29 +02:00
Alexander Barton 49ab79d0e6 Limit the number of message targes, and suppress duplicates
This prevents an user from flooding the server using commands like this:

  PRIVMSG nick1,nick1,nick1,...

Duplicate targets are suppressed silently (channels and clients).

In addition, the maximum number of targets per PRIVMSG/NOTICE/... command
are limited to MAX_HNDL_TARGETS (25). If there are more, the daemon sends
the new 407 (ERR_TOOMANYTARGETS_MSG) numeric, containing the first target
that hasn't been handled any more.

Closes #187.
2016-01-04 22:15:46 +01:00
LucentW 21767c968d Implement +I (private channel list on whois)
Implements enhancement requested in issue #179
2015-04-29 14:04:06 +02:00
Alexander Barton bf2eae3249 Allow longer usernames for authentication 2014-09-11 22:04:31 +02:00
Alexander Barton 40ed94a1f2 Increase MAX_SERVERS from 16 to 64
There are installations out there that would like to configure more
than 16 links per server, so increase this limit. Best would be to
get rid of MAX_SERVERS altogether and make if fully dynamic, but
start with this quick and dirty hack ...
2014-07-20 13:19:36 +02:00
Alexander Barton 5713c49c84 Implement user mode "F": "relaxed flood protection"
ngIRCd relaxes its flood protection for users having the user mode "F" set
and allows them to rapidly send data to the daemon. This mode is only
settable by IRC Operators and can cause problems in the network -- so be
careful and only set it on "trusted" clients!

User mode "F" is used by Bahamut for this purpose, for example, see
<http://docs.dal.net/docs/modes.html#4.9>.
2014-03-18 14:55:38 +01:00
Federico G. Schwindt 62865f7e19 Add support for longer config lines
With the introduction of CipherList we could have longer config lines.
Handle up to 1024 bytes and warn if the line will be truncated.
2013-10-17 22:10:53 +01:00
Alexander Barton 5e775a3fae Introduce "CHANTYPES" #define
This #define lists all the prefix characters of all supported channel
types, this is "#&+" at the moment.
2013-08-04 00:35:08 +02:00
Alexander Barton 7ea3864a93 IncludeDir: default to "$SYSCONFDIR/ngircd.conf.d"
Now "IncludeDir" defaults to "$SYSCONFDIR/ngircd.conf.d" instead
of no directory, but a missing directory is only reported as an
error if it has explicitely configured in the main configuration
file and simply ignored otherwise.

Therefore it is now possible not to touch the default (sample)
configuration file at all, and set all distribution and/or system
specific configuration options in "*.conf" files stored in
"$SYSCONFDIF/ngircd.conf.d/".

Thanks to "Elmasloco" for the idea!
2013-05-25 00:25:38 +02:00
Federico G. Schwindt 3ab00e3a11 Change Lists_MakeMask() to receive a buffer for the mask
Change callers accordingly so they don't rely on a global buffer and
rename Mask to Pattern where it makes sense since some functions
where indeed receiving a pattern and not a mask.
2013-04-20 00:43:47 +01:00
Alexander Barton b33da9b8f3 Increase password length limit to 64 characters
Closes bug #154.
2013-03-08 19:31:57 +01:00
Alexander Barton 950aeec3ff Use "${docdir}/Commands.txt" as help text file 2013-01-01 19:25:06 +01:00
Alexander Barton f68aa02272 Implement new configuration option "HelpFile"
This new configuration option allows to specify a specially formatted
text file which can be used by the HELP command to provide information
about the commands and their syntaxes.
2012-12-31 19:29:52 +01:00
Alexander Barton 1342f78b09 Allow user names up to 20 characters
This patch allows user names up to 20 characters when ngIRCd has not been
configured for "strict RFC mode".

Patch suggested by Brett Smith <brett@w3.org>, see
<http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>.
2012-12-10 10:41:36 +01:00
Alexander Barton 53917fa4b8 Add new IRC+ server flag "X": "XOP modes supported"
This flag indicates, that the server supports the enhanced "xop channel
user modes", like channel owner, admin, and halfop. This information is
used to make sure that no unsupported CHANINFO commands are sent to
servers not supporting such mode prefixes, for example.
2012-11-10 23:33:19 +01:00
Alexander Barton 35ed57e6c1 Implement METADATA command to update client metadata
The METADATA command can be used by other servers to update "metadata"
of registered clients, like the client info text ("real name"), user
name, and hostname:

  :<prefix> METADATA <target> <key> :<value>

It is distributed in the network, unknown <key> names are silently ignored
and passed on, too. This allows for further extensions.
2012-11-05 23:34:21 +01:00
Alexander Barton 48326e061a Spelling fix: "nick name" -> "nickname" 2012-11-02 14:30:19 +01:00
Brett Smith 32f63abb59 Make the maximum /list reply length a configurable limit. 2012-10-25 14:46:29 -04:00
DNS 58abd0777b Increased maximum number of possible user and channel modes
Currntly ngIRCd supports 13 user and 15 channel modes, because there
have been quite a few additions since our last release. But our data
structures can only hold 15 user and -- even worse! -- only 9 channel
modes! So enlarge the buffers to 20 bytes (actually 21 including NULL)
to allow storing of all mode characters and to have some space left
for more modes to come ...

(cherry picked from commit 8996d777621d88d4bcc439ab4792b2814920687f)
2012-10-19 18:44:15 +02:00
DNS777 9d97004a28 Implement user mode "b": block messages
When a user has set mode "b", all private messages and notices to this
user are blocked if they don't originate from a registered user, an IRC Op,
server or service. The originator gets an error numeric sent back in this
case, ERR_CANNOTSENDTONICK_MSG(976), which is/was(?) used by KineIRCd, too.

This closes bug #144.
2012-10-08 12:11:04 +02:00
Alexander Barton c9d166747d Merge branch 'bug141-ModesQq'
This closes bug #141.

* bug141-ModesQq:
  KICK-protect IRC services
  Implement channel mode "Q" and user mode "q"

Conflicts:
	src/ngircd/defines.h
	src/ngircd/messages.h
2012-10-06 22:37:57 +02:00
DNS777 de453d71cb Implement channel mode 'V' (invite disallow)
If the new channel mode "V" is set, the INVITE command becomes invalid
and all clients get the new ERR_NOINVITE_MSG(518) reply.

Unreal and InspIRCd uses this mode, too.

This closes bug #143.
2012-10-06 20:49:35 +02:00
Alexander Barton d3ae351236 Implement channel mode "Q" and user mode "q"
Both modes protect users from channel kicks: only IRC operators and
servers can kick users having mode "q" or in channels with mode "Q".

Original patch by DNS777 <dns@rbose.org>, thanks!

This closes bug #141.
2012-10-06 18:13:01 +02:00
Alexander Barton f37600ee01 Merge branch 'xop' of https://github.com/kart0ffelsack/ngircd into bug92-xop
* 'xop' of https://github.com/kart0ffelsack/ngircd:
  Tests and documentation for xop
  Implemented xop support

Conflicts (because of merge of the 'cmode-M' branch):
	src/ngircd/channel.c
	src/ngircd/defines.h
	src/ngircd/messages.h
2012-09-11 12:30:19 +02:00
Alexander Barton 1d3def0cc6 Merge branch 'umode-B'
This patch series allows ngIRCd to support the user mode "B" ("Bot flasg"):
it is settable and unsettable by every (non-restricted) client.
According to DNS777, this is how Unreal and InspIRCd do behave, so do we :-)

By Alexander Barton (1) and DNS777 (1)

* umode-B:
  Add new user mode "B" to doc/Modes.txt
  Implement an Unreal-like user mode "B" ("Bot mode")
2012-08-27 23:27:30 +02:00
DNS777 1aaf54ac24 Implement channel mode "M"
Only the server, identified users and IRC operators are able to talk.
2012-08-26 16:40:49 +02:00
DNS777 c2b39fdede Implement an Unreal-like user mode "B" ("Bot mode") 2012-08-26 15:58:37 +02:00
Sebastian Köhler 7b01bb833f Implemented xop support
3 new channel user modes have been added.

Half Op: +h(Prefix: %) can set the channel modes +imntvIbek
and kick all +v and normal users.

Admin: +a(Prefix: &) can set channel modes +imntvIbekoRsz and kick all
+o, +h, +v and normal users.

Owner: +q(Prefix: ~) can set channel modes +imntvIbekoRsz and kick all
+a, +o, +h, +v and normal users
2012-08-06 04:42:09 +02:00
Sebastian Köhler 49385a98b2 Implemented hashed cloaked hostnames for +x
CloakHostModeX can now contain '%x'. It will be replace by the hash of
the original client hostname. The new config option CloakHostModeXSalt
defines the salt for the hash function. When CloakHostModeXSalt is not
set a random salt will be generated after each server restart.

Spelling fix in defines.h
2012-08-03 04:09:37 +02:00
Alexander Barton 5e5377a063 Numeric 005 (ISUPPORT), CHANMODES: add missing mode "r" 2012-05-01 13:42:57 +02:00
Alexander Barton f2fa1045e2 Implement channel exception list (mode 'e')
This allows a channel operator to define exception masks that allow users
to join the channel even when a "ban" would match and prevent them from
joining: the exception list (e) overrides the ban list (b).
2012-01-21 19:59:57 +01:00
Alexander Barton 1f4711a547 Implement user mode 'C': require "same channel" to send message
If the target user of a PRIVMSG or NOTICE command has the user mode 'C'
set, it is required that both sender and receiver are on the same channel.

This prevents private flooding by completely unknown clients.
2012-01-16 11:43:22 +01:00
Alexander Barton 2f7d0c0839 Limit channel invite and ban lists to 50 entries
- New function Lists_Count().
 - New limit #define MAX_HNDL_CHANNEL_LISTS = 50.
 - New numeric #define ERR_LISTFULL_MSG(478).
 - Adjust numeric RPL_ISUPPORT2_MSG(005) accordingly ("MAXLIST")
2012-01-16 00:29:36 +01:00
Alexander Barton c5beca8aab Limit list replies of LIST, WHO, WHOIS, and MAX_RPL_WHOWAS
Introduce new #define's MAX_RPL_LIST(100), MAX_RPL_WHO(25),
MAX_RPL_WHOIS(10), and MAX_RPL_WHOWAS(25).
2012-01-06 20:06:25 +01:00
Alexander Barton 9260759cec DEFAULT_WHOWAS->DEF_RPL_WHOWAS; MAX_CMODES_ARG->MAX_HNDL_MODES_ARG
To streamline naming, in preparation for MAX_RPL_WHO and MAX_RPL_WHOWAS :-)
2012-01-06 18:57:31 +01:00
Alexander Barton c2ac1ad3ba defines.h: Code cleanup and (a little bit) more documentation 2012-01-06 18:25:10 +01:00
Alexander Barton 98493077a2 channel modes: only handle MAX_CMODES_ARG modes with arguments
Limit the MODE command to handle a maximum of MAX_CMODES_ARG (5) channel
modes that require an argument (+Ibkl) per call.

Please note: Further modes that require arguments are silently ignored
and end the handling of any further modes.
This is similar to the behavior of ircd2.11 (silently ignores but seems
to handle other modes) as well as ircd-seven (silently ignores but handles
some(!) other modes) ...
2012-01-06 17:27:29 +01:00
Alexander Barton 60812b6fdf defines.h: fix comment: "lenth" -> "length"
Reported by Christoph Biedl in #ngircd. Thanks!
2011-11-05 00:35:18 +01:00
Alexander Barton 8aac366802 Implemented user mode "R" and channel mode "R"
- User mode "R": indicates that the nick name of this user is "registered".
   This mode isn't handled by ngIRCd itself, but must be set and unset by
   IRC services like Anope.

 - Channel mode "R": only registered users (having the user mode "R" set)
   are allowed to join this channel.
2011-08-26 15:26:38 +02:00
Alexander Barton ea725b99b7 Enlarge client user mode buffer, reduce client flags buffer
We have to enlage our user mode buffer, so we can handle even unknown
user modes in the future; and reduce the client flags buffer, because
I can't imagine why we ever would need ~100 flags!?

Now we support up to 15 user modes (was: 8) and up to 15 flags (was: 99).

So in the end, we even save 99-15+8-15=77 bytes for each client structure!
2011-08-01 21:28:55 +02:00
Alexander Barton 2a7dd06ebd Code cleanup: mostly removing empty lines 2011-02-13 17:52:38 +01:00
Alexander Barton f732c7117e Make write buffers bigger, but flush early
This patch
 - makes the server write buffer bigger: 64k,
 - makes the regular write buffer bigger: 32k,
 - tries to flush the write buffer starting at 4K.

Before this patch, a client got disconnected if the buffer flushing at 4k
failed, now regular clients can store up to 32k and servers up 64k even
if flushing is not possible at the moment (e.g. on slow links).
2011-02-12 23:24:56 +01:00
Alexander Barton a57748e1a1 Implement channel mode 'O': "IRC operators only"
This channel mode is used on DALnet (bahamut), for example.
2011-01-10 12:15:05 +01:00
Alexander Barton 4a6d44dce2 Remove support for ZeroConf/Bonjour/Rendezvous service registration 2011-01-09 23:51:30 +01:00
Alexander Barton 2a4bf67aac Implement user mode "x": hostname cloaking (closes: #102)
When a client has user mode "x" set, its real hostname is cloaked
by substituting it with the server name (as configured in ngircd.conf).

Restricted clients (user mode "r") aren't allowed to change mode "x".

Please note that hostname cloaking is only in effect in server-client
communication! The server still uses the real hostname for its own
logging and for all server-server communication -- therefore all servers
in the network must support user mode "x" to prevent older servers
from leaking the real hostname of a cloaked client!
2010-08-17 21:05:06 +02:00
Florian Westphal 056de78e31 ngircd: change MOTD file handling
previously, the given MotdFile file was read whenever a client
requested it.

Change handling to read the MotdFile contents into memory once
during config file parsing.

Two side effects:
- changes to the MOTD file do not have any effect until ngircds
  configuration is reloaded
- MOTD file does no longer have to reside in the chroot directory
  (the MOTD contents will then not be re-read on reload in that case)
2010-08-12 21:46:47 +02:00
Alexander Barton f76e0a1db6 Implement user mode "c": receive connect/disconnect NOTICEs
Users having the user mode "c" set receive NOTICE messages on each
new client connection to the local server as well as disconnects.
Only IRC operators (users having the mode "o" set) are allowed to
set the 'c' user mode.

These connect/disconnect messages can be useful for open proxy
scanners -- BOPM (http://wiki.blitzed.org/BOPM) is now functional
with ngIRCd, for example.
2010-06-25 00:33:01 +02:00
Alexander Barton 9f58418765 Implemented new "secure clients only" channel mode: +z
Only clients using a SSL encrypted connection to the server are
allowed to join such a channel.

But please note three things:

a) already joined clients are not checked when setting this mode,
b) IRC operators are always allowed to join every channel, and
c) remote clients using a server not supporting this mode are not
   checked either and therefore always allowed to join.
2010-01-17 14:20:07 +01:00
Alexander Barton 3a2ac66f7f Added missing modes to USERMODES #define
Now the numeric 004 correctly reports all the supported user and channel
modes (user modes "r" and "w" were missing), e. g.:

  :a.irc.net 004 a a.irc.net ngircd-15 aiorsw biIklmnoPstv
2010-01-16 14:07:27 +01:00
Florian Westphal 28ca31e576 Remove limit on max number of configured irc operators. 2009-11-07 17:42:54 +01:00