Commit Graph

2119 Commits

Author SHA1 Message Date
Alexander Barton be88707027 Match list patterns case-insensitive
The invite-, ban-, and except lists are affected by this change,
as well as G-Lines an K-Lines.

Problem pointed out by "wowaname" on #ngircd, thanks!
2014-10-06 21:47:34 +02:00
Alexander Barton 84ff5a6eb9 Sync "except lists" between servers
Up to now, ban, invite, and G-Line lists have been synced between servers
while linking -- but obviously nobody noticed that except list have been
missing ever since. Until now.

Thanks to "j4jackj", who reported this issue in #ngircd.
2014-09-22 02:17:04 +02:00
Alexander Barton bf2eae3249 Allow longer usernames for authentication 2014-09-11 22:04:31 +02:00
Alexander Barton ffad2da835 Correctly check that a server has a valid hostname and port
David Binderman <dcb314@hotmail.com> reported the following compiler warning,
which is a real bug in ngIRCd, thanks!

conn.c:2077:55: warning: logical not is only applied to the left hand
                         side of comparison [-Wlogical-not-parentheses]
2014-09-10 13:03:30 +02:00
Alexander Barton 896d45471a Lists_MakeMask: Don't destroy source buffer 2014-08-08 13:50:48 +02:00
Alexander Barton 01c3552140 Initialize Conf_ScrubCTCP even when SYSLOG isn't #define'd
The "SYSLOG" #define isn't related to "Conf_ScrubCTCP" at all, so
initialize the latter even when "SYSLOG" isn't #define'd.

Pointed out by wowaname on #ngircd, thanks!
2014-07-29 23:08:18 +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 39b8fc65b6 Add "tests-skipped.lst" to src/testsuite/.gitignore 2014-06-04 12:20:31 +02:00
Alexander Barton 3de972e0bd Test suite/platformtest.sh: Detect when tests have been skipped
Detect if some tests have been skipped, for example when telnet(1) or expect(1)
is missing: ./contrib/platformtest.sh will echo a warning message now.
2014-06-04 12:15:23 +02:00
Alexander Barton a90004b913 Test suite: Update file headers and comments 2014-04-17 23:56:36 +02:00
Alexander Barton d314c75a37 Allow "DefaultUserModes" to set all possible modes
Let IRC_MODE() detect that the "fake" MODE command originated on the local
sever, which enables all modes to be settable using "DefaultUserModes"
that can be set by regular MODE commands, including modes only settable by
IRC Operators.
2014-03-18 16:43:21 +01:00
Alexander Barton 5009ab3e8c Spoofed prefixes: Really kill connection on non-server links
This fixes commit 6cbe1308 which only killed the connection when the
spoofed prefix itself belonged to a non-server client.
2014-03-18 16:30:38 +01: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
Alexander Barton 35f1db5f28 Handle "throttling" in a single function
ngIRCd uses "command throttling" and "bps throttling" (bytes per second).
The states are detected in different functions, Conn_Handler() and
Read_Request(), but handle the actual "throttling" in a common function:
this enables us to guarantee consistent behavior and to disable throttling
for special connections in only one place, eventually.
2014-03-18 14:53:29 +01:00
Alexander Barton f547981188 Streamline DEBUG_ARRAY, DEBUG_BUFFER, DEBUG_IO, DEBUG_ZIP
Change all #define's to follow the form
	#define DEBUG_xxx {0|1}
to disable (0, default) or enable (1) additional debug messages.

And somewhat enhance some DEBUG_BUFFER messages.
2014-03-17 23:54:44 +01:00
Alexander Barton b35f8916a5 conn.c: Code cleanup
Reformat and restructure some code, move all SSL related code into
one single #ifdef block, for example.
2014-03-17 22:59:58 +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 37090a28e8 portab.h: Restructure and clean up code
- Don't use HAVE_SYS_TYPES_H, <sys/types.h> is a required header now.
- Streamline check for boolean data types.
- Better indent #ifdef constructs.
2014-03-17 01:17:30 +01:00
Alexander Barton 7b10a0e4ee io.c: <sys/time.h> is only needed when using select()
Only include the <sys/time.h> header when using the select() IO API,
it isn't required otherwise.
2014-03-17 00:45:07 +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
Alexander Barton 51396f8f1c strdup.c: Code cleanup 2014-03-16 22:59:03 +01:00
Alexander Barton 6238196dac Don't define SSL_Want{Read|Write}() when SSL is disabled
Not even call the "dummy" functions.
2014-03-16 22:31:23 +01:00
Alexander Barton 43fb18f2f5 Code cleanup, remove blank lines 2014-03-16 22:11:26 +01:00
Alexander Barton a4ed90ba9a Fix two K&R C portability issues
Fix the following two errors emitted by the Apple K&R C compiler
on Apple A/UX:

"./class.c", line 47: no automatic aggregate initialization
"./class.c", line 47: illegal lhs of assignment operator

"./conf.c", line 1052: syntax error

Tested on A/UX 3.1.1.
2014-03-16 20:07:08 +01:00
Roy Sindre Norangshol 485d0aec81 Use server password when PAM is compiled in but disabled 2014-02-28 10:53:40 +01:00
Alexander Barton abf280d5bd CHARCONV: Fix handling conversion errors
Don't overwrite already converted text!
2014-02-23 18:20:47 +01:00
Alexander Barton ccc9e1baa4 Streamline punctuation of log messages
See commit d38d153f for details.
2014-02-09 16:01:13 +01:00
Alexander Barton 384b27cee0 IRC_INVITE(): Code cleanup 2014-02-02 00:27:24 +01:00
Alexander Barton 6496fa4655 Streamline punctuation of log messages
See commit d38d153f for details.
2014-02-02 00:27:03 +01:00
Alexander Barton 20b52fe33d Correctly use cloaked IRC masks on "INVITE nickname"
The cloaked IRC mask of a user is his visible mask, so the daemon has
to use it for generating the "one time" entries for the invite list of
the given channel.

Without this patch, ngIRCd records the real IRC mask which will never
match while the target client is "+x", and even worse, will disclose
the real mask on "MODE #channel +I" commands :-/

Bug reported by Cahata on #ngircd, thanks!
2014-01-27 23:05:29 +01:00
Alexander Barton 0fc822d8c4 Use correct sender as target for ISUPPORT replies on "VERSION"
This fixes commit 2e168c78 ("Return ISUPPORT(005) numerics on
'VERSION'") and make sure, that the 005 numerics are correctly
routed back to the sender.
2014-01-27 22:23:47 +01:00
Alexander Barton 2e168c7809 Return ISUPPORT(005) numerics on "VERSION"
This is how ircd-seven, Charybdis, Hybrid, and InspIRCd behave,
for example.
2014-01-26 23:41:59 +01:00
Mantas Mikulėnas e273bd226a Show account name in WHOIS
This uses the same numeric as Charybdis and ircu families.
2014-01-20 14:25:11 +02:00
Alexander Barton 599cfd0944 Merge branch 'no-range-matching' of git://arthur.barton.de/ngircd-alex
* 'no-range-matching' of git://arthur.barton.de/ngircd-alex:
  Remove "range matching" functionality
2014-01-17 23:11:37 +01:00
Alexander Barton e747fe9277 Fix configure script and "make check" for TCP Wrappers
Add missing #include's and static variables.

Problem spotted on OpenBSD.
2014-01-17 16:18:55 +01:00
Alexander Barton e73d70ce6f Remove "range matching" functionality
Don't support "range marching" in our pattern matching code using
the "[...]" syntax, because [ and ] are valid characters in nick
names and one has to quote them currently using the "\" character,
which is quite unexpected. For example:

  Nick "te[st" => "MODE #channel +b te\[st"

And remove quoting altogether, too, because "*" and "?" don't need
to be quoted because these characters are not allowed in IRC masks,
nicks, and hostnames.

Reported by "hifi" (Toni Spets) on IRC, thanks!
2014-01-15 14:58:57 +01:00
Alexander Barton fe73835666 Client_SetHostname(): Don't use strlen() to test for value 2014-01-10 19:57:05 +01:00
Alexander Barton 5b4b7e2f55 Test suite: explicitely enable glibc memory checking 2014-01-10 19:56:14 +01:00
Alexander Barton 8ae2cdfce9 Send "fake '*' key" in "MODE -k" replies
According to RFC 2812 3.2.3 "Channel mode message" and the examples
there, it looks like clients should use "MODE -k <key>" to unset channel
keys; and that's how other servers and services behave and do expect it.

(But please note that this is NOT the case for "MODE -l"!)

In the end, it doesn't make sense to specify a key when UNsetting it at
all, and different services behave diffrently when clients do not send
the currently set key to unset it - some ignore such calls, for example!

But this implementation is quite relaxed, it accepts any key when
unsetting channel mode "k" and even accepts no key at all. But the reply
will always include an "*" character for every "-k" parameter.
2014-01-08 14:24:03 +01:00
Alexander Barton 5d88030bd1 Support non-standard vsnprintf() return code
C99 states that vsnprintf() "returns the number of characters that
would have been printed if the n were unlimited"; but according to the
Linux manual page "glibc until 2.0.6 would return -1 when the output
was truncated" -- so we have to handle both cases ...
2014-01-04 23:57:05 +01:00
Alexander Barton 788da901ee Update Copyright notices for 2014 2014-01-02 15:27:07 +01:00
Alexander Barton 2a40112f09 Merge branch 'bug167-WebircIPAnoDNS' of git://arthur.barton.de/ngircd-alex
* 'bug167-WebircIPAnoDNS' of git://arthur.barton.de/ngircd-alex:
  WEBIRC: Don't respect hostname when DNS is disabled
2014-01-02 00:45:05 +01:00
Alexander Barton 61b7932e82 Merge branch 'bug165-005-NETWORK' of git://arthur.barton.de/ngircd-alex
* 'bug165-005-NETWORK' of git://arthur.barton.de/ngircd-alex:
  Implement new configuration option "Network"
2014-01-02 00:44:42 +01:00
Alexander Barton f024a4992a portabtest: Add checks for strdup(), strndup(), and strtok_r() 2014-01-01 16:38:36 +01:00
Alexander Barton d38747d951 portabtest: Actually test functions
Test functions snprintf(), strlcpy(), strlcat(), vsnprintf() for
correctness, not only existance (which was quite useless, because
if they weren't available, the program could not have been linked
at all ...).
2014-01-01 15:57:34 +01:00
Alexander Barton 18070e5381 portabtest: Only use one exit code to indicate errors 2013-12-29 17:48:25 +01:00
Alexander Barton d913323ca9 portabtest: Code cleanup 2013-12-29 17:46:54 +01:00
Federico G. Schwindt 9230f2fff1 Fix permanent k/gline
Reported by Toni Spets (hifi - at - jnz - dot - fi).
2013-12-29 01:14:28 +01:00