Commit Graph

84 Commits

Author SHA1 Message Date
Alexander Barton 398022631a Fix NJOIN not propagating "half ops" status
ngIRCd tested for the wrong prefix of "half ops" when processing NJOIN
commands and therefore never classified a remote user as "half op".

Thanks to wowaname for pointing this out on #ngircd!
2015-12-13 19:55:47 +01:00
Alexander Barton a534e71e8d Re-add #include's for header files of the C file itself
This partially reverts commit b130b35f4, "Update #include's: remove
unused and add missing ones", but fixes the following compiler and
analyzer warnings of Apple Xcode 5:

 "Semantic issue: No previous prototype for function 'yyy'"
2014-03-17 18:02:57 +01:00
Alexander Barton a13bb78b1e Update copyright notices of recently changed files 2014-03-17 12:22:00 +01:00
Alexander Barton b130b35f48 Update #include's: remove unused and add missing ones
The "deheader" tool (<http://www.catb.org/~esr/deheader/>) has been
used to find unused #include directives as well as missing ones.

Tested on:

- A/UX 3.1.1
- ArchLinux (2014-03-17)
- Debian GNU/Hurd
- Debian GNU/Linux 6.0.9
- Debian GNU/Linux 7.4
- Fedora 20
- FreeBSD 9.2
- OpenBSD 4.8
- OpenBSD 5.1
- OS X 10.9
- Solaris 11
2014-03-17 11:37:25 +01:00
Alexander Barton 259c314d14 Remove imp.h and exp.h header files
These include files don't have a function any more, remove them.
2014-03-17 00:17:02 +01:00
Federico G. Schwindt 48ea69d778 Remove unneded IRC_SetPenalty() calls
IRC_WriteErrClient() already calls IRC_SetPenalty().  While here convert
some IRC_SetPenalty() + IRC_WriteStrClient() to IRC_WriteErrClient().
2013-11-06 18:28:09 +00: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
Federico G. Schwindt bcb45da1b4 Add more penalty times
Ensure before every numeric 461 there is a call to IRC_SetPenalty().
2013-09-06 23:02:01 +01:00
Federico G. Schwindt 08f9d31d60 Rework check for number of parameters
Move most of the checks that return numeric 461 into Handle_Request().
2013-09-06 23:01:59 +01:00
Federico G. Schwindt 37609d6a4f Reorder checks
Move oper and Conf_MorePrivacy checks after checking the number of
parameters.
2013-09-05 17:31:57 +01:00
Alexander Barton 298158501d IRC_SERVER(): Code cleanup 2013-08-07 00:13:08 +02:00
Alexander Barton 904c8a4375 Introduce new function IRC_WriteErrClient()
This function is used to send "error messages", including numerics,
back to clients and to automatically enforce a 2 second penalty. With
this patch, all error results enforces a delay for the client.

All callers of IRC_WriteStrClient(ERR_xxx) have been converted.

Please note that this patch prolongs the time "make check" needs
to complete its tests, because of lots of new enforced penalties ...
2013-08-07 00:10:50 +02:00
Federico G. Schwindt 15dfdaac82 More spelling fixes
Remove superflous comments, mostly in German. Fix spelling and
use american variants for consistency.
2013-08-04 12:45:11 +01:00
Federico G. Schwindt e03d8eb728 Add Client_HasFlag() to check if a client has certain flag 2013-08-04 04:00:34 +01:00
Federico G. Schwindt a95d3e05e7 Fix spelling 2013-08-04 03:15:27 +01:00
Alexander Barton 4ec19c0332 Update irc-server.c to use irc-macros.h
And add some comments :-)
2013-08-03 00:00:47 +02:00
Alexander Barton d38d153f51 Streamline punctuation of log messages
Make sure that all log messages end with a correct punctuation mark.

The rules for formatting log messages are:

 1. Add punctuation marks to all messages passed to the actual logging
    functions like Log() and LogDebug().
 2. Don't add any punctuation marks to messages that are stored in
    variables for later use or are passed over the network.
 3. IP addresses, DNS host names and IRC server names should be quoted.
 4. Messages originating in the network should be quoted (at least if
    they are "untrusted" or variable).

Most probably this patch doesn't fix all mistakes, but it should be a
good starting point ...
2013-01-26 17:00:03 +01:00
Alexander Barton 30b32e84fe Fix warning message introduced when cleaning up IRC_SERVER()
This reverts a not intentional code change and fixes the following compiler
warning message (tested with gcc 4.4.5):

 irc-server.c: In function "IRC_SERVER":
 irc-server.c:142: warning: suggest parentheses around operand of "!"
                            or change "&" to "&&" or "!" to "~"
2012-10-29 11:44:45 +01:00
Alexander Barton eb4f9eac0c Don't accept connections for servers already beeing linked
If two servers try to link each other, there was a time frame that
could result in one connection overwriting the other, e. g. the incoming
connection overwriting the status of the outgoing one. And this could
lead to all kind of weirdness (even crashes!) later on.

So now such incoming connections are dropped. But this most probably
prevents the two servers from linking until timing changes somehow
(network latency?) because each server drops the incoming connection of
the other one, so no connection survives in the end.

But this has to be addressed by an other patch ...
2012-10-29 11:33:49 +01:00
Alexander Barton d7b5dd1bbf IRC_SERVER(): Code cleanup 2012-10-29 11:33:49 +01:00
Alexander Barton 384f965fba NJOIN: correctly reset channel level flags
This fixes commit 7b01bb83.
Bug reported by DNS777 <dns@rbose.org>, thanks!
2012-09-26 23:51:48 +02:00
Alexander Barton 0d67be3f30 Fix some "whitespace glitches"
Some have been introduced by commit 7b01bb83, some are older.
2012-09-11 12:48:51 +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
Brett Smith be97fa8ab1 Indentation and style fixes. 2012-08-23 14:18:15 -04:00
Brett Smith 0d5de60584 Move client password from the Client to the Connection struct.
This is a relatively naive implementation, basically doing the bare minimum
necessary to make the switchover go.  Subsequent commits can focus on
improving the implementation.
2012-08-23 11:07:08 -04: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
Alexander Barton 770a58ac6d Generate WALLOPS message on SQUIT from IRC operator
So SQUIT now behaves like CONNECT and DISCONNECT commands, when called
by an IRC operator (and not received from an other server).
2011-03-21 23:52:42 +01:00
Alexander Barton 2a7dd06ebd Code cleanup: mostly removing empty lines 2011-02-13 17:52:38 +01:00
Alexander Barton 03628dbeaf Add Doxygen @file documentation to each source and header file 2011-02-13 17:52:38 +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 881b9af251 Generate WALLOPS message on operator-generated SQUIT 2009-09-30 16:00:06 +02:00
Alexander Barton 294320ed62 Enable SQUIT command for IRC Operators
This patch enables IRC Operators to use the SQUIT command as specified in
RFC 2812, section 3.1.8 "Squit".

When forwarding SQUIT commands, the server connected to the target will
drop the connection (not the target server itself!).

Please note:

 - the configuration option "AllowRemoteOper" mus be enabled on the
   server disconnecting the target to allow forwarding of SQUIT commands.
 - if the remote server is configured to establish the connection, it
   will just do this; so the disconnect is not permanent in this case!
2009-09-30 16:00:06 +02:00
Alexander Barton bce16c2864 Code cleanup of IRC_SQUIT() in preparation to deal with bug #73. 2009-09-30 16:00:05 +02:00
Alexander Barton 3b37ad334b IRC_SERVER(): code cleanup, remove unneeded variable 2009-09-11 00:41:12 +02:00
Florian Westphal b545d38ae4 irc-server: do not remove hostnames from info text
that code does not really make sense -- the info
text is freely cofngiureable and des not follow a specific
format.

Also, that "+2" might have caused invalid memory accesses.
2009-04-22 23:15:17 +02:00
Florian Westphal 544b9884f4 remove or translate old comments 2009-04-21 20:58:30 +02:00
Alexander Barton a60465be3e Server links: detect RFC 1459 mode direct after SERVER command
This patch allows ngIRCd to detect right after receiving the SERVER command
from the peer whether the RFC 1459 compatibility mode must be used or not.
And it fixes the announcement of users during establishing new server links
with such peers.
2008-09-23 11:47:17 +02:00
Alexander Barton 47ca178a21 Introduce option to configure the maximum nick name lenth in ngircd.conf
- New configuration option "MaxNickLength" to specify the allowed maximum
  length of user nick names. Note: must be unique in an IRC network!
- Enhanced the IRC+ protocol to support an enhanced "server handshake" and
  enable server to recognice numeric 005 (ISUPPORT) and 376 (ENDOFMOTD).
  See doc/Protocol.txt for details.
2007-11-21 12:16:33 +00:00
Alexander Barton 53b98fd7e9 Fixes the wrong logging output when nested servers are introduced
to the network as well as the wrong output of the LINKS command.
2007-11-20 20:02:40 +00:00
Alexander Barton 06bfb3adfb Fix code to compile using K&R C compiler and ansi2kr again. 2007-11-18 15:05:35 +00:00
Florian Westphal fa7bb2790a moved invite/ban lists to channel structure 2006-12-07 17:57:20 +00:00
Florian Westphal 37602d1523 Log(LOG_DEBUG, .. -> LogDebug() 2006-12-02 14:10:48 +00:00
Florian Westphal 6e105bf87e channel maxusers now unsigned long 2006-10-06 21:32:58 +00:00
Alexander Barton 27d947fb7d Allow PASS syntax defined in RFC 1459 for server links, too.
Removed client status CLIENT_GOTPASSSERVER.
2006-10-01 19:05:00 +00:00
Alexander Barton 6d3686e73d Send invite and ban lists only once and not repeatedly for every channel. 2006-04-30 21:31:43 +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 3012c232eb Fixed resolver when using IDENT lookups, cleaned up code. 2004-05-11 00:01:11 +00:00
Alexander Barton dd59820051 Synchronize INVITE- and BAN-lists if the peer requests it:
server flag "L". And better debug logging.
2004-04-25 15:43:18 +00:00
Alexander Barton 57c7e23622 Added #include for strings.h to fix compiler warnings. 2004-01-17 03:17:49 +00:00