Kobi Shmueli [Fri, 24 May 2013 10:38:13 +0000 (13:38 +0300)]
Fixed a bug on sendto_channel_butserv_me() function (src/send.c)
The bug causes Bahamut to hide mode and topic changes even if the channel isn't in auditorium mode.
Thanks to nt-spki for reporting this and thanks to srd for fixing it.
Changes to deal with bogus akills
- Changed m_akill() to warn about bogus akills and also "fix" them (add them anyway for 30 minutes
as services only sends AKILL commands when it really wants to take out users).
- Added more debugging to m_rakill().
Ned T. Crigler [Tue, 19 Mar 2013 23:31:05 +0000 (16:31 -0700)]
Fix 63 character hostname truncation.
Hostnames with exactly 63 characters were being truncated to 62
characters since register_user was using strncpyzt incorrectly.
The size given to strncpyzt should be the total size of the destination
buffer including the terminating '\0' character. register_user was using
HOSTLEN for the size instead of HOSTLEN + 1.
Added cmode +A (Auditorium mode).
When a channel is in auditorium mode, users can only see ops/voiced users on the channel and messages that are sent to the channel by non-ops/voiced users are being relayed to #channel-relay. Ops and voiced users can see the full user list.
Also, joins/parts/quits of non-ops/voiced users are only sent to ops/voiced users.
This channel mode is intended for network-wide events and currently can only be set by u:lined servers (services).
Ned T. Crigler [Sat, 2 Feb 2013 19:58:44 +0000 (11:58 -0800)]
Don't truncate long hostnames.
When a client connects from an IP address that resolves to a hostname
longer than HOSTLEN characters, the ircd truncates the excess
characters.
Until commit e2004bf0a2c851e7d81fc317b1cc230c9415d3e3, which increased
the resolver's maximum hostname length, this truncation behavior was
masked since the ircd tries to check whether the forward and reverse DNS
for a client's IP address matches. The resolver would try to resolve the
truncated version of the hostname and fail.
Fix this by rejecting a client's resolved hostname if it is too long.
Ned T. Crigler [Sat, 24 Nov 2012 18:38:18 +0000 (10:38 -0800)]
Add the WEBIRC command.
This command is only allowed from trusted clients, and permits the real
hostname of a webirc client be used instead of the hostname of the
webirc gateway they connected through. This can be used to prevent users
from having ircip1.mibbit.com as their hostname, for example.
Trusted clients are added to the ircd.conf by adding special allow
blocks that match ident@host (if an identd response was received), or
webirc@host (if not), and that use a password of the form:
webirc.<password>
For example, in ircd.conf:
allow { ipmask webirc@127.0.0.1; passwd webirc.mypass; class users; };
will allow the command to be used from a non-identd client connecting
from 127.0.0.1 if they use the password mypass in the WEBIRC command.
Opers can also see if a client successfully used this command.
William Pitcock [Tue, 18 Sep 2012 17:52:33 +0000 (12:52 -0500)]
ircd: clean up compiler warnings using -Wall
Remove dead assignments and stalls so that the compiler can remove unnecessary cache misses
in various codepaths caused by unused variables and dead branches.
William Pitcock [Tue, 18 Sep 2012 17:30:51 +0000 (12:30 -0500)]
res: portability improvements for uclibc
This allows building Bahamut on uClibc without any modification. It avoids using
deprecated interfaces in POSIX-2008, such as _getshort(), _getlong() and directly
dereferencing _res (instead, __res_state() should be dereferenced).
Ned T. Crigler [Sun, 29 Jan 2012 19:39:50 +0000 (11:39 -0800)]
Make /who without any flags parse IP addresses and CIDR.
Previously the code for handling /who when not given any flags only
checked for a '.' character to distinguish between a hostname and
nickname. Use the CIDR parsing code to allow it to parse IP addresses
and CIDR too.
Ned T. Crigler [Sun, 8 Jan 2012 02:49:28 +0000 (18:49 -0800)]
Fix identd connections on FreeBSD.
FreeBSD is apparently stricter than Linux with the address length
parameter to the connect system call. The code was using the total
length of the buffer (big enough for either an IPv4 or IPv6 address)
instead of the exact length depending on the kind of address, which
caused FreeBSD to return an error immediately, even though an IPv4
address can still fit in the buffer for an IPv6 address.
Fixed by re-using the address length calculated earlier when binding the
socket.
This was spotted thanks to a user who reported that identd wasn't
working for them.
Ned T. Crigler [Wed, 31 Aug 2011 18:38:50 +0000 (11:38 -0700)]
Fix various problems with non-standard build configurations.
Libraries should be prepended to $LIBS instead of appended, as the
linker only does a single left-to-right pass over the command line.
This sometimes showed up as link errors (such as when shared libraries
are not being used) when -lssl came after -lcrypto, since -lssl depends
on -lcrypto.
Also, we were not actually using the include path for zlib detected by
configure, as it was setting $CPPFLAGS, which wasn't being used in the
Makefiles.
Ned T. Crigler [Wed, 16 Mar 2011 00:39:40 +0000 (17:39 -0700)]
Allow connections to and from IPv6 servers.
When using hostnames (instead of IP addresses) in a connect block, the
address family of the bind statement is used to determine whether the
resolver should use IPv4 or IPv6.
Ned T. Crigler [Wed, 16 Mar 2011 00:37:04 +0000 (17:37 -0700)]
Fix some issues when receiving a numeric IP address from a server.
Some htonl calls were missing when checking for the 0.0.0.1 IP address,
which indicates that a non-IPv4 address was passed through a server that
does not have the NICKIPSTR capability.
Also ensure that the hostip field is correctly set for numeric IP
addresses.
Ned T. Crigler [Mon, 7 Mar 2011 20:57:56 +0000 (12:57 -0800)]
Introduce the possibility of multiple address families.
This patch adds an address family field to each client structure, which
is now checked in various places that expect to only be working with
IPv4 addresses, such as CIDR masking for /who and /rwho.
The IP address 0.0.0.1 is reserved to indicate that a non-IPv4 address
was passed through a server that does not have the NICKIPSTR capability.
Ned T. Crigler [Mon, 7 Mar 2011 20:57:54 +0000 (12:57 -0800)]
Move zero IP checking into clones_add/clones_remove.
The callers of clones_add and clone_remove were directly accessing the
client's IP address. Move this checking into the two functions, to make
it easier to change later.
epiphani [Fri, 18 Jun 2010 20:20:20 +0000 (16:20 -0400)]
Significant update of autoconf/configure scripts
No actual functional changes, mostly housekeeping type updates.
For example, we once had our own epoll detector. It didn't work well.
Now we use an autoconf macro someone else wrote.
Ned T. Crigler [Mon, 17 May 2010 16:09:43 +0000 (09:09 -0700)]
Fix safe_ssl_read/safe_ssl_write to return -1 for EWOULDBLOCK/EAGAIN.
The safe_ssl_read and safe_ssl_write functions were setting errno and
then returning 0, which is incorrect. They should be returning -1
instead, since proper code only checks errno when -1 is returned from a
system call.
This patch should hopefully fix a bug that was causing SSL users to be
disconnected when a large number of bytes were being transferred from or
to the IRC server.
epiphani [Tue, 4 May 2010 15:23:28 +0000 (11:23 -0400)]
Update notifcations for failed OPER attempts
Do not provide hostnames for any failed OPER attempt to non-admin (+A) users.
Side effect: +A users will receive two notices on failed OPER or OPERMASK attempts,
one with hostnames and one without.