Commit Graph

113 Commits

Author SHA1 Message Date
Alexander Barton 02592f912e IRC_TOPIC(): code cleanup 2011-01-09 22:10:30 +01:00
Alexander Barton 5462c6c50f Don't #include client.h when conn.h/conn-func.h is already included
conn.h and cinn-func.h both already #include client.h, so it is
not needed to do it twice.
2010-06-30 23:49:52 +02:00
Alexander Barton cc336b7558 Only #include resolve.h if it is really needed 2010-06-29 22:55:27 +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 ecad9f32c8 Clean up and document IRC_JOIN() and join_allowed() functions 2010-01-16 22:30:55 +01:00
Florian Westphal e9e7fc33f1 add and use Channel_IsModeless()
avoid "name[0] == '+'" where possible, having Channel_IsModeless()
makes things much more obvious.
2009-03-07 00:13:25 +01:00
Alexander Barton c5000694d1 Support individual channel keys for pre-defined channels.
This patch introduces the new configuration variable "KeyFile" for
[Channel] sections in ngircd.conf. Here a file can be configured for each
pre-defined channel which contains individual channel keys for different
users. This file is line-based and must have the following syntax:

  <user>:<nick>:<key>

<user> and <nick> can contain the wildcard character "*".

Please not that these channel keys are only in effect, when the channel
has a regular key set using channel mode "k"!
2009-01-20 17:20:30 +01:00
Alexander Barton 2cc21caf32 Implement local channels (prefix "&")
This patch implements server-local channels, prefix "&", that are only
visible to users of the same local server and not in the network.

Patch written by Scott Perry (2008-06-04), see:
 - http://arthur.barton.de/cgi-bin/bugzilla/show_bug.cgi?id=87
 - http://arthur.barton.de/cgi-bin/bugzilla/attachment.cgi?id=24&action=view
2008-11-17 21:52:56 +01:00
Alexander Barton ec0b405d9d Respect RFC 1459 compatibility mode when announcing channels (no NJOIN). 2008-09-23 11:53:16 +02:00
Alexander Barton d93030ad27 Make real use of the CLIENT_SERVICE client type.
This patch enables ngIRCd to handle IRC services as real services, and not
as "fake users":

  - Set correct client type CLIENT_SERVICE for services,
  - Change log messages to include correct client type,
  - PRIVMSG: allow users to send messages to services,
  - Send services nick names to other servers (as users).

Please note that this patch doesn't announce services as services in the
network, but as regular users (as before). Only the local server knows
of services as services (see LUSERS command, for example). It is up to
one of the next patches to fix this and to introduce the SERVICE command
in server to server communication.

The propagation of services as regular users between servers doesn't limit
the functionality of the IRC services and will be the fallback for servers
that don't support "real" services propagation in the future.
2008-09-23 11:53:15 +02:00
Alexander Barton 258143897c Return 461 (syntax error) on "JOIN :" and "PART :"
Up to this patch ngIRCd did not return any result (GIT master) or a badly
formated 403 (":irc.server 403 test  :No such channel" [note the two
spaces!], branch-0-12-x) on the above commands, this patch changes the
behaviour to reflect ircd 2.11 which returns 461 in both cases.
2008-07-22 13:18:19 +02:00
Alexander Barton 258e39e89f Fix GCC warnings for possibly uninitialized variables in IRC_JOIN
This patch fixes the following two warnings of GCC 4.2.4:

irc-channel.c: In function "IRC_JOIN":
irc-channel.c:185:
 warning: "lastkey" may be used uninitialized in this function
irc-channel.c:185:
 warning: "lastchan" may be used uninitialized in this function
2008-06-16 13:18:03 +02:00
Scott Perry b90f71ca2a Use strtok_r instead of strchr in IRC_JOIN.
This patch does significant cleanup on the join code by using strtok_r
instead of mangling strchr to parse channel names and keys in parallel when
a JOIN command contains a list of channels and keys.

Also adds an strtok_r implementation to libportab.
2008-05-26 21:20:03 +02:00
Alexander Barton 956bbe2c28 Reset client idle time on NICK, JOIN, and PART 2008-05-24 21:50:54 +02:00
Rolf Eike Beer 83bfdddf99 Allow IRC ops to ignore channel limits when joining
Allow IRC ops to ignore any channel limit (bans, invite only etc.) when they
want to join a channel.
2008-05-05 14:45:28 +02:00
Florian Westphal f7c2e8223f Always enable modeless channels.
Modeless channels (+channels) are described in RFC 2811;
so my modifications to
530112b114
('Add support for modeless channels')
to disable +channels for --strict-rfc configurations
were wrong. This reverts those changes.
2008-05-01 18:08:07 +02:00
Ali Shemiran 530112b114 Add support for modeless channels
Add support for modeless channels (+channels).

[fw@strlen.de:
 - integrate test cases
 - don't support +channels when compiled with --strict-rfc
 - do not set +o mode for channel creator
 - force +nt mode when channel is created ]
2008-05-01 15:55:12 +02:00
Alexander Barton 25f48a2a34 IRC_PART(): code and comment cleanup. 2008-04-24 23:46:59 +02:00
Rolf Eike Beer 44cdf1b1ca Fix sending of JOINs between servers.
This does hit only operators that join a channel with at least 2 servers active in the net
the server the oper connects to sends "channel^Go" to the other servers
the other server first searches for the channel and then strips the modes from the channel name
he has to do the other way round: first strip and then check the channel name.
2008-02-26 23:49:33 +01:00
Florian Westphal 634ef8c131 IRC_JOIN cleanups.
- put sending of mode and forwarding of JOIN to other clients
 into seperate function.
- put sending of topic/channel names into seperate function.
- put access check into seperate function.
- translate/remove remaining german comments.
- stop if JOIN to a channel in a list (JOIN #a,#,b,#c...) fails
(This doesn't change the behaviour: skip-to-next-channel-on-error
did never work as intended)
2008-02-26 23:49:33 +01:00
Dana Dahlstrom c634303765 Remove duplicate Channel_FirstChannelOf().
noticed there's a way to make the loop
slightly more elegant.

[fw@strlen.de: Extra () to silence gcc.]
2008-02-26 23:49:33 +01:00
Dana Dahlstrom 6bd35bf090 Implement RFC 2812 handling of "0" argument to JOIN
The students in my software-engineering class are writing IRC clients in
Java, and I'm running ngIRCd as a sandbox for them to play in. We
noticed ngIRCd doesn't obey the "JOIN 0" command specified in RFC 2812:

   JOIN 0             ; Leave all currently joined
                      channels.

http://tools.ietf.org/html/rfc2812#section-3.2.1
I believe the following patch addresses this. Cheers!

[fw@strlen.de: put it into a seperate function]
2008-02-26 23:49:33 +01:00
Florian Westphal 463c5cb7c5 IRC_PART could reference invalid memory. 2008-01-07 11:42:00 +00:00
Alexander Barton 69081851ac SECURITY: Fixed a severe bug in handling JOIN commands, which could
cause the server to crash. Thanks to Sebastian Vesper, <net@veoson.net>.
2007-07-31 18:56:13 +00:00
Florian Westphal fa7bb2790a moved invite/ban lists to channel structure 2006-12-07 17:57:20 +00:00
Florian Westphal 058d3085a9 New configuration option "PredefChannelsOnly": if set, make
all JOINs to-non existants channel return ERR_BANNEDFROMCHAN_MSG,
restricting users to those channels defined in the config file.
2006-11-05 13:03:46 +00:00
Florian Westphal 6e105bf87e channel maxusers now unsigned long 2006-10-06 21:32:58 +00:00
Florian Westphal 4108e16be6 Channel_Join was severely broken. 2006-10-05 18:26:54 +00:00
Florian Westphal 4000e01b28 corrected return value 2006-03-16 20:14:16 +00:00
Florian Westphal 68d3d36dd6 removed silly if (foo) { if (foo){ }} statement 2006-03-16 19:56:34 +00:00
Alexander Barton ab3ac4e466 Removed obsolete debug message. 2005-09-05 08:11:11 +00:00
Alexander Barton e708790566 JOIN now supports more than one channel key at a time. 2005-09-02 15:46:49 +00:00
Alexander Barton ca32c1b311 Implementec numeric "333": Time and user name who set a channel topic. 2005-09-02 12:50:25 +00:00
Alexander Barton 94dd7fa7d6 IRC_LIST(): Added missing calls of Client_ID() and cleand up the code. 2005-06-12 18:23:59 +00:00
Florian Westphal 8adff59223 Remove INT, LONG, BOOLEAN, STATIC, CONST, CHAR datatypes.
use stdbool.h / inttypes.h if available.
2005-03-19 18:43:48 +00:00
Alexander Barton 4ef172d603 Implemented support for "secret channels" (channel mode "s"). 2005-03-02 16:35:10 +00:00
Alexander Barton 233210b906 Servers other than the destination server didn't clean up the invite
list of an "invite-only" channel properly when an INVITE'd user joined.
2004-04-09 20:46:46 +00:00
Alexander Barton cb76d96efb Fixed some warnings of non-gcc-compilers (e. g. original Apple compiler on
A/UX): "warning: illegal pointer combination, op =".
2004-03-11 22:16:31 +00:00
Alexander Barton 43d9a62473 - Enhanced (and fixed) CHANINFO command (channel keys, user limits). 2003-01-08 22:04:05 +00:00
Alexander Barton bb94d18115 - fixed up propagation of modes with arguments between servers. 2003-01-08 17:45:15 +00:00
Alexander Barton ae6a7e7c0b - Fixed up command forwarding: only to servers! 2003-01-01 13:29:40 +00:00
Alexander Barton 695631b298 - replaced a lot of strcpy() calls with strlcpy() which is more secure. 2002-12-26 17:04:54 +00:00
Alexander Barton 69ad0e386e - Implemented channel modes k (key) and l (user limit). 2002-12-16 23:06:46 +00:00
Alexander Barton 00e75ccd7d - fixed up Conf_MaxJoins test on JOIN. 2002-12-14 13:23:11 +00:00
Alexander Barton 5b8b3b8384 - maximum channels per user limit implemented. 2002-12-13 17:53:32 +00:00
Alexander Barton 490f28ffd1 - new file header format (in english);
- new file ident semantics.
2002-12-12 12:24:18 +00:00
Alexander Barton 0c471b84f7 - neues Source-Modul "irc-info"; neuer Befehl STATS. 2002-11-30 17:39:56 +00:00
Alexander Barton 1e59617d2c - Parser auf Befehlstabelle umgestellt. 2002-11-30 15:04:57 +00:00
Alexander Barton 005391ca5b - LIST kann nun auch an andere Server geforwarded werden. 2002-09-16 09:16:17 +00:00
Alexander Barton a1ded68a49 - ein "banned client" darf in einen Channel, wenn er "invited" ist. 2002-09-08 00:50:25 +00:00
Alexander Barton 1f9ba7b326 - neuen Befehl CHANINFO implementiert: IRC_CHANINFO(). 2002-09-03 23:56:55 +00:00
Alexander Barton f673fb960a - an Clients wurden Modes mit fuehrendem ":" geliefert. Das ist zwar RFC-
konform (IMO), macht aber leider grosse(!!) Probleme :-/
2002-08-27 13:57:03 +00:00
Alexander Barton d645ce86e9 - Bei einem JOIN in einen persistenten Channel werden nun evtl. zu setzende
User-Modes korrekt in den Channel gemeldet.
2002-08-26 23:39:22 +00:00
Alexander Barton 39b9f65d0d - IRC_LIST ruft nun Match() auf und beherrscht somit nun Patterns. 2002-06-26 15:44:15 +00:00
Alexander Barton e876e210da - Code-Stelle in IRC_JOIN "klarer" gemacht :-) 2002-06-10 21:10:25 +00:00
Alexander Barton f7567db01f - JOIN: Invite- und Ban-Lists werden nun beachtet. 2002-06-02 14:51:14 +00:00
Alexander Barton a2119a660a - fehlerhaften Fehlercode in IRC_TOPIC() gefixed. 2002-06-01 14:37:28 +00:00
Alexander Barton c2f60abe55 - Anpassungen an pre-ANSI-Compiler,
- Includes aufgeraumt: Header includieren keine anderen mehr.
2002-05-27 13:09:26 +00:00
Alexander Barton 040f5422f2 - persistente und vordefinierte Channels implementiert. 2002-05-21 00:10:16 +00:00
Alexander Barton 3c0c3c3c5f - Neue Funktion IRC_LIST() begonnen zu implementieren. 2002-04-23 19:51:14 +00:00
Alexander Barton bc4ed22635 - alle Client_GetFromID() durch Client_Search() ersetzt. 2002-03-25 17:08:54 +00:00
Alexander Barton ca33cbda05 - externe portab-Header werden nicht mehr benoetigt/benutzt, dadurch
einige Aenderungen an diversen Source-Dateien und Headern.
- Dateien enthalten keine CVS-History mehr.
2002-03-12 14:37:51 +00:00
Alexander Barton 2ee05c9a68 - Source in weitere Module fuer IRC-Befehle aufgesplitted. 2002-03-03 17:15:11 +00:00